question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az aks lists fails for some subscriptions where 'ContainerServiceClientConfiguration' object has no attribute 'api_version'

See original GitHub issue

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az aks list

Errors:

The command failed with an unexpected error. Here is the traceback:
'ContainerServiceClientConfiguration' object has no attribute 'api_version'
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 121, in handler
    return op(**command_args)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/acs/custom.py", line 724, in aks_list
    return _remove_nulls(list(managed_clusters))
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/core/paging.py", line 129, in __next__
    return next(self._page_iterator)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/core/paging.py", line 76, in __next__
    self._response = self._get_next(self.continuation_token)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/mgmt/containerservice/v2022_07_01/operations/_managed_clusters_operations.py", line 977, in get_next
    request = prepare_request(next_link)
  File "/usr/lib64/az/lib/python3.9/site-packages/azure/mgmt/containerservice/v2022_07_01/operations/_managed_clusters_operations.py", line 962, in prepare_request
    _next_request_params["api-version"] = self._config.api_version
AttributeError: 'ContainerServiceClientConfiguration' object has no attribute 'api_version'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here…
  • az aks list --subscription {}

Expected Behavior

Environment Summary

Linux-5.4.0-1094-azure-x86_64-with-glibc2.35 (Cloud Shell), CBL-Mariner/Linux
Python 3.9.14
Installer: RPM

azure-cli 2.41.0

Extensions:
ai-examples 0.2.5
ml 2.10.0
ssh 1.1.2

Dependencies:
msal 1.20.0b1
azure-mgmt-resource 21.1.0b1

Additional Context

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
stephenbuckley-wppcommented, Nov 4, 2022

Hi Rakesh, I’ve had a ticket open with Azure support relating to this and today was advised of the following regarding cloud shell:

“Cloud shell’s AZ Modules has been updated to version 2.42.0 recently and I can no longer reproduce the error you faced - Could you confirm you see the same on your end?”

At the time of writing I no longer experience this issue when running the exact same az aks list command in Azure cloud shell that was generating errors when I opened this issue. It appears tham my issue was with the version of AZ inside cloud shell, and that a recent update has addressed this.

Thank you for you assistance with this issue.

0reactions
RakeshMohanMSFTcommented, Nov 4, 2022

@stephenbuckley-wpp Thank you for the confirmation. I will close this issue now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Release notes & updates – Azure CLI - Microsoft Learn
Fix #24188: az aks list : Fix pagination handling error ContainerServiceClientConfiguration object has no attribute api_version when there are many list ...
Read more >
Azure Kubernetes Error when running "az aks get-credentials ...
In my case to refresh recently granted credentials helped this one: az account set --subscription "your current subscription name".
Read more >
Getting started with Terraform and Kubernetes on Azure AKS
TL;DR: In this article, you will learn how to create Kubernetes clusters on Azure Kubernetes Service (AKS) with the Azure CLI and Terraform....
Read more >
Persistent Volume Management and Expansion in Kubernetes ...
This problem has existed since the days we used to host ... az group create --name demo-rg --location australiaeast az aks create -n...
Read more >
Hands-on Kubernetes on Azure, Third Edition
This book would not have been possible without everything you ... 1 apiVersion: v1 ... Kubernetes objects: the pod, the deployment, and the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found