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

downgrade azure-cli version failed #24719

Open
MayXuQQ opened this issue Nov 23, 2022 · 9 comments
Open

downgrade azure-cli version failed #24719

MayXuQQ opened this issue Nov 23, 2022 · 9 comments
Assignees
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request Installation
Milestone

Comments

@MayXuQQ
Copy link

MayXuQQ commented Nov 23, 2022

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command

dnf list --showduplicates azure-cli
az version
Describe the bug

after degraded , check with az version still is 2.42.0

To Reproduce

  1. dnf list --showduplicates azure-cli
    MongoDB Repository 1.3 kB/s | 391 B 00:00
    Errors during downloading metadata for repository 'mongodb-org-4.4':
  • Status code: 404 for https://repo.mongodb.org/yum/redhat/35/mongodb-org/4.4/x86_64/repodata/repomd.xml (IP: 18.160.18.87)
    Error: Failed to download metadata for repo 'mongodb-org-4.4': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
    MongoDB Repository 1.3 kB/s | 391 B 00:00
    Errors during downloading metadata for repository 'mongodb-org-6.0':
  • Status code: 404 for https://repo.mongodb.org/yum/redhat/35/mongodb-org/6.0/x86_64/repodata/repomd.xml (IP: 18.160.18.28)
    Error: Failed to download metadata for repo 'mongodb-org-6.0': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
    Ignoring repositories: mongodb-org-4.4, mongodb-org-6.0
    Last metadata expiration check: 0:27:09 ago on Wed 23 Nov 2022 07:55:16 AM UTC.
    Installed Packages
    azure-cli.x86_64 2.34.0-1.el7 @azure-cli
    Available Packages
    ......
  1. $ sudo dnf install azure-cli-2.34.0-1.el7
    MongoDB Repository 1.1 kB/s | 391 B 00:00
    Errors during downloading metadata for repository 'mongodb-org-4.4':
  • Status code: 404 for https://repo.mongodb.org/yum/redhat/35/mongodb-org/4.4/x86_64/repodata/repomd.xml (IP: 18.160.18.87)
    Error: Failed to download metadata for repo 'mongodb-org-4.4': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
    MongoDB Repository 1.3 kB/s | 391 B 00:00
    Errors during downloading metadata for repository 'mongodb-org-6.0':
  • Status code: 404 for https://repo.mongodb.org/yum/redhat/35/mongodb-org/6.0/x86_64/repodata/repomd.xml (IP: 18.160.18.61)
    Error: Failed to download metadata for repo 'mongodb-org-6.0': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
    Ignoring repositories: mongodb-org-4.4, mongodb-org-6.0
    Last metadata expiration check: 0:38:09 ago on Wed 23 Nov 2022 07:57:27 AM UTC.
    Package azure-cli-2.34.0-1.el7.x86_64 is already installed.
    Dependencies resolved.
    Nothing to do.
  1. az version
    {
    "azure-cli": "2.42.0",
    "azure-cli-core": "2.42.0",
    "azure-cli-telemetry": "1.0.8",
    "extensions": {}
    }

Expected behavior

$ az version
{
"azure-cli": "2.34.1",
"azure-cli-core": "2.34.1",
"azure-cli-telemetry": "1.0.6",
"extensions": {}
}

Environment summary

$ uname -a
Linux preserve-maxu1 5.15.16-200.fc35.x86_64 #1 SMP Thu Jan 20 15:38:18 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Additional context

@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Installation labels Nov 23, 2022
@ghost ghost assigned jiasli Nov 23, 2022
@ghost ghost added this to the Backlog milestone Nov 23, 2022
@yonzhan yonzhan added Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 23, 2022
@yonzhan
Copy link
Collaborator

yonzhan commented Nov 23, 2022

@bebound for awareness

@bebound
Copy link
Contributor

bebound commented Nov 24, 2022

What's the output of which az? I guess you also install another azure-cli.

@MayXuQQ
Copy link
Author

MayXuQQ commented Nov 24, 2022

$ which az
~/.local/bin/az

@bebound
Copy link
Contributor

bebound commented Nov 24, 2022

This az bin is not generated by our package, you need to uninstall manually.

@MayXuQQ
Copy link
Author

MayXuQQ commented Nov 24, 2022 via email

@bebound
Copy link
Contributor

bebound commented Nov 24, 2022

I don't know how to uninstall it correctly, you know your computer better than I.
As a workaround, just delete ~/.local/bin/az.

@MayXuQQ
Copy link
Author

