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

ModuleNotFoundError: No module named 'urllib3.util.ssl_match_hostname' #27661

Closed
martijnvanschie opened this issue Oct 23, 2023 · 3 comments
Closed
Assignees
Labels
Azure CLI Team The command of the issue is owned by Azure CLI team Core CLI core infrastructure customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone

Comments

@martijnvanschie
Copy link

Describe the bug

When running any az command i get the following error message.

ModuleNotFoundError: No module named 'urllib3.util.ssl_match_hostname'

Related command

az --version

Errors

ModuleNotFoundError: No module named 'urllib3.util.ssl_match_hostname'

Issue script & Debug output

PS C:\Apps> az --version --debug
No module named 'urllib3.util.ssl_match_hostname'
cli.knack.cli: Command arguments: ['--version', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x042AB538>]
cli.main: Command ran in 0.337 seconds (init: 0.322, invoke: 0.014)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3213 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry_init_.pyc C:\Users\MartijnS.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.
Traceback (most recent call last):
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 225, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/init.py", line 121, in show_version
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/util.py", line 372, in get_az_version_string
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/util.py", line 316, in _update_latest_from_github
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/util.py", line 854, in check_connectivity
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/init.py", line 43, in File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/init.py", line 13, in
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connectionpool.py", line 12, in
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connection.py", line 63, in
ModuleNotFoundError: No module named 'urllib3.util.ssl_match_hostname'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "runpy.py", line 196, in _run_module_as_main
File "runpy.py", line 86, in _run_code
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/main.py", line 50, in
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/main.py", line 36, in cli_main
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 245, in invoke
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/init.py", line 127, in exception_handler
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/util.py", line 59, in handle_exception
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrestazure/init.py", line 28, in
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrestazure/azure_configuration.py", line 34, in
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/init.py", line 28, in
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/configuration.py", line 37, in
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/pipeline/init.py", line 52, in
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\requests/init.py", line 43, in File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/init.py", line 13, in
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connectionpool.py", line 12, in
File "D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\urllib3/connection.py", line 63, in
ModuleNotFoundError: No module named 'urllib3.util.ssl_match_hostname'

Expected behavior

It should print out the version information without an error.

Environment Summary

az --version also gives the error but u did uninstall and reinstall the latest version

azure-cli-2.53.0-x64.msi

Additional context

No response

@martijnvanschie martijnvanschie added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 23, 2023
@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 Oct 23, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 23, 2023

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

@yonzhan yonzhan added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Core CLI core infrastructure Azure CLI Team The command of the issue is owned by Azure CLI team and removed bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Oct 23, 2023
@yonzhan yonzhan added this to the Backlog milestone Oct 23, 2023
@bebound
Copy link
Contributor

bebound commented Oct 24, 2023

I can't repro, looks like an installation problem.
The error stack is in the urllib3 packages, and it should not raise No module named 'urllib3.util.ssl_match_hostname.

Please uninstall CLI and delete the C:\Program Files\Microsoft SDKs\Azure\CLI2 folder then install again.

@martijnvanschie
Copy link
Author

Haven't seen this issue anymore. Not sure how it got solved.

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 Core CLI core infrastructure customer-reported Issues that are reported by GitHub users external to the Azure organization. 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