azure-cli
azure-cli copied to clipboard
Installing latest aks-preview on az CLI 2.54.0 results in ERROR: module 'azure.core.pipeline.policies' has no attribute 'SensitiveHeaderCleanupPolicy'
Describe the bug
After installing latest aks-preview extension on v2.54, I'm observing an error when executing az aks get-credentials
2024-03-28 02:59:21.112049: ERROR: The command failed with an unexpected error. Here is the traceback: ERROR: module 'azure.core.pipeline.policies' has no attribute 'SensitiveHeaderCleanupPolicy' 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 663, in execute raise ex File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, **kwargs) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 112, in handler client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None File "/root/.azure/cliextensions/aks-preview/azext_aks_preview/_client_factory.py", line 31, in cf_managed_clusters return get_container_service_client(cli_ctx).managed_clusters File "/root/.azure/cliextensions/aks-preview/azext_aks_preview/_client_factory.py", line 23, in get_container_service_client return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW, subscription_id=subscription_id) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/client_factory.py", line 83, in get_mgmt_service_client client, _ = _get_mgmt_service_client(cli_ctx, client_type, subscription_id=subscription_id, File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/client_factory.py", line 251, in _get_mgmt_service_client client = client_type(credential, subscription_id, **client_kwargs) File "/root/.azure/cliextensions/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/_container_service_client.py", line 98, in init policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, AttributeError: module 'azure.core.pipeline.policies' has no attribute 'SensitiveHeaderCleanupPolicy' To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
Related command
az aks get-credentials
Errors
2024-03-28 02:59:21.112049: ERROR: The command failed with an unexpected error. Here is the traceback: ERROR: module 'azure.core.pipeline.policies' has no attribute 'SensitiveHeaderCleanupPolicy' 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 663, in execute raise ex File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job result = cmd_copy(params) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 333, in call return self.handler(*args, **kwargs) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 112, in handler client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None File "/root/.azure/cliextensions/aks-preview/azext_aks_preview/_client_factory.py", line 31, in cf_managed_clusters return get_container_service_client(cli_ctx).managed_clusters File "/root/.azure/cliextensions/aks-preview/azext_aks_preview/_client_factory.py", line 23, in get_container_service_client return get_mgmt_service_client(cli_ctx, CUSTOM_MGMT_AKS_PREVIEW, subscription_id=subscription_id) File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/client_factory.py", line 83, in get_mgmt_service_client client, _ = _get_mgmt_service_client(cli_ctx, client_type, subscription_id=subscription_id, File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/client_factory.py", line 251, in _get_mgmt_service_client client = client_type(credential, subscription_id, **client_kwargs) File "/root/.azure/cliextensions/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/_container_service_client.py", line 98, in init policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, AttributeError: module 'azure.core.pipeline.policies' has no attribute 'SensitiveHeaderCleanupPolicy' To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
Issue script & Debug output
n/a
Expected behavior
No error.
Environment Summary
az CLI v 2.54.
Additional context
No response
Thank you for opening this issue, we will look into it.
Got the same issue.
{ "azure-cli": "2.55.0", "azure-cli-core": "2.55.0", "azure-cli-telemetry": "1.1.0", "extensions": { "aks-preview": "2.0.0b7", "subscription": "0.1.5" } }
az cli version 2.50.0 runs into this issue suddenly from 4 days ago. it was running fine.
Got the same issue.
az version
{
"azure-cli": "2.53.0",
"azure-cli-core": "2.53.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"aks-preview": "2.0.0b7"
}
}
The error gone after upgrading the azure-core.
pip install --upgrade azure-core
Got the same issue.
az version { "azure-cli": "2.53.0", "azure-cli-core": "2.53.0", "azure-cli-telemetry": "1.1.0", "extensions": { "aks-preview": "2.0.0b7" } }
The error gone after upgrading the azure-core.
pip install --upgrade azure-core
This command does work.
My version:
az version
{
"azure-cli": "2.57.0",
"azure-cli-core": "2.57.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"acrtransfer": "1.1.0",
"aks-preview": "2.0.0b7",
"alb": "1.0.0",
"attestation": "1.0.0",
"azure-firewall": "1.0.1",
"confcom": "0.3.3",
"k8s-configuration": "1.7.0",
"k8s-extension": "1.6.0"
}
}
It does not look like az version
will give you anything useful, because this version does not change after executing pip install --upgrade azure-core
the command.
Installing collected packages: azure-core
Attempting uninstall: azure-core
Found existing installation: azure-core 1.26.0
Uninstalling azure-core-1.26.0:
Successfully uninstalled azure-core-1.26.0
Successfully installed azure-core-1.30.1
/# az version
{
"azure-cli": "2.57.0",
"azure-cli-core": "2.57.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"acrtransfer": "1.1.0",
"aks-preview": "2.0.0b7",
"alb": "1.0.0",
"attestation": "1.0.0",
"azure-firewall": "1.0.1",
"confcom": "0.3.3",
"k8s-configuration": "1.7.0",
"k8s-extension": "1.6.0"
}
}
This failed for me using Azure CLI 2.50.0 with the same error. With Azure CLI 2.59.0 it worked.
{
"azure-cli": "2.59.0",
"azure-cli-core": "2.59.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"aks-preview": "2.0.0b8"
}
}
2.59.0 also works for me, thanks.
Thank you for opening this issue, we will look into it.
Can we get some official response from Microsoft/Azure? Is everyone expected to upgrade to Azure CLI 2.59.0?
Hi, I have the same error since upgrading to version 2.61.0 (azure-cli and core):
azure-cli 2.61.0
core 2.61.0
telemetry 1.1.0
Extensions:
account 0.2.5
containerapp 0.3.52
Dependencies:
msal 1.28.0
azure-mgmt-resource 23.1.1
Any ideas ?
The following solution helped in my case: https://github.com/Azure/azure-sdk-for-python/issues/34091#issuecomment-2138417331