question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az start and stop failing after apt update / upgrade: ModuleNotFoundError: No module named 'azure.mgmt.compute.v2022_03_01'

See original GitHub issue

Describe the bug

Command Name az vm start

Errors:

The command failed with an unexpected error. Here is the traceback:
No module named 'azure.mgmt.compute.v2022_03_01'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/knack/cli.py", line 231, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/lib/python3/dist-packages/azure/cli/core/commands/__init__.py", line 561, in execute
    self.commands_loader.load_arguments(command)
  File "/usr/lib/python3/dist-packages/azure/cli/core/__init__.py", line 515, in load_arguments
    self.command_table[command].load_arguments()  # this loads the arguments via reflection
  File "/usr/lib/python3/dist-packages/azure/cli/core/commands/__init__.py", line 318, in load_arguments
    super(AzCliCommand, self).load_arguments()
  File "/usr/lib/python3/dist-packages/knack/commands.py", line 104, in load_arguments
    cmd_args = self.arguments_loader()
  File "/usr/lib/python3/dist-packages/azure/cli/core/commands/command_operation.py", line 125, in arguments_loader
    op = self.get_op_handler(self.op_path)
  File "/usr/lib/python3/dist-packages/azure/cli/core/commands/command_operation.py", line 59, in get_op_handler
    handler = import_module(mod_to_import)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'azure.mgmt.compute.v2022_03_01'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az vm start --ids

Expected Behavior

VMs succesfully started and stopped

Environment Summary

Linux-5.10.0-kali9-amd64-x86_64-with-glibc2.33, Kali GNU/Linux Rolling
Python 3.10.4
Installer: DEB

azure-cli 2.37.0

Extensions:
azure-devops 0.24.0

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.0.0

Additional Context

Azure CLI fails at starting and stopping VMs after the last update

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:19 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
arty-hlrcommented, Jun 10, 2022

@jiasli Thank you, that makes sense. I’ll try uninstalling and reinstalling the manual way making sure it’s the official packages.

1reaction
jiaslicommented, Jun 9, 2022

Judging from the dist-packages in file path, this is not the official Azure CLI, please see https://github.com/Azure/azure-cli/issues/19640

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'azure.mgmt ...
8.10 my playbook.yml fails with this error. ModuleNotFoundError: No module named 'azure.mgmt.monitor.version' fatal: [localhost]: FAILED ...
Read more >
ModuleNotFoundError: No module named 'azure-mgmt'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'azure-mgmt' How to remove the ModuleN.
Read more >
Unable to run `apt update` on Ubuntu 21.10 - Server Fault
Only after getting this right was I able to do sudo apt update , sudo apt ... febrin@febrin:~$ lsb_release -a No LSB modules...
Read more >
Problem with update-manager: No module named 'apt_pkg' in ...
Reinstall apt_pkg using: sudo apt-get install --reinstall python3-apt. The error is primarily because of library apt_pkg.cpython-35m-x86_64-linux-gnu.so not ...
Read more >
apt update fails due to script hooks on Ubuntu Mate
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found