-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Describe the bug
Steps:
- az extension add --upgrade --name aks-preview -y
aks-preview-18.0.0b35 was installed successfully. - az aks create --os-sku AzureLinux -g <rg_name> -n <cluster_name> --node-os-upgrade-channel NodeImage --generate-ssh-keys --kubernetes-version 1.32 --node-vm-size Standard_D4s_v3 --node-count 3 --nodepool-name np01 --node-osdisk-type Managed
Result: this AZ CLI command failed with a "'NoneType' object has no attribute 'name'" error.
I tried to remove aks-preview 18.0.0b35 and install 18.0.0b30. The same command worked correctly.
Related command
az extension add --upgrade --name aks-preview -y
az aks create --os-sku AzureLinux -g <rg_name> -n <cluster_name> --node-os-upgrade-channel NodeImage --generate-ssh-keys --kubernetes-version 1.32 --node-vm-size Standard_D4s_v3 --node-count 3 --nodepool-name np01 --node-osdisk-type Managed
Errors
Traceback: {The behavior of this command has been altered by the following extension: aks-preview
The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'name'
Traceback (most recent call last):
File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 666, in execute
raise ex
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 734, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 703, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 336, in call
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 111, in handler
client = self.client_factory(self.cli_ctx, command_args) if self.client_factory else None
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/liudi/.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 "/home/liudi/.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 "/opt/az/lib/python3.12/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 "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/client_factory.py", line 223, in _get_mgmt_service_client
logger.debug('Getting management service client client_type=%s', client_type.name)
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'name'. Did you mean: 'ne'?}
Issue script & Debug output
NA
Expected behavior
The AZ CLI command to provision AKS cluster should work correctly without any error with the latest aks-preview extension.
Environment Summary
$ az -v
azure-cli 2.69.0 *
core 2.69.0 *
telemetry 1.1.0
Extensions:
aks-preview 18.0.0b30
k8s-extension 1.6.5
Dependencies:
msal 1.31.2b1
azure-mgmt-resource 23.1.1
Python location '/opt/az/bin/python3'
Config directory '/home/liudi/.azure'
Extensions directory '/home/liudi/.azure/cliextensions'
Python (Linux) 3.12.8 (main, Feb 5 2025, 06:40:27) [GCC 9.4.0]
Legal docs and information: aka.ms/AzureCliLegal
Additional context
No response