[openstackclient] openstack cli broken after update to Wallaby
Hi *, today I upgraded my virtual test environment from V to W when (Ubuntu 20.04) all of a sudden cli commands didn't work anymore with this stack trace: ---snip--- root@control01:~# openstack network agent list Traceback (most recent call last): File "/usr/bin/openstack", line 6, in <module> from openstackclient.shell import main File "/usr/lib/python3/dist-packages/openstackclient/shell.py", line 23, in <module> from osc_lib import shell File "/usr/lib/python3/dist-packages/osc_lib/shell.py", line 24, in <module> from cliff import app File "/usr/lib/python3/dist-packages/cliff/app.py", line 22, in <module> import cmd2 File "/usr/lib/python3/dist-packages/cmd2.py", line 585, in <module> _ = pyperclip.paste() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 667, in lazy_load_stub_paste copy, paste = determine_clipboard() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 558, in determine_clipboard return init_gi_clipboard() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 167, in init_gi_clipboard gi.require_version('Gtk', '3.0') File "/usr/lib/python3/dist-packages/gi/__init__.py", line 129, in require_version raise ValueError('Namespace %s not available' % namespace) ValueError: Namespace Gtk not available ---snip--- I found this bug [1] describing the same issue but there has been no progress. I posted my comments there as well. I found one way to get the openstack shell to work by installing libgtk-3-dev (I found a hint in a search engine). Apparently, python3-cmd2 requires python3-pyperclip which requires python3-gi and so on. Is this really the desired way? I didn't notice anything in the release notes (maybe I missed it). When comparing to a different environment (Victoria on baremetal) I see that libgtk-3 is installed there (not -dev though), but even with libgtk-3-0 the error message was still present. So the question is, which dependencies are missing where? It's not really obvious to me. Could this already be fixed in Xena? If it is fixed there I could do the double upgrade, of course, especially since Wallaby is already under extended maintenance. Any comments are appreciated. Thanks, Eugen [1] https://bugs.launchpad.net/ubuntu/+source/python-openstackclient/+bug/194566...
Update: I reinstalled my lab environment with Wallaby from scratch, no upgrade, still the same error. Then I reinstalled with Xena, with the same error. What am I missing here? This is the Xena version of python3-openstackclient: root@control01:~# apt show python3-openstackclient Package: python3-openstackclient Version: 5.6.0-0ubuntu1~cloud0 Any comments would be appreciated! Thanks, Eugen Zitat von Eugen Block <eblock@nde.ag>:
Hi *,
today I upgraded my virtual test environment from V to W when (Ubuntu 20.04) all of a sudden cli commands didn't work anymore with this stack trace:
---snip--- root@control01:~# openstack network agent list Traceback (most recent call last): File "/usr/bin/openstack", line 6, in <module> from openstackclient.shell import main File "/usr/lib/python3/dist-packages/openstackclient/shell.py", line 23, in <module> from osc_lib import shell File "/usr/lib/python3/dist-packages/osc_lib/shell.py", line 24, in <module> from cliff import app File "/usr/lib/python3/dist-packages/cliff/app.py", line 22, in <module> import cmd2 File "/usr/lib/python3/dist-packages/cmd2.py", line 585, in <module> _ = pyperclip.paste() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 667, in lazy_load_stub_paste copy, paste = determine_clipboard() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 558, in determine_clipboard return init_gi_clipboard() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 167, in init_gi_clipboard gi.require_version('Gtk', '3.0') File "/usr/lib/python3/dist-packages/gi/__init__.py", line 129, in require_version raise ValueError('Namespace %s not available' % namespace) ValueError: Namespace Gtk not available ---snip---
I found this bug [1] describing the same issue but there has been no progress. I posted my comments there as well. I found one way to get the openstack shell to work by installing libgtk-3-dev (I found a hint in a search engine). Apparently, python3-cmd2 requires python3-pyperclip which requires python3-gi and so on. Is this really the desired way? I didn't notice anything in the release notes (maybe I missed it). When comparing to a different environment (Victoria on baremetal) I see that libgtk-3 is installed there (not -dev though), but even with libgtk-3-0 the error message was still present. So the question is, which dependencies are missing where? It's not really obvious to me. Could this already be fixed in Xena? If it is fixed there I could do the double upgrade, of course, especially since Wallaby is already under extended maintenance. Any comments are appreciated.
Thanks, Eugen
[1] https://bugs.launchpad.net/ubuntu/+source/python-openstackclient/+bug/194566...
I think this thread is invalid. It must have something to do with my VM image where I'm testing all of this. When I removed a lot of packages which I refer to openstack and then reinstalled only python3-openstackclient it works as expected in W, X and Y releases. I just didn't test the upgrade yet after cleaning up properly. Hopefully, this won't be an issue during the actual upgrade of the baremetal nodes. Thanks, Eugen Zitat von Eugen Block <eblock@nde.ag>:
Update: I reinstalled my lab environment with Wallaby from scratch, no upgrade, still the same error. Then I reinstalled with Xena, with the same error. What am I missing here? This is the Xena version of python3-openstackclient:
root@control01:~# apt show python3-openstackclient Package: python3-openstackclient Version: 5.6.0-0ubuntu1~cloud0
Any comments would be appreciated! Thanks, Eugen
Zitat von Eugen Block <eblock@nde.ag>:
Hi *,
today I upgraded my virtual test environment from V to W when (Ubuntu 20.04) all of a sudden cli commands didn't work anymore with this stack trace:
---snip--- root@control01:~# openstack network agent list Traceback (most recent call last): File "/usr/bin/openstack", line 6, in <module> from openstackclient.shell import main File "/usr/lib/python3/dist-packages/openstackclient/shell.py", line 23, in <module> from osc_lib import shell File "/usr/lib/python3/dist-packages/osc_lib/shell.py", line 24, in <module> from cliff import app File "/usr/lib/python3/dist-packages/cliff/app.py", line 22, in <module> import cmd2 File "/usr/lib/python3/dist-packages/cmd2.py", line 585, in <module> _ = pyperclip.paste() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 667, in lazy_load_stub_paste copy, paste = determine_clipboard() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 558, in determine_clipboard return init_gi_clipboard() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 167, in init_gi_clipboard gi.require_version('Gtk', '3.0') File "/usr/lib/python3/dist-packages/gi/__init__.py", line 129, in require_version raise ValueError('Namespace %s not available' % namespace) ValueError: Namespace Gtk not available ---snip---
I found this bug [1] describing the same issue but there has been no progress. I posted my comments there as well. I found one way to get the openstack shell to work by installing libgtk-3-dev (I found a hint in a search engine). Apparently, python3-cmd2 requires python3-pyperclip which requires python3-gi and so on. Is this really the desired way? I didn't notice anything in the release notes (maybe I missed it). When comparing to a different environment (Victoria on baremetal) I see that libgtk-3 is installed there (not -dev though), but even with libgtk-3-0 the error message was still present. So the question is, which dependencies are missing where? It's not really obvious to me. Could this already be fixed in Xena? If it is fixed there I could do the double upgrade, of course, especially since Wallaby is already under extended maintenance. Any comments are appreciated.
Thanks, Eugen
[1] https://bugs.launchpad.net/ubuntu/+source/python-openstackclient/+bug/194566...
We tend to use python virtualenvs for the openstack cli as there are varying dependencies for the releases. It also allows you to have multiple cli versions installed without conflicts. ________________________________ From: Eugen Block <eblock@nde.ag> Sent: 05 April 2023 14:12 To: openstack-discuss@lists.openstack.org <openstack-discuss@lists.openstack.org> Subject: Re: [openstackclient] openstack cli broken after update to Wallaby [closed] CAUTION: This email originates from outside THG I think this thread is invalid. It must have something to do with my VM image where I'm testing all of this. When I removed a lot of packages which I refer to openstack and then reinstalled only python3-openstackclient it works as expected in W, X and Y releases. I just didn't test the upgrade yet after cleaning up properly. Hopefully, this won't be an issue during the actual upgrade of the baremetal nodes. Thanks, Eugen Zitat von Eugen Block <eblock@nde.ag>:
Update: I reinstalled my lab environment with Wallaby from scratch, no upgrade, still the same error. Then I reinstalled with Xena, with the same error. What am I missing here? This is the Xena version of python3-openstackclient:
root@control01:~# apt show python3-openstackclient Package: python3-openstackclient Version: 5.6.0-0ubuntu1~cloud0
Any comments would be appreciated! Thanks, Eugen
Zitat von Eugen Block <eblock@nde.ag>:
Hi *,
today I upgraded my virtual test environment from V to W when (Ubuntu 20.04) all of a sudden cli commands didn't work anymore with this stack trace:
---snip--- root@control01:~# openstack network agent list Traceback (most recent call last): File "/usr/bin/openstack", line 6, in <module> from openstackclient.shell import main File "/usr/lib/python3/dist-packages/openstackclient/shell.py", line 23, in <module> from osc_lib import shell File "/usr/lib/python3/dist-packages/osc_lib/shell.py", line 24, in <module> from cliff import app File "/usr/lib/python3/dist-packages/cliff/app.py", line 22, in <module> import cmd2 File "/usr/lib/python3/dist-packages/cmd2.py", line 585, in <module> _ = pyperclip.paste() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 667, in lazy_load_stub_paste copy, paste = determine_clipboard() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 558, in determine_clipboard return init_gi_clipboard() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 167, in init_gi_clipboard gi.require_version('Gtk', '3.0') File "/usr/lib/python3/dist-packages/gi/__init__.py", line 129, in require_version raise ValueError('Namespace %s not available' % namespace) ValueError: Namespace Gtk not available ---snip---
I found this bug [1] describing the same issue but there has been no progress. I posted my comments there as well. I found one way to get the openstack shell to work by installing libgtk-3-dev (I found a hint in a search engine). Apparently, python3-cmd2 requires python3-pyperclip which requires python3-gi and so on. Is this really the desired way? I didn't notice anything in the release notes (maybe I missed it). When comparing to a different environment (Victoria on baremetal) I see that libgtk-3 is installed there (not -dev though), but even with libgtk-3-0 the error message was still present. So the question is, which dependencies are missing where? It's not really obvious to me. Could this already be fixed in Xena? If it is fixed there I could do the double upgrade, of course, especially since Wallaby is already under extended maintenance. Any comments are appreciated.
Thanks, Eugen
On Tue, Apr 4, 2023, at 7:34 AM, Eugen Block wrote:
Hi *,
today I upgraded my virtual test environment from V to W when (Ubuntu 20.04) all of a sudden cli commands didn't work anymore with this stack trace:
---snip--- root@control01:~# openstack network agent list Traceback (most recent call last): File "/usr/bin/openstack", line 6, in <module> from openstackclient.shell import main File "/usr/lib/python3/dist-packages/openstackclient/shell.py", line 23, in <module> from osc_lib import shell File "/usr/lib/python3/dist-packages/osc_lib/shell.py", line 24, in <module> from cliff import app File "/usr/lib/python3/dist-packages/cliff/app.py", line 22, in <module> import cmd2 File "/usr/lib/python3/dist-packages/cmd2.py", line 585, in <module> _ = pyperclip.paste() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 667, in lazy_load_stub_paste copy, paste = determine_clipboard() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 558, in determine_clipboard return init_gi_clipboard() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 167, in init_gi_clipboard gi.require_version('Gtk', '3.0') File "/usr/lib/python3/dist-packages/gi/__init__.py", line 129, in require_version raise ValueError('Namespace %s not available' % namespace) ValueError: Namespace Gtk not available ---snip---
I found this bug [1] describing the same issue but there has been no progress. I posted my comments there as well. I found one way to get the openstack shell to work by installing libgtk-3-dev (I found a hint in a search engine). Apparently, python3-cmd2 requires python3-pyperclip which requires python3-gi and so on. Is this really the desired way? I didn't notice anything in the release notes (maybe I missed it). When comparing to a different environment (Victoria on baremetal) I see that libgtk-3 is installed there (not -dev though), but even with libgtk-3-0 the error message was still present. So the question is, which dependencies are missing where? It's not really obvious to me. Could this already be fixed in Xena? If it is fixed there I could do the double upgrade, of course, especially since Wallaby is already under extended maintenance. Any comments are appreciated.
I know you've marked this invalid elsewhere, but I think there is an interesting problem somewhere here. In particular I've cloned https://github.com/asweigart/pyperclip which backs the pyperclip pypi package https://pypi.org/project/pyperclip/. Reading determine_clipboard() it seems to do all this extra work (on Linux anyway) if DISPLAY is set. One easy workaround may be to unset that env var in your terminals when running openstackclient. That said looking more closely init_gi_clipboard() isn't in the current code base. Looking at the history of the project: `git log -p | grep init_gi_clipboard` produces no results either. This makes me wonder where that is coming from and what version/source of pyperclip you are using. If I grab pyperclip 1.8.2 (which is the upper constraints version for wallaby and xena) from pypi this function doesn't appear to exist there either. It is possible they rewrote their git history at some point, but best I can tell your version of pyperclip doesn't share code or history with the version on pypi specified in upper constraints for wallaby and xena. Also it looks like if you install xsel or xclip that pyperclip will prefer those tools over the gtk bindings.
Thanks, Eugen
[1] https://bugs.launchpad.net/ubuntu/+source/python-openstackclient/+bug/194566...
On 2023-04-05 14:37:45 -0700 (-0700), Clark Boylan wrote: [...]
That said looking more closely init_gi_clipboard() isn't in the current code base. Looking at the history of the project: `git log -p | grep init_gi_clipboard` produces no results either. This makes me wonder where that is coming from and what version/source of pyperclip you are using. If I grab pyperclip 1.8.2 (which is the upper constraints version for wallaby and xena) from pypi this function doesn't appear to exist there either. It is possible they rewrote their git history at some point, but best I can tell your version of pyperclip doesn't share code or history with the version on pypi specified in upper constraints for wallaby and xena. [...]
Tracking this down, it looks like a pyperclip package from a Linux distribution is leaking into that environment. The relevant functions can be found added by Ubuntu's 0001-Switch-from-GTK-2-to-GTK-3-to-avoid-import-of-mutual.patch which references https://bugzilla.gnome.org/show_bug.cgi?id=709183 as the reason for its inclusion. Other distros have copies of this patch into their packages as well (at least Debian does, not sure which others might), but mixing packages of Python libs from a Linux distribution and from PyPI in the same environment is a recipe for disaster. -- Jeremy Stanley
Hi, thanks for your efforts. I don't mind continuing this discussion. I just reset my VM to the snapshot which I use as a starting point. There is currently no pyperclip installed: root@control01:~# dpkg -l | grep pyperclip root@control01:~# apt-cache search pyperclip python3-pyperclip - Cross-platform clipboard module for Python3 root@control01:~# apt show python3-pyperclip Package: python3-pyperclip Version: 1.7.0-1 The package would be installed from the main repo (ubuntu-2004-amd64-main-amd64). This is the state before I install any openstack related packages.
Also it looks like if you install xsel or xclip that pyperclip will prefer those tools over the gtk bindings.
I did try that with xsel but it didn't work either.
Other distros have copies of this patch into their packages as well (at least Debian does, not sure which others might), but mixing packages of Python libs from a Linux distribution and from PyPI in the same environment is a recipe for disaster.
I understand, but how does PyPI get into this environment? How could I find out? Thanks, Eugen Zitat von Jeremy Stanley <fungi@yuggoth.org>:
On 2023-04-05 14:37:45 -0700 (-0700), Clark Boylan wrote: [...]
That said looking more closely init_gi_clipboard() isn't in the current code base. Looking at the history of the project: `git log -p | grep init_gi_clipboard` produces no results either. This makes me wonder where that is coming from and what version/source of pyperclip you are using. If I grab pyperclip 1.8.2 (which is the upper constraints version for wallaby and xena) from pypi this function doesn't appear to exist there either. It is possible they rewrote their git history at some point, but best I can tell your version of pyperclip doesn't share code or history with the version on pypi specified in upper constraints for wallaby and xena. [...]
Tracking this down, it looks like a pyperclip package from a Linux distribution is leaking into that environment. The relevant functions can be found added by Ubuntu's 0001-Switch-from-GTK-2-to-GTK-3-to-avoid-import-of-mutual.patch which references https://bugzilla.gnome.org/show_bug.cgi?id=709183 as the reason for its inclusion. Other distros have copies of this patch into their packages as well (at least Debian does, not sure which others might), but mixing packages of Python libs from a Linux distribution and from PyPI in the same environment is a recipe for disaster. -- Jeremy Stanley
On 2023-04-06 07:31:53 +0000 (+0000), Eugen Block wrote: [...]
The package would be installed from the main repo (ubuntu-2004-amd64-main-amd64). This is the state before I install any openstack related packages. [...] I understand, but how does PyPI get into this environment? How could I find out? [...]
Oh, sorry, this is probably an incorrect assumption on my part. If the bug you're experiencing is with the OpenStack client installed from Ubuntu's packages, then you need to report that traceback to Canonical/Ubuntu. It mentions code paths which aren't present in the pyperclip we test with upstream, because we don't test with Ubuntu's packages of Python libraries, so may be a problem specific to Ubuntu's own packages. The general rule is that when encountering a bug while using a downstream distribution of any application, you should report the bug to the distribution you're using rather than to the upstream development community, because distributions often patch things in order to make their collection of software more consistent and coinstallable, and therefore have a better idea of whether a problem you're encountering is one of their own making or something they should pass upstream to be investigated in the software itself. -- Jeremy Stanley
Thanks, I'm still not sure if it actually is a bug, to be honest. I compared the list of packages between V and W and W contains almost double the amount. From ceph to librte (not sure what those are for) the differences are huge, for example W contains the openvswitch packages while in V they are from the main update repo. I will try to get to the bottom of this and if it actually is a bug I'll report it to Canonical. Thanks for your input! Eugen Zitat von Jeremy Stanley <fungi@yuggoth.org>:
On 2023-04-06 07:31:53 +0000 (+0000), Eugen Block wrote: [...]
The package would be installed from the main repo (ubuntu-2004-amd64-main-amd64). This is the state before I install any openstack related packages. [...] I understand, but how does PyPI get into this environment? How could I find out? [...]
Oh, sorry, this is probably an incorrect assumption on my part.
If the bug you're experiencing is with the OpenStack client installed from Ubuntu's packages, then you need to report that traceback to Canonical/Ubuntu. It mentions code paths which aren't present in the pyperclip we test with upstream, because we don't test with Ubuntu's packages of Python libraries, so may be a problem specific to Ubuntu's own packages.
The general rule is that when encountering a bug while using a downstream distribution of any application, you should report the bug to the distribution you're using rather than to the upstream development community, because distributions often patch things in order to make their collection of software more consistent and coinstallable, and therefore have a better idea of whether a problem you're encountering is one of their own making or something they should pass upstream to be investigated in the software itself. -- Jeremy Stanley
Hi Clark, you were on the right track with the DISPLAY variable. I had some other stuff on the plate and today I started a new approach. Long story short, I have an alias for ssh in my bash profile (our admin set that up years ago) which hasn't bit me until now: alias ssh='ssh -X' This seems to work fine on Leap 15.2 and Victoria, though, but I'll just need to make sure not to use the alias on Ubuntu, I guess. Maybe I'll remove the alias entirely. Thanks! Eugen Zitat von Clark Boylan <cboylan@sapwetik.org>:
On Tue, Apr 4, 2023, at 7:34 AM, Eugen Block wrote:
Hi *,
today I upgraded my virtual test environment from V to W when (Ubuntu 20.04) all of a sudden cli commands didn't work anymore with this stack trace:
---snip--- root@control01:~# openstack network agent list Traceback (most recent call last): File "/usr/bin/openstack", line 6, in <module> from openstackclient.shell import main File "/usr/lib/python3/dist-packages/openstackclient/shell.py", line 23, in <module> from osc_lib import shell File "/usr/lib/python3/dist-packages/osc_lib/shell.py", line 24, in <module> from cliff import app File "/usr/lib/python3/dist-packages/cliff/app.py", line 22, in <module> import cmd2 File "/usr/lib/python3/dist-packages/cmd2.py", line 585, in <module> _ = pyperclip.paste() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 667, in lazy_load_stub_paste copy, paste = determine_clipboard() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 558, in determine_clipboard return init_gi_clipboard() File "/usr/lib/python3/dist-packages/pyperclip/__init__.py", line 167, in init_gi_clipboard gi.require_version('Gtk', '3.0') File "/usr/lib/python3/dist-packages/gi/__init__.py", line 129, in require_version raise ValueError('Namespace %s not available' % namespace) ValueError: Namespace Gtk not available ---snip---
I found this bug [1] describing the same issue but there has been no progress. I posted my comments there as well. I found one way to get the openstack shell to work by installing libgtk-3-dev (I found a hint in a search engine). Apparently, python3-cmd2 requires python3-pyperclip which requires python3-gi and so on. Is this really the desired way? I didn't notice anything in the release notes (maybe I missed it). When comparing to a different environment (Victoria on baremetal) I see that libgtk-3 is installed there (not -dev though), but even with libgtk-3-0 the error message was still present. So the question is, which dependencies are missing where? It's not really obvious to me. Could this already be fixed in Xena? If it is fixed there I could do the double upgrade, of course, especially since Wallaby is already under extended maintenance. Any comments are appreciated.
I know you've marked this invalid elsewhere, but I think there is an interesting problem somewhere here. In particular I've cloned https://github.com/asweigart/pyperclip which backs the pyperclip pypi package https://pypi.org/project/pyperclip/. Reading determine_clipboard() it seems to do all this extra work (on Linux anyway) if DISPLAY is set. One easy workaround may be to unset that env var in your terminals when running openstackclient.
That said looking more closely init_gi_clipboard() isn't in the current code base. Looking at the history of the project: `git log -p | grep init_gi_clipboard` produces no results either. This makes me wonder where that is coming from and what version/source of pyperclip you are using. If I grab pyperclip 1.8.2 (which is the upper constraints version for wallaby and xena) from pypi this function doesn't appear to exist there either. It is possible they rewrote their git history at some point, but best I can tell your version of pyperclip doesn't share code or history with the version on pypi specified in upper constraints for wallaby and xena.
Also it looks like if you install xsel or xclip that pyperclip will prefer those tools over the gtk bindings.
Thanks, Eugen
[1] https://bugs.launchpad.net/ubuntu/+source/python-openstackclient/+bug/194566...
participants (4)
-
Clark Boylan
-
Danny Webb
-
Eugen Block
-
Jeremy Stanley