Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remnux upgrade --mode=addon fails on WSL2 #142

Open
tuttimann opened this issue Aug 16, 2023 · 13 comments
Open

Remnux upgrade --mode=addon fails on WSL2 #142

tuttimann opened this issue Aug 16, 2023 · 13 comments

Comments

@tuttimann
Copy link

tuttimann commented Aug 16, 2023

I am trying to upgrade remnux on WSL2, but always fails with following error code:

[email protected]
remnux-version: v2023.20.1

mode: addon
downloading v2023.31.1

downloading remnux-salt-states-v2023.31.1.tar.gz.asc
downloading remnux-salt-states-v2023.31.1.tar.gz.sha256
downloading remnux-salt-states-v2023.31.1.tar.gz.sha256.asc
downloading remnux-salt-states-v2023.31.1.tar.gz
validating file remnux-salt-states-v2023.31.1.tar.gz
validating signature for remnux-salt-states-v2023.31.1.tar.gz.sha256
extracting update remnux-salt-states-v2023.31.1.tar.gz
upgrading/updating to v2023.31.1
Log file: /var/cache/remnux/cli/v2023.31.1/saltstack.log

Update returned exit code not zero
Error: Update returned exit code not zero
at ChildProcess. (/snapshot/remnux-cli/remnux-cli.js:569:23)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

Sometimes problems occur due to network or server issues when
downloading packages, in which case retrying your operation
a bit later might lead to good results.

To determine the nature of the issue, please review the
saltstack.log file under /var/cache/remnux/cli in the
subdirectory that matches the REMnux version you're installing.
Search for the log file for "result: false" messages and look at
the surrounding lines to diagnose the issue.

For assistance go to https://github.com/REMnux/remnux-cli/issues

This is the content of latest saltstack.log:

