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

After uprading to az 2.50.0 , the command "az aks get-versions" fails in China #26827

Closed
jonathanzhang02 opened this issue Jul 6, 2023 · 5 comments
Assignees
Labels
AKS az aks/acs/openshift Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. CXP Attention This issue is handled by CXP team. needs-author-feedback More information is needed from author to address the issue.

Comments

@jonathanzhang02
Copy link

Describe the bug

After uprading to az 2.50.0 , the command "az aks get-versions" fails in China

Related command

az aks get-versions --location chinanorth3 --output json

Errors

~$ az aks get-versions --location chinanorth3 --output json
(InvalidResourceType) The resource type 'locations' could not be found in the namespace 'Microsoft.ContainerService' for api version '2023-05-01'. The supported api-versions are '2017-08-31'.
Code: InvalidResourceType
Message: The resource type 'locations' could not be found in the namespace 'Microsoft.ContainerService' for api version '2023-05-01'. The supported api-versions are '2017-08-31'

Issue script & Debug output

az aks get-versions --location chinanorth3 --output json --debug
cli.knack.cli: Command arguments: ['aks', 'get-versions', '--location', 'chinanorth3', '--output', 'json', '--debug']
cli.knack.cli: __init__ debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0xffff8ef6d360>, <function OutputProducer.on_global_arguments at 0xffff8eea4280>, <function CLIQuery.on_global_arguments at 0xffff8eca5480>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'aks': ['azure.cli.command_modules.acs']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: acs                       0.022         6        48
cli.azure.cli.core: Total (1)                 0.022         6        48
cli.azure.cli.core: Loaded 6 groups, 48 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command  : aks get-versions
cli.azure.cli.core: Command table: aks get-versions
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0xffff8df9edd0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/u4/.azure/commands/2023-07-06.17-44-01.aks_get-versions.2714.log'.
az_command_data_logger: command args: aks get-versions --location {} --output {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0xffff8dfb7910>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0xffff8dffd870>, <function register_cache_arguments.<locals>.add_cache_arguments at 0xffff8dffd990>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0xffff8eea4310>, <function CLIQuery.handle_query_parameter at 0xffff8eca5510>, <function register_ids_argument.<locals>.parse_ids_arguments at 0xffff8dffd900>]
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=ContainerServiceClient
cli.azure.cli.core.auth.persistence: build_persistence: location='/home/u4/.azure/service_principal_entries.json', encrypt=False
cli.azure.cli.core.auth.persistence: build_persistence: location='/home/u4/.azure/msal_token_cache.json', encrypt=False
cli.azure.cli.core.auth.binary_cache: load: /home/u4/.azure/msal_http_cache.bin
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: openid_config = 
msal.application: Broker enabled? False
msal.application: Region to be used: None
cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.chinacloudapi.cn//.default',), kwargs={}
cli.azure.cli.core.auth.msal_authentication: ServicePrincipalCredential.get_token: scopes=('https://management.core.chinacloudapi.cn//.default',), kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: 41ae7165-9d15-4a6d-8e1b-51da7e4bcd1b
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.chinacloudapi.cn/subscriptions/c71c4ca1-ff5d-4e49-b958-10d0faed354c/providers/Microsoft.ContainerService/locations/chinanorth3/kubernetesVersions?api-version=2023-05-01'
cli.azure.cli.core.sdk.policies: Request method: 'GET'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies:     'Accept': 'application/json'
cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': 'a36f5af1-1be1-11ee-af43-99e22f3c1bd9'
cli.azure.cli.core.sdk.policies:     'CommandName': 'aks get-versions'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--location --output --debug'
cli.azure.cli.core.sdk.policies:     'Authorization': ''
cli.azure.cli.core.sdk.policies: Request body:
cli.azure.cli.core.sdk.policies: This request has no body
urllib3.connectionpool: Starting new HTTPS connection (1): management.chinacloudapi.cn:443
urllib3.connectionpool: https://management.chinacloudapi.cn:443 "GET /subscriptions/c71c4ca1-ff5d-4e49-b958-10d0faed354c/providers/Microsoft.ContainerService/locations/chinanorth3/kubernetesVersions?api-version=2023-05-01 HTTP/1.1" 404 222
cli.azure.cli.core.sdk.policies: Response status: 404
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies:     'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies:     'Expires': '-1'
cli.azure.cli.core.sdk.policies:     'x-ms-failure-cause': 'gateway'
cli.azure.cli.core.sdk.policies:     'x-ms-request-id': 'e3c654a7-0535-4274-9b18-fbb9dbf4fa36'
cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': 'e3c654a7-0535-4274-9b18-fbb9dbf4fa36'
cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'CHINAEAST:20230706T094555Z:e3c654a7-0535-4274-9b18-fbb9dbf4fa36'
cli.azure.cli.core.sdk.policies:     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies:     'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies:     'Date': 'Thu, 06 Jul 2023 09:45:54 GMT'
cli.azure.cli.core.sdk.policies:     'Content-Length': '222'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"error":{"code":"InvalidResourceType","message":"The resource type 'locations' could not be found in the namespace 'Microsoft.ContainerService' for api version '2023-05-01'. The supported api-versions are '2017-08-31'."}}
cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/opt/az/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.10/site-packages/azure/cli/command_modules/acs/custom.py", line 1771, in aks_get_versions
    return client.list_kubernetes_versions(location)
  File "/opt/az/lib/python3.10/site-packages/azure/core/tracing/decorator.py", line 78, in wrapper_use_tracer
    return func(*args, **kwargs)
  File "/opt/az/lib/python3.10/site-packages/azure/mgmt/containerservice/v2023_05_01/operations/_managed_clusters_operations.py", line 1090, in list_kubernetes_versions
    map_error(status_code=response.status_code, response=response, error_map=error_map)
  File "/opt/az/lib/python3.10/site-packages/azure/core/exceptions.py", line 107, in map_error
    raise error
