Closed byronjinmsft closed 1 month ago
Thank you for opening this issue, we will look into it.
This has been resolved. Seemed to have been a known issue.
How was this resolved. I am seeing same issue when using mcr.microsoft.com/azure-cli:2.65.0-cbl-mariner2.0 image. Could you please provide more details how I can resolve this issue? I am using SP userid/password to az login which has been working fine before.
Describe the bug
After creating an AKS cluster and trying to arc enable it with the command az connectedk8s connect, the command fails with minimal logs with the main error ModuleNotFoundError: No module named 'azure.cli.core.auth.msal_authentication'
This script has been working for us for many months and I have no idea where this error could have came from, or where this module is being looked for (is it kubernetes, python, az, or something else), or what the remediation steps would be.
Related command
az aks create az aks get-credentials az connectedk8s connect
Errors
ERROR: The command failed with an unexpected error. Here is the traceback: ERROR: No module named 'azure.cli.core.auth.msal_authentication'
Issue script & Debug output
These are all the logs from the command:
` 16:27:48 Enabling Arc for upgrade-20241008-5-release.
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 "/usr/lib64/az/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 564, in execute self.commands_loader.load_arguments(command) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/init.py", line 526, in load_arguments command_table[command].load_arguments() # this loads the arguments via reflection File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 321, in load_arguments super(AzCliCommand, self).load_arguments() File "/usr/lib64/az/lib/python3.9/site-packages/knack/commands.py", line 104, in load_arguments cmd_args = self.arguments_loader() File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 125, in arguments_loader op = self.get_op_handler(self.op_path) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 59, in get_op_handler handler = import_module(mod_to_import) File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 850, in exec_module
File "", line 228, in _call_with_frames_removed
File "/w/_temp/.azclitask/cliextensions/connectedk8s/azext_connectedk8s/custom.py", line 47, in
import azext_connectedk8s._clientproxyutils as clientproxyutils
File "/ w/_temp/.azclitask/cliextensions/connectedk8s/azext_connectedk8s/_clientproxyutils.py", line 21, in
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
`
Expected behavior
<This is from the same pipeline run but from 2 days ago>
05:40:03 Enabling Arc for upgrade-20241005-1-release.
WARNING: Preview version of extension is enabled by default for extension installation now. Will be disabled in future release. WARNING: Please run 'az config set extension.dynamic_install_allow_preview=true or false' to config it specifically. WARNING: The command requires the extension connectedk8s. It will be installed first. WARNING: This operation might take a while...
WARNING: Downloading kubectl client for first time. This can take few minutes... WARNING:
WARNING: Downloading helm client for first time. This can take few minutes... WARNING: Connecting an Azure Kubernetes Service (AKS) cluster to Azure Arc is only required for running Arc enabled services like App Services and Data Services on the cluster. Other features like Azure Monitor and Azure Defender are natively available on AKS. Learn more at https://go.microsoft.com/fwlink/?linkid=2144200. WARNING: Unable to fetch the Object ID of the Azure AD application used by Azure Arc service. Unable to enable the 'custom-locations' feature. Insufficient privileges to complete the operation. Step: 2024-10-05T05-40-24Z: Validating custom access token Step: 2024-10-05T05-40-24Z: Checking Provider Registrations Step: 2024-10-05T05-40-24Z: Setting KubeConfig Step: 2024-10-05T05-40-24Z: Escape Proxy Settings, if passed in Step: 2024-10-05T05-40-24Z: Checking Connectivity to Cluster Step: 2024-10-05T05-40-24Z: Do node validations Step: 2024-10-05T05-40-24Z: Install Kubectl client if it does not exist Step: 2024-10-05T05-40-28Z: Install Helm client if it does not exist Step: 2024-10-05T05-40-44Z: Starting Pre-onboarding-check Step: 2024-10-05T05-40-44Z: Creating folder for Cluster Diagnostic Checks Logs Step: 2024-10-05T05-40-44Z: Get namespace of release: cluster-diagnostic-checks Step: 2024-10-05T05-40-45Z: Determine Helmchart Export Path Step: 2024-10-05T05-40-45Z: Pulling HelmChart: mcr.microsoft.com/azurearck8s/helmchart/stable/clusterdiagnosticchecks, Version: 0.2.2 Step: 2024-10-05T05-40-45Z: Chart path for Cluster Diagnostic Checks Job: /root/.azure/PreOnboardingChecksCharts/clusterdiagnosticchecks Step: 2024-10-05T05-40-45Z: Creating Cluster Diagnostic Checks job Step: 2024-10-05T05-40-57Z: The required pre-checks for onboarding have succeeded. Step: 2024-10-05T05-40-57Z: Checking if user can create ClusterRoleBindings Step: 2024-10-05T05-40-57Z: Determining Cluster Distribution and Infrastructure
Environment Summary
AzureCLI@2 in Azuredevops onebranch pipelines, using image mcr.microsoft.com/onebranch/cbl-mariner/build:2.0
Additional context
No response