MayXuQQ commented Nov 25, 2022

  1. resolved the above issue after changed the mongodb-org-4.4.repo
    baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.4/x86_64/
    changed to
    baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/4.4/x86_64/
  2. mv az* in /home/fedora/.local/bin to a temp folder
    install https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=dnf#install-specific-version
    $ az version
    -bash: /home/fedora/.local/bin/az: No such file or directory
    restore the az* in /home/fedora/.local/bin
    $ az version
    Traceback (most recent call last):
    File "/usr/lib64/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
    File "/usr/lib64/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
    File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/main.py", line 14, in
    from azure.cli.core import telemetry
    File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/core/telemetry.py", line 19, in
    from azure.cli.telemetry import DEFAULT_INSTRUMENTATION_KEY
    File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/telemetry/init.py", line 9, in
    import portalocker
    ModuleNotFoundError: No module named 'portalocker'

@MayXuQQ
Copy link
Author

MayXuQQ commented Nov 25, 2022

How to cleanup the az on fedora ?
https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=dnf#uninstall
$ which az
~/.local/bin/az
$ az version
No module named 'packaging'
{
"azure-cli": "2.42.0",
"azure-cli-core": "2.42.0",
"azure-cli-telemetry": "1.0.8",
"extensions": {}
}
$ az
No module named 'packaging'
Error loading command module 'acs': No module named 'azure.core'
Error loading command module 'appservice': No module named 'msrestazure'
Error loading command module 'aro': No module named 'azure.core'
Error loading command module 'batch': No module named 'azure.batch'
Error loading command module 'iot': No module named 'msrestazure'
Error loading command module 'monitor': No module named 'azure.core'
Error loading command module 'netappfiles': No module named 'azure.core'
Error loading command module 'network': No module named 'msrestazure'
Error loading command module 'rdbms': No module named 'msal_extensions'
Error loading command module 'servicebus': No module named 'isodate'
Error loading command module 'serviceconnector': No module named 'msrestazure'
Error loading command module 'sql': No module named 'azure.core'
Error loading command module 'sqlvm': No module named 'azure.core'
Error loading command module 'vm': No module named 'azure.core'

 /\
/  \    _____   _ _  ___ _

/ /\ \ |_ / | | | '/
/ ____ \ / /| |
| | | | /
// _/|_,|_| _
|

Welcome to the cool new Azure CLI!

Use az --version to display the current version.
Here are the base commands:

Auto upgrade failed. name 'exit_code' is not defined
Traceback (most recent call last):
File "/home/fedora/.local/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 575, in execute
self.help.show_welcome(subparser)
File "/home/fedora/.local/lib/python3.10/site-packages/knack/help.py", line 722, in show_welcome
help_file = self.group_help_cls(self, '', parser)
File "/home/fedora/.local/lib/python3.10/site-packages/knack/help.py", line 253, in init
child.load(options)
File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/core/_help.py", line 296, in load
loader.versioned_load(self, options)
File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/core/_help_loaders.py", line 154, in versioned_load
super(CliHelpFile, help_obj).load(parser) # pylint:disable=bad-super-call
File "/home/fedora/.local/lib/python3.10/site-packages/knack/help.py", line 198, in load
description = getattr(options, 'description', None)
File "/home/fedora/.local/lib/python3.10/site-packages/knack/parser.py", line 241, in getattribute
self.description = self._description()
File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 133, in description_loader
op = self.get_op_handler(self.op_path)
File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 59, in get_op_handler
handler = import_module(mod_to_import)
File "/usr/lib64/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/command_modules/feedback/custom.py", line 14, in
from azure.cli.core.extension._resolve import resolve_project_url_from_index, NoExtensionCandidatesError
File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/core/extension/_resolve.py", line 5, in
from packaging.version import parse
ModuleNotFoundError: No module named 'packaging'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib64/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib64/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/main.py", line 49, in
exit_code = cli_main(az_cli, sys.argv[1:])
File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/main.py", line 36, in cli_main
return cli.invoke(args)
File "/home/fedora/.local/lib/python3.10/site-packages/knack/cli.py", line 245, in invoke
exit_code = self.exception_handler(ex)
File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/core/init.py", line 127, in exception_handler
return handle_exception(ex)
File "/home/fedora/.local/lib/python3.10/site-packages/azure/cli/core/util.py", line 58, in handle_exception
from jmespath.exceptions import JMESPathError
ModuleNotFoundError: No module named 'jmespath'

@MayXuQQ
Copy link
Author

MayXuQQ commented Nov 25, 2022

after reinstall with https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=dnf#install
For RHEL 9 or CentOS Stream 9, add packages-microsoft-com-prod repository
I can use the latest az cli
$ az version
{
"azure-cli": "2.42.0",
"azure-cli-core": "2.42.0",
"azure-cli-telemetry": "1.0.8",
"extensions": {}
}

@yonzhan yonzhan added feature-request and removed question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. feature-request Installation
Projects
None yet
Development

No branches or pull requests

4 participants