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

Python get_path error after updating to 2.60.0 #28878

Closed
davidbgonz opened this issue May 2, 2024 · 6 comments
Closed

Python get_path error after updating to 2.60.0 #28878

davidbgonz opened this issue May 2, 2024 · 6 comments
Assignees
Labels
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. Packaging question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@davidbgonz
Copy link

Describe the bug

Any az commands result in a python error.

Related command

Any az command including just running az and az --help

Errors

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/opt/azure-cli/lib/python3.12/site-packages/azure/cli/__main__.py", line 39, in <module>
    az_cli = get_default_cli()
             ^^^^^^^^^^^^^^^^^
  File "/opt/azure-cli/lib/python3.12/site-packages/azure/cli/core/__init__.py", line 917, in get_default_cli
    from azure.cli.core.azlogging import AzCliLogging
  File "/opt/azure-cli/lib/python3.12/site-packages/azure/cli/core/azlogging.py", line 30, in <module>
    from azure.cli.core.commands.events import EVENT_INVOKER_PRE_CMD_TBL_TRUNCATE
  File "/opt/azure-cli/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 25, in <module>
    from azure.cli.core.extension import get_extension
  File "/opt/azure-cli/lib/python3.12/site-packages/azure/cli/core/extension/__init__.py", line 25, in <module>
    EXTENSIONS_SYS_DIR = os.path.expanduser(_CUSTOM_EXT_SYS_DIR) if _CUSTOM_EXT_SYS_DIR else os.path.join(get_path("purepath"), 'azure-cli-extensions')
                                                                                                          ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/sysconfig.py", line 636, in get_path
    return get_paths(scheme, vars, expand)[name]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
KeyError: 'purepath'

Issue script & Debug output

Any command with the --debug flag still results in the above error.

Expected behavior

Since any command errors out, expected behavior is to at least make it passed that python error.

Environment Summary

Running az --version still results in the same error. I can use 2.59.0 and update the azure-cli and core versions manually below:

azure-cli                         2.60.0

core                              2.60.0
telemetry                          1.1.0

Extensions:
azure-devops                      0.26.0
ssh                                1.1.6

Dependencies:
msal                              1.28.0
azure-mgmt-resource             23.1.0b2

Python location '/opt/azure-cli/bin/python'
Extensions directory '/home/<user>/.azure/cliextensions'

Python (Linux) 3.12.3 (main, Apr 23 2024, 09:16:07) [GCC 13.2.1 20240417]

Additional context

Pathlib was updated recently and have been experiencing other tools such as neovim extensions needing updates to reflect the new changes. This cloud be related to that, although 2.59.0 is still functional when I rollback to that version.

@davidbgonz davidbgonz added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label May 2, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label May 2, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented May 2, 2024

Thank you for opening this issue, we will look into it.

@yonzhan yonzhan added Packaging 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 and removed bug This issue requires a change to an existing behavior in the product in order to be resolved. labels May 3, 2024
@yonzhan yonzhan added this to the Backlog milestone May 3, 2024
@bebound
Copy link
Contributor

bebound commented May 6, 2024

Which OS are you using?
The path indicates that it's not an official CLI package.

@superkartoffel
Copy link

I can confirm this issue on arch linux with azure-cli package from the official extra repo and version azure-cli-2.60.0-1.
Meanwhile it has been fixed in azure-cli-2.60.0-3. Not sure what has changed, but the commit message mentions that the build process was broken. https://gitlab.archlinux.org/archlinux/packaging/packages/azure-cli/-/commit/451bdff2373a99d6c77336b642a7fb01eba6f2a8

@davidbgonz if you are on arch too, try to update the azure-cli package again.

@bebound
Copy link
Contributor

bebound commented May 6, 2024

Arch's extra/azure-cli 2.60.0-1 package is broken and fixed in newer version. Mentioned in #28796 (comment)

@davidbgonz
Copy link
Author

I'm on arch. Yep, can confirm that the issue with that 2.60.0-1 build is now fixed in 2.60.0-3. Should this issue stay open until that PR is complete?

@bebound
Copy link
Contributor

bebound commented May 7, 2024

Close as Arch package is fixed.
The root issue is Python 3.12 support, which is tracked in #27673

@bebound bebound closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. Packaging question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

4 participants