_/usr/bin/salt-call:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import load_entry_point
[DEBUG ] Missing configuration file: /etc/salt/minion
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: DESKTOP-4F2NMQ9.
[DEBUG ] Using importlib_metadata to load entry points
[ERROR ] 'EntryPoints' object has no attribute 'items'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/utils/parsers.py", line 210, in parse_args
mixin_after_parsed_func(self)
File "/usr/lib/python3/dist-packages/salt/utils/parsers.py", line 887, in __setup_extended_logging
log.setup_extended_logging(self.config)
File "/usr/lib/python3/dist-packages/salt/log/setup.py", line 414, in setup_extended_logging
providers = salt.loader.log_handlers(opts)
File "/usr/lib/python3/dist-packages/salt/loader/init.py", line 686, in log_handlers
_module_dirs(
File "/usr/lib/python3/dist-packages/salt/loader/init.py", line 148, in _module_dirs
for entry_point in entrypoints.iter_entry_points("salt.loader"):
File "/usr/lib/python3/dist-packages/salt/utils/entrypoints.py", line 43, in _wrapped
return f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/utils/entrypoints.py", line 62, in iter_entry_points
for entry_point_group, entry_points_list in entry_points.items():
AttributeError: 'EntryPoints' object has no attribute 'items'
Usage: salt-call [options] [arguments]

salt-call: error: Error while processing <function LogLevelMixIn.__setup_extended_logging at 0x7feb1620b670>: Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/utils/parsers.py", line 210, in parse_args
mixin_after_parsed_func(self)
File "/usr/lib/python3/dist-packages/salt/utils/parsers.py", line 887, in __setup_extended_logging
log.setup_extended_logging(self.config)
File "/usr/lib/python3/dist-packages/salt/log/setup.py", line 414, in setup_extended_logging
providers = salt.loader.log_handlers(opts)
File "/usr/lib/python3/dist-packages/salt/loader/init.py", line 686, in log_handlers
_module_dirs(
File "/usr/lib/python3/dist-packages/salt/loader/init.py", line 148, in _module_dirs
for entry_point in entrypoints.iter_entry_points("salt.loader"):
File "/usr/lib/python3/dist-packages/salt/utils/entrypoints.py", line 43, in _wrapped
return f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/salt/utils/entrypoints.py", line 62, in iter_entry_points
for entry_point_group, entry_points_list in entry_points.items():
AttributeError: 'EntryPoints' object has no attribute 'items'

@digitalsleuth
Copy link

Hi @tuttimann , this issue is due to a SaltStack compatibility problem with the current version of importlib-metadata. To fix this, you can run the following:
sudo python3 -m pip install "importlib-metadata<5.0.0"

Once that's done, try your install again and let us know how it goes.
Cheers!

@tuttimann
Copy link
Author

tuttimann commented Aug 17, 2023

I tried the command and it gave the following output:

Requirement already satisfied: importlib-metadata<5.0.0 in /usr/local/lib/python3.8/dist-packages (4.13.0)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.8/dist-packages (from importlib-metadata<5.0.0) (3.15.0)
WARNING: Error parsing requirements for requests: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/requests-2.30.0.dist-info/METADATA'
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Afterwards the upgrade still fails.

@digitalsleuth
Copy link

Does the upgrade fail with the same error? If so, can you try running sudo python3 -m pip install --upgrade pip then sudo python3 -m pip install "importlib-metadata<5.0.0" again?

If it failed with a different error, can you provide your saltstack.log file?

Cheers

@tuttimann
Copy link
Author

tuttimann commented Aug 17, 2023

I tried the 2 commands, for both I get following warning:

WARNING: Error parsing requirements for requests: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/requests-2.30.0.dist-info/METADATA'
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

After that upgrade still fails and saltstack.log file has following input:

/usr/bin/salt-call:6: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import load_entry_point
[DEBUG   ] Missing configuration file: /etc/salt/minion
[DEBUG   ] Using cached minion ID from /etc/salt/minion_id: DESKTOP-4F2NMQ9.
[DEBUG   ] Using importlib_metadata to load entry points
[ERROR   ] 'EntryPoints' object has no attribute 'items'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/salt/utils/parsers.py", line 210, in parse_args
    mixin_after_parsed_func(self)
  File "/usr/lib/python3/dist-packages/salt/utils/parsers.py", line 887, in __setup_extended_logging
    log.setup_extended_logging(self.config)
  File "/usr/lib/python3/dist-packages/salt/log/setup.py", line 414, in setup_extended_logging
    providers = salt.loader.log_handlers(opts)
  File "/usr/lib/python3/dist-packages/salt/loader/__init__.py", line 686, in log_handlers
    _module_dirs(
  File "/usr/lib/python3/dist-packages/salt/loader/__init__.py", line 148, in _module_dirs
    for entry_point in entrypoints.iter_entry_points("salt.loader"):
  File "/usr/lib/python3/dist-packages/salt/utils/entrypoints.py", line 43, in _wrapped
    return f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/salt/utils/entrypoints.py", line 62, in iter_entry_points
    for entry_point_group, entry_points_list in entry_points.items():
AttributeError: 'EntryPoints' object has no attribute 'items'
Usage: salt-call [options] <function> [arguments]

salt-call: error: Error while processing <function LogLevelMixIn.__setup_extended_logging at 0x7fafb5174670>: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/salt/utils/parsers.py", line 210, in parse_args
    mixin_after_parsed_func(self)
  File "/usr/lib/python3/dist-packages/salt/utils/parsers.py", line 887, in __setup_extended_logging
    log.setup_extended_logging(self.config)
  File "/usr/lib/python3/dist-packages/salt/log/setup.py", line 414, in setup_extended_logging
    providers = salt.loader.log_handlers(opts)
  File "/usr/lib/python3/dist-packages/salt/loader/__init__.py", line 686, in log_handlers
    _module_dirs(
  File "/usr/lib/python3/dist-packages/salt/loader/__init__.py", line 148, in _module_dirs
    for entry_point in entrypoints.iter_entry_points("salt.loader"):
  File "/usr/lib/python3/dist-packages/salt/utils/entrypoints.py", line 43, in _wrapped
    return f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/salt/utils/entrypoints.py", line 62, in iter_entry_points
    for entry_point_group, entry_points_list in entry_points.items():
AttributeError: 'EntryPoints' object has no attribute 'items'

@tuttimann
Copy link
Author

Anything I can do to help investigating this?

@digitalsleuth
Copy link

HI @tuttimann , can you run the following from within your WSL installation and provide the output:
sudo python3 -m pip -V

@tuttimann
Copy link
Author

tuttimann commented Aug 25, 2023

Sure, this is the output: pip 23.2.1 from /usr/local/lib/python3.8/dist-packages/pip (python 3.8)

@digitalsleuth
Copy link

Hi @tuttimann , I think I may have been able to duplicate the error you've been getting. Can you provide me the output of the following command:
sudo python3 -m pip list

@digitalsleuth
Copy link

@tuttimann , I believe that with the new REMnux CLI and the soon to be submitted PR for fixing pip, setuptools, and wheel, you should have no issues installing REMnux in WSL. The PR will be coming this afternoon, so once it's released, you should be able to try again.

@digitalsleuth
Copy link

@tuttimann We've figured out the core issue with this installation, caused originally by a pip, setuptools, and wheel issue. You can fix this by running the following in your WSL, then re-running the installation:

sudo python3 -m pip install --force-reinstall --break-system-packages "requests==2.30.0"

Your current requests package is broken, which is preventing other python packages to be installed properly. This will re-install it properly, allowing the other python packages to be installed. Please let me know when you have the chance to try this out and let me know how it goes.

Cheers!

@Pohambap
Copy link

after this command i get error: could not find a version that satidfies the requirement request==2.30.0 (from versions: none)
error: No Matching distribution found for request==2.30.0

@digitalsleuth
Copy link

Hi @Pohambap , if this error is in relation to #172 , then this command is not going to work for what you are attempting. However, if this is separate from #172 , then the command you're running should actually be sudo python3 -m pip install --force-reinstall --break-system-packages "requests==2.30.0", whereby you appear to be missing a letter s in your command you pasted.

@digitalsleuth
Copy link

@Pohambap Can you please confirm if the previous comment managed to resolve your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants