leapp-repository icon indicating copy to clipboard operation
leapp-repository copied to clipboard

Podman: snactor discovery and run issues

Open landgraf opened this issue 7 years ago • 25 comments

Actual behavior I try to discover supported entities from the el7toel8 repository and it's failed because of missing common repository. Linking these repos together doesn't help.

To Reproduce Clone repo cd leapp-repository/repos/system_upgrade/el7toel8 snactor discovery <traceback_see_below> snactor link --path ../../common snactor discovery <traceback_see_below>

Expected behavior list of entities

System information (please complete the following information): fedora rawhide + virtualenv leapp snactor version 0.5.0 leapp-repository commit 8d722afcc23c9402a0e6a33b8fb47d0f6e93dac9

$ snactor discover
Traceback (most recent call last):
  File "/usr/bin/snactor", line 9, in <module>
    load_entry_point('leapp==0.5.0', 'console_scripts', 'snactor')()
  File "/usr/lib/python2.7/site-packages/leapp/snactor/__init__.py", line 67, in main
    cli.command.execute(version=_('snactor version {}').format(VERSION))
  File "/usr/lib/python2.7/site-packages/leapp/utils/clicmd.py", line 80, in execute
    args.func(args)
  File "/usr/lib/python2.7/site-packages/leapp/utils/clicmd.py", line 102, in called
    self.target(args)
  File "/usr/lib/python2.7/site-packages/leapp/utils/repository.py", line 20, in checker
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/leapp/snactor/commands/discover.py", line 105, in cli
    repository = find_and_scan_repositories(base_dir, include_locals=True)
  File "/usr/lib/python2.7/site-packages/leapp/repository/scan.py", line 57, in find_and_scan_repositories
    _resolve_repository_links(manager=manager, include_locals=include_locals)
  File "/usr/lib/python2.7/site-packages/leapp/repository/scan.py", line 39, in _resolve_repository_links
    raise RepositoryConfigurationError('Missing repositories detected: {}'.format(', '.join(missing)))
leapp.exceptions.RepositoryConfigurationError: Missing repositories detected: efcf9016-f2d1-4609-9329-a298e6587b3c

landgraf avatar Apr 03 '19 10:04 landgraf

CCing @vinzenz.

bocekm avatar Aug 09 '19 17:08 bocekm

I am experiencing the same issue. Not only with snactor discovery, but also with snactor run actors/(does not matter)/actor.py

System info

  • fedora silverblue 30 + toolbox with f30 image
  • snactor version 0.8.1
  • leapp-repository commit https://github.com/oamg/leapp-repository/commit/e355543ae334c1ee886692f019983d7245e9325d

Honza0297 avatar Aug 21 '19 12:08 Honza0297

I've just tried snactor discover after installing the latest snactor build from Fedora Copr (0.8.1-1.201908200828Z.8bbf9d3.master.el7) on my F30. It worked fine. Where did you get the 0.8.1 version from? Paste your traceback here please.

bocekm avatar Aug 26 '19 15:08 bocekm

By the way, the traceback shows that python 2.7 version of leapp has been installed. I have it installed for python 3.7. @landgraf, @Honza0297, could you please try installing current version of snactor from the Fedora Copr and see if it's installed for python 3? It definitely shouldn't be installed for python 2 on Fedora. Thanks.

bocekm avatar Aug 26 '19 15:08 bocekm

@bocekm When i was installing leapp according to the tutorial (link), there was a problem with leapp-repository dependency, which is needed in version 0.8.1, but the only available version from Copr repository is 0.3.1, so I had to install it in some twisted way (which I do not remember, unfortunately) - this could be the main reason why it is not working for me.

Honza0297 avatar Sep 02 '19 09:09 Honza0297

@Honza0297, unfortunately we are unable to build leapp-repository in the Fedora Copr at the moment. You can build the rpm locally with the following script: https://0bin.net/paste/J30FLCXiLit10Xgq#OjBkwlGdScLjKgMUxDZkKQXkbRVvS6jsQLSS9wbx4QU Or ping me or anybody on #leapp IRC and we'll send you a link to the internal Copr with the latest leapp-repository packages. We're working on a better solution.

bocekm avatar Sep 02 '19 11:09 bocekm

