stratis-storage/stratis-cli

ValueError: unknown action "extend"?

Closed this issue · 5 comments

The installation of "stratis-cli" seems to have completed successfully. But when I ran it, it generates the following error:

stratis pool create
Traceback (most recent call last):
  File "/usr/bin/../bin/stratis", line 4, in <module>
    __import__('pkg_resources').run_script('stratis-cli==3.6.0', 'stratis')
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1469, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/lib/python3.6/site-packages/stratis_cli-3.6.0-py3.6.egg/EGG-INFO/scripts/stratis", line 35, in <module>
  File "/usr/lib/python3.6/site-packages/stratis_cli-3.6.0-py3.6.egg/EGG-INFO/scripts/stratis", line 32, in main
  File "/usr/lib/python3.6/site-packages/stratis_cli-3.6.0-py3.6.egg/stratis_cli/_main.py", line 30, in run
  File "/usr/lib/python3.6/site-packages/stratis_cli-3.6.0-py3.6.egg/stratis_cli/_parser/_parser.py", line 203, in gen_parser
  File "/usr/lib/python3.6/site-packages/stratis_cli-3.6.0-py3.6.egg/stratis_cli/_parser/_parser.py", line 84, in add_subcommand
  File "/usr/lib/python3.6/site-packages/stratis_cli-3.6.0-py3.6.egg/stratis_cli/_parser/_parser.py", line 86, in add_subcommand
  File "/usr/lib/python3.6/site-packages/stratis_cli-3.6.0-py3.6.egg/stratis_cli/_parser/_parser.py", line 53, in _add_args
  File "/usr/lib64/python3.6/argparse.py", line 1337, in add_argument
    raise ValueError('unknown action "%s"' % (action_class,))
ValueError: unknown action "extend"

any idea how to fix it?

It looks like using Python 3.8 should fix the problem, although stratis-cli officially requires 3.9, so that's the best choice. But Python 3.6 is too old.

Thanks for catching that. We'll add a python_requires key in setup.cfg. We don't release on PyPI, so we never came across this before, Fedora packaging enforces the Python requirement.

I upgraded to python3.11 but now it is reporting a different issue when running stratis CLI:

stratis
Traceback (most recent call last):
  File "/usr/bin/../bin/stratis", line 4, in <module>
    __import__('pkg_resources').run_script('stratis-cli==3.6.0', 'stratis')
  File "/usr/lib/python3.11/site-packages/pkg_resources/__init__.py", line 672, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1479, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/lib/python3.11/site-packages/stratis_cli-3.6.0-py3.11.egg/EGG-INFO/scripts/stratis", line 24, in <module>
  File "/usr/lib/python3.11/site-packages/stratis_cli-3.6.0-py3.11.egg/stratis_cli/__init__.py", line 19, in <module>
  File "/usr/lib/python3.11/site-packages/stratis_cli-3.6.0-py3.11.egg/stratis_cli/_main.py", line 21, in <module>
  File "/usr/lib/python3.11/site-packages/stratis_cli-3.6.0-py3.11.egg/stratis_cli/_error_reporting.py", line 22, in <module>
  File "/usr/lib/python3.11/site-packages/dbus/__init__.py", line 82, in <module>
    import dbus.types as types
  File "/usr/lib/python3.11/site-packages/dbus/types.py", line 6, in <module>
    from _dbus_bindings import (
ImportError: /usr/lib/python3.11/site-packages/_dbus_bindings.so: undefined symbol: _Py_ZeroStruct

That's a deal more tricky. What you're encountering here is a problem with a dependncy dbus-python. It's a wrapper around a C library, and something has clearly gone wrong with how it wraps the library. So, you'll have to give up some system information, like how the dbus library was installed. We can investigate if this is happening on a Fedora distribution, but less so on others. If you want to pursue it further, the right thing is to open a Python interpreter and enter:

> import dbus.types as types

and see what happens. Probably the same error and that makes it a packaging bug or a dbus-python bug or something further down in the dependency tree.

@yxiang92128 If you come up with further information on this bug, including the platform on which it is occurring, etc., please let us know.