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

az connectedk8s proxy: ModuleNotFoundError: No module named 'azure.cli.core.auth.msal_authentication' on 2.65.0 #8109

Closed
phillipleblanc opened this issue Oct 8, 2024 · 11 comments
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. Connected Kubernetes 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 Service Attention This issue is responsible by Azure service team.

Comments

@phillipleblanc
Copy link

Describe the bug

I have a GitHub workflow that runs az connectedk8s proxy as part of our Kubernetes deployment. The exact same workflow that was working ~14 hours ago that used az cli version 2.64.0 is now failing on version 2.65.0 with the error ModuleNotFoundError: No module named 'azure.cli.core.auth.msal_authentication'

Related command

az connectedk8s proxy -n ${{ inputs.arc_cluster }} -g ${{ inputs.arc_rg }} --kube-context ${{ inputs.arc_cluster }}

Errors

ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: No module named 'azure.cli.core.auth.msal_authentication'
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 "/opt/az/azcliextensions/connectedk8s/azext_connectedk8s/custom.py", line 47, in <module>
    import azext_connectedk8s._clientproxyutils as clientproxyutils
  File "/opt/az/azcliextensions/connectedk8s/azext_connectedk8s/_clientproxyutils.py", line 21, in <module>
    from azure.cli.core.auth.msal_authentication import ServicePrincipalCredential
ModuleNotFoundError: No module named 'azure.cli.core.auth.msal_authentication'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

.

Expected behavior

The command works as expected and sets up a proxy

Environment Summary

azure-cli 2.65.0
core 2.65.0
telemetry 1.1.0
Extensions:
azure-devops 1.0.1
connectedk8s 1.9.2
Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1
Python location '/opt/az/bin/python3'
Extensions directory '/opt/az/azcliextensions'
Python (Linux) 3.11.8 (main, Sep 25 2024, 11:33:44) [GCC 11.4.0]
Legal docs and information: aka.ms/AzureCliLegal

Additional context

No response

@phillipleblanc phillipleblanc added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 8, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 8, 2024

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

@microsoft-github-policy-service microsoft-github-policy-service bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot Connected Kubernetes Service Attention This issue is responsible by Azure service team. labels Oct 8, 2024
@jomacedo
Copy link

jomacedo commented Oct 8, 2024

Also facing this issue, but with "az connectedk8s connect". Running just installed az cli (2.65.0).

@ilsl
Copy link

ilsl commented Oct 8, 2024

Same also getting this issue

@AndresPad
Copy link

Same issue. Was working with 2.64.0 and now breaking with 2.65.0

@rploeg
Copy link

rploeg commented Oct 8, 2024

Same issue here with deploying AIO with Codespaces

@chaosdinosaur
Copy link

Also getting this issue deploying in vscode

@wuqiten
Copy link

wuqiten commented Oct 8, 2024

Same issue here with command az connectedk8s connect in AIO deployment with az version 2.65.0

@bavneetsingh16
Copy link
Contributor

bavneetsingh16 commented Oct 8, 2024

Please upgrade the connectedk8s extension cli to the most recent version(v1.9.3) which contains the fix for this issue.

Cmd to upgrade: az extension update --name connectedk8s

@wuqiten
Copy link

wuqiten commented Oct 8, 2024

my connectedk8s version is 1.10.0, but still got that issue, is it only working on v1.9.3

Please upgrade the connectedk8s extension cli to the most recent version(v1.9.3) which contains the fix for this issue.

Cmd to upgrade: az extension update --name connectedk8s

@bavneetsingh16
Copy link
Contributor

@wuqiten, the fix was applied only to the publicly available CLI version. The latest publicly available connectedk8s CLI version is v1.9.3.

I have now patched version v1.10.0 by merging the fix from the upstream branch. Could you please download the new whl file for v1.10.0 and try again?

@wuqiten
Copy link

wuqiten commented Oct 9, 2024

Issue fixed thanks!

@wuqiten, the fix was applied only to the publicly available CLI version. The latest publicly available connectedk8s CLI version is v1.9.3.

I have now patched version v1.10.0 by merging the fix from the upstream branch. Could you please download the new whl file for v1.10.0 and try again?

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 bug This issue requires a change to an existing behavior in the product in order to be resolved. Connected Kubernetes 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 Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

9 participants