@bocekm Unfortunately, the script does not work either - rpmbuild fails on %build section.

I have also tried to install snactor again in new f30 container to check if it requires Python 2 or 3 by typing: sudo dnf config-manager --add-repo https://copr.fedorainfracloud.org/coprs/g/leapp/leapp-devel/repo/epel-7/group_leapp-leapp-devel-epel-7.repo sudo dnf install snactor and Python 2 is required.

Honza0297 avatar Sep 04 '19 08:09 Honza0297

@Honza0297, you're right, I'm also getting this on f30:

Installing:
 snactor                             noarch                       0.8.1-1.201909041507Z.d251200.master.el7                        copr:copr.fedorainfracloud.org:group_leapp:leapp-devel                       8.7 k
Installing dependencies:
 python2-leapp                       noarch                       0.8.1-1.201909041507Z.d251200.master.el7                        copr:copr.fedorainfracloud.org:group_leapp:leapp-devel                       176 k

It should be requiring python3-leapp.

bocekm avatar Sep 04 '19 17:09 bocekm

Actually it should be requiring python2-leapp because that's snactor for CentOS/RHEL7. I was blindly copy pasting your command and didn't catch that the repo you used is not for F30. Use this instead and python3-leapp will be installed: sudo dnf config-manager --add-repo https://copr.fedorainfracloud.org/coprs/g/leapp/leapp-devel/repo/fedora-30/group_leapp-leapp-devel-fedora-30.repo

bocekm avatar Sep 04 '19 17:09 bocekm

@bocekm Great, thanks! By the way, it would be useful to update the tutorial to reflect these differences. As a newcomer to leapp, I just did what the tutorial told me without knowing there is also f30 repo.

Honza0297 avatar Sep 04 '19 18:09 Honza0297

@Honza0297, good point, thanks.

bocekm avatar Sep 04 '19 18:09 bocekm

@bocekm After I used the f30 repo and installed snactor from it, there is no change and snactor still throws the same error as before.

Honza0297 avatar Sep 05 '19 12:09 Honza0297

@Honza0297, please paste the error here.

bocekm avatar Sep 05 '19 15:09 bocekm

$ snactor discover

Traceback (most recent call last):
  File "/usr/bin/snactor", line 11, in <module>
    load_entry_point('leapp==0.8.1', 'console_scripts', 'snactor')()
  File "/usr/lib/python3.7/site-packages/leapp/snactor/__init__.py", line 73, in main
    cli.command.execute(version=_('snactor version {}').format(VERSION))
  File "/usr/lib/python3.7/site-packages/leapp/utils/clicmd.py", line 103, in execute
    args.func(args)
  File "/usr/lib/python3.7/site-packages/leapp/utils/clicmd.py", line 125, in called
    self.target(args)
  File "/usr/lib/python3.7/site-packages/leapp/utils/repository.py", line 20, in checker
    return f(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/leapp/snactor/context.py", line 32, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/leapp/snactor/commands/run.py", line 31, in cli
    repository = find_and_scan_repositories(basedir, include_locals=True)
  File "/usr/lib/python3.7/site-packages/leapp/repository/scan.py", line 57, in find_and_scan_repositories
    _resolve_repository_links(manager=manager, include_locals=include_locals)
  File "/usr/lib/python3.7/site-packages/leapp/repository/scan.py", line 39, in _resolve_repository_links
    raise RepositoryConfigurationError('Missing repositories detected: {}'.format(', '.join(missing)))
leapp.exceptions.RepositoryConfigurationError: Missing repositories detected: efcf9016-f2d1-4609-9329-a298e6587b3c

Honza0297 avatar Sep 05 '19 15:09 Honza0297

@bocekm Would be possible to make a direct conversation (on IRC for example) if you have time?

Honza0297 avatar Sep 06 '19 09:09 Honza0297

@Honza0297, sure, mbocek nick on #leapp. Or stop by at 2D383 in TPB-C.

bocekm avatar Sep 06 '19 12:09 bocekm

The issue may be podman related - @Honza0297 runs a F30 pod. There seems to be also an issue, maybe related, with socket.getfqdn() as it takes around 10 seconds.

With 0.8.1-100.201909061315Z.723e780.master.el7 snactor installed:
$ snactor
^C
Traceback (most recent call last):
  File "/usr/bin/snactor", line 11, in <module>
    load_entry_point('leapp==0.8.1', 'console_scripts', 'snactor')()
  File "/usr/lib/python3.7/site-packages/leapp/snactor/__init__.py", line 71, in main
    os.environ['LEAPP_HOSTNAME'] = socket.getfqdn()
  File "/usr/lib64/python3.7/socket.py", line 676, in getfqdn
    hostname, aliases, ipaddrs = gethostbyaddr(name)
KeyboardInterrupt
 
$ hostnamectl set-hostname localhost.localdomain
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to create bus connection: Host is down

$ snactor repo find --path .
Registering .

$ snactor run check_nfs
Traceback (most recent call last):
  File "/usr/bin/snactor", line 11, in <module>
    load_entry_point('leapp==0.8.1', 'console_scripts', 'snactor')()
  File "/usr/lib/python3.7/site-packages/leapp/snactor/__init__.py", line 73, in main
    cli.command.execute(version=_('snactor version {}').format(VERSION))
  File "/usr/lib/python3.7/site-packages/leapp/utils/clicmd.py", line 103, in execute
    args.func(args)
  File "/usr/lib/python3.7/site-packages/leapp/utils/clicmd.py", line 125, in called
    self.target(args)
  File "/usr/lib/python3.7/site-packages/leapp/utils/repository.py", line 20, in checker
    return f(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/leapp/snactor/context.py", line 32, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/leapp/snactor/commands/run.py", line 31, in cli
    repository = find_and_scan_repositories(basedir, include_locals=True)
  File "/usr/lib/python3.7/site-packages/leapp/repository/scan.py", line 57, in find_and_scan_repositories
    _resolve_repository_links(manager=manager, include_locals=include_locals)
  File "/usr/lib/python3.7/site-packages/leapp/repository/scan.py", line 39, in _resolve_repository_links
    raise RepositoryConfigurationError('Missing repositories detected: {}'.format(', '.join(missing)))
leapp.exceptions.RepositoryConfigurationError: Missing repositories detected: efcf9016-f2d1-4609-9329-a298e6587b3c

bocekm avatar Sep 09 '19 13:09 bocekm

Actually I wonder where snactor repo scan was run from. Also it would be a good idea to run snactor repo healthcheck

vinzenz avatar Sep 09 '19 15:09 vinzenz

snactor repo health-check has no output here. And after run it, snactor discover still fails.

Path where we run snactor commands is:

$ pwd 
/home/jaberan/Documents/projects/rhel_upgrade_script/leapp-repository/repos/system_upgrade/el7toel8

Honza0297 avatar Sep 10 '19 07:09 Honza0297

You need to run

$ snactor repo find --path /home/jaberan/Documents/projects/rhel_upgrade_script/leapp-repository/repos

The common repo is not registered which is in leapp-repository/repos/common

That should solve that problem with the discovery for you.

vinzenz avatar Sep 10 '19 07:09 vinzenz

Good news: error with missing repo is fixed! Thanks! However, another problem occurred. When I run snactor run --debug (actor) where (actor) is any actor, I get no output. It should write at least some logs like here in tutorial (bottom of the page), shouldn't it?

Honza0297 avatar Sep 10 '19 08:09 Honza0297

Since this is highly probably specific only to podman, I'd say it's niche problem, and I would kindly ask you to use either our devel vagrant box or any RHEL VM. I'll leave the issue open for somebody like @vinzenz or @fernflower to look at that if they find a time.

bocekm avatar Sep 12 '19 13:09 bocekm

@Honza0297 Do you mean, that you expect an output from the actor to see on stdout? --print-output Is it what are you looking for?

pirat89 avatar Sep 15 '19 13:09 pirat89

@bocekm OK, that is probably the best solution. @pirat89 Unfortunately not. I expect to see some debug info and/or status messages. And --print-output does not work either.

Honza0297 avatar Sep 16 '19 07:09 Honza0297

@Honza0297 Ok, in that case there is really bug hidden inside I guess.

pirat89 avatar Sep 17 '19 07:09 pirat89