azure.core.exceptions.ResourceNotFoundError: (InvalidResourceType) The resource type 'locations' could not be found in the namespace 'Microsoft.ContainerService' for api version '2023-05-01'. The supported api-versions are '2017-08-31'.
Code: InvalidResourceType
Message: The resource type 'locations' could not be found in the namespace 'Microsoft.ContainerService' for api version '2023-05-01'. The supported api-versions are '2017-08-31'.

cli.azure.cli.core.azclierror: (InvalidResourceType) The resource type 'locations' could not be found in the namespace 'Microsoft.ContainerService' for api version '2023-05-01'. The supported api-versions are '2017-08-31'.
Code: InvalidResourceType
Message: The resource type 'locations' could not be found in the namespace 'Microsoft.ContainerService' for api version '2023-05-01'. The supported api-versions are '2017-08-31'.
az_command_data_logger: (InvalidResourceType) The resource type 'locations' could not be found in the namespace 'Microsoft.ContainerService' for api version '2023-05-01'. The supported api-versions are '2017-08-31'.
Code: InvalidResourceType
Message: The resource type 'locations' could not be found in the namespace 'Microsoft.ContainerService' for api version '2023-05-01'. The supported api-versions are '2017-08-31'.
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0xffff8df9f010>]
az_command_data_logger: exit code: 3
cli.__main__: Command ran in 1.488 seconds (init: 0.096, invoke: 1.392)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 3894 in cache
telemetry.check: Returns Positive.
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/usr/bin/../../opt/az/bin/python3 /opt/az/lib/python3.10/site-packages/azure/cli/telemetry/__init__.py /home/u4/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

Expected behavior

command should work without failures

Environment Summary

$ az --version
azure-cli                         2.50.0

core                              2.50.0
telemetry                          1.0.8

Dependencies:
msal                              1.22.0
azure-mgmt-resource             23.1.0b2

Python location '/opt/az/bin/python3'
Extensions directory '/home/xxxx/.azure/cliextensions'

Python (Linux) 3.10.10 (main, Jun 29 2023, 11:10:22) [GCC 9.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Additional context

No response

@jonathanzhang02 jonathanzhang02 added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jul 6, 2023
@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. AKS az aks/acs/openshift CXP Attention This issue is handled by CXP team. Auto-Assign Auto assign by bot labels Jul 6, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Jul 6, 2023

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

@navba-MSFT navba-MSFT self-assigned this Jul 7, 2023
@navba-MSFT
Copy link
Contributor

@jonathanzhang02 Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update.

@navba-MSFT
Copy link
Contributor

@jonathanzhang02 We have reached out to the right Product Owners to assist on this and awaiting their reply now.

@navba-MSFT
Copy link
Contributor

@jonathanzhang02 This issue should be fixed now. Please unregister and re-register the resource provider and try your AzCLI command after sometime.

Unregister-AzResourceProvider -ProviderNamespace 'Microsoft.ContainerService'

Register-AzResourceProvider -ProviderNamespace 'Microsoft.ContainerService'

@navba-MSFT navba-MSFT added the needs-author-feedback More information is needed from author to address the issue. label Jul 13, 2023
@navba-MSFT
Copy link
Contributor

@jonathanzhang02 The action is pending on you to try the above suggestion. If you need any further assistance on this issue in future, please feel free to reopen this thread. We would be happy to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AKS az aks/acs/openshift Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. CXP Attention This issue is handled by CXP team. needs-author-feedback More information is needed from author to address the issue.
Projects
None yet
Development

No branches or pull requests

3 participants