oamg / leapp-repository

Leapp repositories containing actors for the Leapp framework (https://github.com/oamg/leapp). Currently provides leapp repositories for in-place upgrades of RHEL systems.
Apache License 2.0
52 stars 146 forks source link

Podman: snactor discovery and run issues #124

Open landgraf opened 5 years ago

landgraf commented 5 years ago

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

snactor link --path ../../common snactor discovery **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 ```bash $ snactor discover Traceback (most recent call last): File "/usr/bin/snactor", line 9, in 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 ```
bocekm commented 5 years ago

CCing @vinzenz.

Honza0297 commented 5 years ago

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

System info

bocekm commented 5 years ago

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 commented 5 years ago

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.

Honza0297 commented 5 years ago

@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.

bocekm commented 5 years ago

@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.

Honza0297 commented 5 years ago

@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.

bocekm commented 5 years ago

@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 commented 5 years ago

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

Honza0297 commented 5 years ago

@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.

bocekm commented 5 years ago

@Honza0297, good point, thanks.

Honza0297 commented 5 years ago

@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.

bocekm commented 5 years ago

@Honza0297, please paste the error here.

Honza0297 commented 5 years ago
$ 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 commented 5 years ago

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

bocekm commented 5 years ago

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

bocekm commented 5 years ago

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 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 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 ```
vinzenz commented 5 years ago

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

Honza0297 commented 5 years ago

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
vinzenz commented 5 years ago

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.

Honza0297 commented 5 years ago

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?

bocekm commented 5 years ago

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.

pirat89 commented 5 years ago

@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?

Honza0297 commented 5 years ago

@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.

pirat89 commented 5 years ago

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