Open Geertvdc opened 1 month ago
Thank you for opening this issue, we will look into it.
Same error under WSL2 (Ubuntu):
$ az upgrade
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
You already have the latest azure-cli version: 2.64.0
Upgrading extensions
Default enabled including preview versions for extension installation now. Disabled in future release. Use '--allow-preview-extensions true' to enable it specifically if needed. Use '--allow-preview-extensions false' to install stable version only.
Checking update for ssh
Latest version of 'ssh' is already installed.
Use --debug for more information
Upgrade finished.You can enable auto-upgrade with 'az config set auto-upgrade.enable=yes'. More details in https://docs.microsoft.com/cli/azure/update-azure-cli#automatic-update
$ az version
{
"azure-cli": "2.64.0",
"azure-cli-core": "2.64.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"ssh": "2.0.5"
}
}
$ az ssh config --file ./sshconfig-az-main-WSL --resource-group (sanitized) --name (sanitized)
The command failed with an unexpected error. Here is the traceback:
No module named 'rpds.rpds'
Traceback (most recent call last):
File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 564, in execute
self.commands_loader.load_arguments(command)
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/__init__.py", line 526, in load_arguments
self.command_table[command].load_arguments() # this loads the arguments via reflection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 321, in load_arguments
super(AzCliCommand, self).load_arguments()
File "/opt/az/lib/python3.11/site-packages/knack/commands.py", line 104, in load_arguments
cmd_args = self.arguments_loader()
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 125, in arguments_loader
op = self.get_op_handler(self.op_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 59, in get_op_handler
handler = import_module(mod_to_import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/(sanitized)/.azure/cliextensions/ssh/azext_ssh/custom.py", line 20, in <module>
from . import rdp_utils
File "/home/(sanitized)/.azure/cliextensions/ssh/azext_ssh/rdp_utils.py", line 19, in <module>
from . import ssh_utils
File "/home/(sanitized)/.azure/cliextensions/ssh/azext_ssh/ssh_utils.py", line 20, in <module>
from . import connectivity_utils
File "/home/(sanitized)/.azure/cliextensions/ssh/azext_ssh/connectivity_utils.py", line 10, in <module>
import oras.client
File "/home/(sanitized)/.azure/cliextensions/ssh/oras/client.py", line 12, in <module>
import oras.provider
File "/home/(sanitized)/.azure/cliextensions/ssh/oras/provider.py", line 14, in <module>
import jsonschema
File "/home/(sanitized)/.azure/cliextensions/ssh/jsonschema/__init__.py", line 13, in <module>
from jsonschema._format import FormatChecker
File "/home/(sanitized)/.azure/cliextensions/ssh/jsonschema/_format.py", line 11, in <module>
from jsonschema.exceptions import FormatError
File "/home/(sanitized)/.azure/cliextensions/ssh/jsonschema/exceptions.py", line 15, in <module>
from referencing.exceptions import Unresolvable as _Unresolvable
File "/home/(sanitized)/.azure/cliextensions/ssh/referencing/__init__.py", line 5, in <module>
from referencing._core import Anchor, Registry, Resource, Specification
File "/home/(sanitized)/.azure/cliextensions/ssh/referencing/_core.py", line 9, in <module>
from rpds import HashTrieMap, HashTrieSet, List
File "/home/(sanitized)/.azure/cliextensions/ssh/rpds/__init__.py", line 1, in <module>
from .rpds import *
ModuleNotFoundError: No module named 'rpds.rpds'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
I made it work by purging everything and reinstalling everything from scratch; I'm not sure I needed to be this radical; if I had to do it again I would try things in order from the less dramatic to the more radical:
az extension remove -n ssh
az ssh ... # The original command
sudo apt remove azure-cli -y
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az ssh ... # The original command
sudo apt remove azure-cli -y
rm -rf ~/.azure
sudo rm -rf /opt/az /usr/bin/az
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az login
az ssh ... # The original command
I did had the same issue, only reinstalling the ssh extension made it work again.
I have the same error on macos, I have those message run in debug mode when installing ssh extension:
cli.azure.cli.core.extension.operations: Linux distro check: Reading from: /etc/apt/sources.list.d/azure-cli.list cli.azure.cli.core.extension.operations: Linux distro check: An error occurred while checking linux distribution version source list consistency. cli.azure.cli.core.extension.operations: [Errno 2] No such file or directory: '/etc/apt/sources.list.d/azure-cli.list' cli.azure.cli.core.extension.operations: Executing pip with args: ['install', '--target', '/Users/jarekolechno/.azure/cliextensions/ssh', '/var/folders/yw/8cp8fq_d4mv1lmfr7lh_p68w0000gn/T/tmpy5eyvnxy/ssh-2.0.5-py3-none-any.whl'] cli.azure.cli.core.extension.operations: Running: ['/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/bin/python', '-m', 'pip', 'install', '--target', '/Users/jarekolechno/.azure/cliextensions/ssh', '/var/folders/yw/8cp8fq_d4mv1lmfr7lh_p68w0000gn/T/tmpy5eyvnxy/ssh-2.0.5-py3-none-any.whl', '-vv', '--disable-pip-version-check', '--no-cache-dir'] cli.azure.cli.core.extension.operations: /opt/homebrew/Cellar/azure-cli/2.65.0/libexec/bin/python: No module named pip
cli.azure.cli.core.extension.operations: Command '['/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/bin/python', '-m', 'pip', 'install', '--target', '/Users/jarekolechno/.azure/cliextensions/ssh', '/var/folders/yw/8cp8fq_d4mv1lmfr7lh_p68w0000gn/T/tmpy5eyvnxy/ssh-2.0.5-py3-none-any.whl', '-vv', '--disable-pip-version-check', '--no-cache-dir']' returned non-zero exit status 1. cli.azure.cli.core.extension.operations: Pip failed so deleting anything we might have installed at
I would be great to get this resolved.
uninstall and reinstall worked for me. (Mac Sonama) likely conflict with python 13 or something.
thanks @sadhasivam . I had to uninstall all python versions I had and install azure-cli.
Reinstalling the extension via az extension remove -n ssh && az extension add -n ssh
fixed it for me.
Azure CLI Version: 2.65.0
Describe the bug
When trying to connect a ssh session to a Azure VM az cli it just crashes with an error
ModuleNotFoundError: No module named 'rpds.rpds'
Related command
az ssh vm
az ssh config
the arguments passed into this after do not matter. ANYTHING results in below error
Errors
Issue script & Debug output
Expected behavior
az ssh config downloads a config file or az ssh vm connects to the vm
Environment Summary
Additional context
this used to work fine with older version (i think around 2.58/2.59) but downgrading to these versions is now also broken...