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

For command az quota list, CLI shows error ServiceUnavailable when throttling occurs #28075

Closed
mattwelke opened this issue Dec 20, 2023 · 5 comments
Assignees
Labels
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. quota Service Attention This issue is responsible by Azure service team.

Comments

@mattwelke
Copy link

Describe the bug

When running the command az quota list --scope /subscriptions/<my-subscription-id>/providers/Microsoft.Network/locations/eastus in a situation where throttling is occurring, it displays the following error instead of a different error that would convey that throttling specifically is the problem occurring. This error is more generic:

(ServiceUnavailable) Service Unavailable. Please retry again later.
Code: ServiceUnavailable
Message: Service Unavailable. Please retry again later.

I know that throttling is occurring in this situation because I'm also testing with a Go program using the Go SDK:

subscription := os.Getenv("SCOPE_SUB")
location := os.Getenv("SCOPE_LOC")

scope := fmt.Sprintf("subscriptions/%s/providers/Microsoft.Network/locations/%s",
	subscription,
	location)

resp := client.NewListPager(scope, nil)
items := []*armquota.CurrentQuotaLimitBase{}
for resp.More() {
	page, err := resp.NextPage(context.TODO())
	if err != nil {
		log.Fatalf("failed to get next page: %s", err)
	}

	items = append(items, page.Value...)
}

This code encounters an error from resp.NextPage:

image

I'm reporting this because I think the CLI could be improved to detect when throttling is occurring and tell the user that this is the specific reason the command could not be completed successfully. In HTTP, "Service Unavailable" usually corresponds to a situation where the error occurred server side, indicating that there is nothing the client could do to make the request successful.

In this case, this is not true, and the client can make the request successful by trying again later. If my assumption that the CLI is powered by the REST API for this command is true, the Retry-After header I've observed in the response in the Go example might be helpful for this too, providing info the CLI user can use to help them make a successful request if they try again after waiting.

image

Related command

az quota show

Errors

(ServiceUnavailable) Service Unavailable. Please retry again later.
Code: ServiceUnavailable
Message: Service Unavailable. Please retry again later.

Issue script & Debug output

~ > az quota list --scope /subscriptions/<my-subscription-id>/providers/Microsoft.Network/locations/eastus --debug
cli.knack.cli: Command arguments: ['quota', 'list', '--scope', '/subscriptions/<my-subscription-id>/providers/Microsoft.Network/locations/eastus', '--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 0x7f072fc154e0>, <function OutputProducer.on_global_arguments at 0x7f072fbb5ee0>, <function CLIQuery.on_global_arguments at 0x7f072fbef9c0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'quota': ['azext_quota']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name                  Load Time    Groups  Commands
cli.azure.cli.core: Total (0)                 0.000         0         0
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name                  Load Time    Groups  Commands  Directory
cli.azure.cli.core: quota                     0.050         5         9  /home/matt/.azure/cliextensions/quota
cli.azure.cli.core: Total (1)                 0.050         5         9  
cli.azure.cli.core: Loaded 5 groups, 9 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command  : quota list
cli.azure.cli.core: Command table: quota list
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f072ed44d60>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/matt/.azure/commands/2023-12-20.13-30-02.quota_list.29431.log'.
az_command_data_logger: command args: quota list --scope {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x7f072eb03240>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x7f072eb60fe0>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x7f072eb61120>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f072fbb5f80>, <function CLIQuery.handle_query_parameter at 0x7f072fbefa60>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x7f072eb61080>]
az_command_data_logger: extension name: quota
az_command_data_logger: extension version: 1.0.0
cli.azure.cli.core.auth.persistence: build_persistence: location='/home/matt/.azure/msal_token_cache.json', encrypt=False
cli.azure.cli.core.auth.binary_cache: load: /home/matt/.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 = {'token_endpoint': 'https://login.microsoftonline.com/4b341b5e-d5bd-48ef-bb73-4c785efa512a/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/4b341b5e-d5bd-48ef-bb73-4c785efa512a/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com/4b341b5e-d5bd-48ef-bb73-4c785efa512a/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/4b341b5e-d5bd-48ef-bb73-4c785efa512a/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/4b341b5e-d5bd-48ef-bb73-4c785efa512a/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/4b341b5e-d5bd-48ef-bb73-4c785efa512a/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/4b341b5e-d5bd-48ef-bb73-4c785efa512a/kerberos', 'tenant_region_scope': 'NA', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'}
msal.application: Broker enabled? False
cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={}
cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.windows.net//.default',), claims=None, kwargs={}
msal.application: Cache hit an AT
msal.telemetry: Generate or reuse correlation_id: 5215d802-7090-49dc-81d5-095a1a917bfc
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/<my-subscription-id>/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/quotas?api-version=2023-02-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': 'ca17f0e3-9f65-11ee-adba-50284a2b9d96'
cli.azure.cli.core.sdk.policies:     'CommandName': 'quota list'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--scope --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.55.0 (DEB) (AAZ) azsdk-python-core/1.26.0 Python/3.11.5 (Linux-6.2.0-39-generic-x86_64-with-glibc2.37)'
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.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/<my-subscription-id>/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/quotas?api-version=2023-02-01 HTTP/1.1" 503 98
cli.azure.cli.core.sdk.policies: Response status: 503
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-Length': '98'
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json'
cli.azure.cli.core.sdk.policies:     'Expires': '-1'
cli.azure.cli.core.sdk.policies:     'Vary': 'Accept-Encoding'
cli.azure.cli.core.sdk.policies:     'Server': 'Kestrel'
cli.azure.cli.core.sdk.policies:     'x-ms-failure-cause': 'service'
cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-reads': '11999'
cli.azure.cli.core.sdk.policies:     'x-ms-request-id': '93bb74f7-dd81-4e52-a862-f1be0d8b39a3'
cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': '93bb74f7-dd81-4e52-a862-f1be0d8b39a3'
cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'CANADACENTRAL:20231220T183003Z:93bb74f7-dd81-4e52-a862-f1be0d8b39a3'
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': 'Wed, 20 Dec 2023 18:30:02 GMT'
cli.azure.cli.core.sdk.policies:     'Connection': 'close'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"error":{"code":"ServiceUnavailable","message":"Service Unavailable. Please retry again later."}}
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/<my-subscription-id>/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/quotas?api-version=2023-02-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': 'ca17f0e3-9f65-11ee-adba-50284a2b9d96'
cli.azure.cli.core.sdk.policies:     'CommandName': 'quota list'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--scope --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.55.0 (DEB) (AAZ) azsdk-python-core/1.26.0 Python/3.11.5 (Linux-6.2.0-39-generic-x86_64-with-glibc2.37)'
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: Resetting dropped connection: management.azure.com
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/<my-subscription-id>/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/quotas?api-version=2023-02-01 HTTP/1.1" 503 98
cli.azure.cli.core.sdk.policies: Response status: 503
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-Length': '98'
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json'
cli.azure.cli.core.sdk.policies:     'Expires': '-1'
cli.azure.cli.core.sdk.policies:     'Vary': 'Accept-Encoding'
cli.azure.cli.core.sdk.policies:     'Server': 'Kestrel'
cli.azure.cli.core.sdk.policies:     'x-ms-failure-cause': 'service'
cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-reads': '11999'
cli.azure.cli.core.sdk.policies:     'x-ms-request-id': '6f9504a3-fd19-4b17-94ef-01086322916d'
cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': '6f9504a3-fd19-4b17-94ef-01086322916d'
cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'CANADACENTRAL:20231220T183003Z:6f9504a3-fd19-4b17-94ef-01086322916d'
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': 'Wed, 20 Dec 2023 18:30:03 GMT'
cli.azure.cli.core.sdk.policies:     'Connection': 'close'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"error":{"code":"ServiceUnavailable","message":"Service Unavailable. Please retry again later."}}
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/<my-subscription-id>/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/quotas?api-version=2023-02-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': 'ca17f0e3-9f65-11ee-adba-50284a2b9d96'
cli.azure.cli.core.sdk.policies:     'CommandName': 'quota list'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--scope --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.55.0 (DEB) (AAZ) azsdk-python-core/1.26.0 Python/3.11.5 (Linux-6.2.0-39-generic-x86_64-with-glibc2.37)'
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: Resetting dropped connection: management.azure.com
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/<my-subscription-id>/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/quotas?api-version=2023-02-01 HTTP/1.1" 503 98
cli.azure.cli.core.sdk.policies: Response status: 503
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-Length': '98'
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json'
cli.azure.cli.core.sdk.policies:     'Expires': '-1'
cli.azure.cli.core.sdk.policies:     'Vary': 'Accept-Encoding'
cli.azure.cli.core.sdk.policies:     'Server': 'Kestrel'
cli.azure.cli.core.sdk.policies:     'x-ms-failure-cause': 'service'
cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-reads': '11999'
cli.azure.cli.core.sdk.policies:     'x-ms-request-id': '8f66d340-7189-4b70-92d6-b735ea260b85'
cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': '8f66d340-7189-4b70-92d6-b735ea260b85'
cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'CANADACENTRAL:20231220T183005Z:8f66d340-7189-4b70-92d6-b735ea260b85'
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': 'Wed, 20 Dec 2023 18:30:05 GMT'
cli.azure.cli.core.sdk.policies:     'Connection': 'close'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"error":{"code":"ServiceUnavailable","message":"Service Unavailable. Please retry again later."}}
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/<my-subscription-id>/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/quotas?api-version=2023-02-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': 'ca17f0e3-9f65-11ee-adba-50284a2b9d96'
cli.azure.cli.core.sdk.policies:     'CommandName': 'quota list'
cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--scope --debug'
cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.55.0 (DEB) (AAZ) azsdk-python-core/1.26.0 Python/3.11.5 (Linux-6.2.0-39-generic-x86_64-with-glibc2.37)'
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: Resetting dropped connection: management.azure.com
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/<my-subscription-id>/providers/Microsoft.Network/locations/eastus/providers/Microsoft.Quota/quotas?api-version=2023-02-01 HTTP/1.1" 503 98
cli.azure.cli.core.sdk.policies: Response status: 503
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-Length': '98'
cli.azure.cli.core.sdk.policies:     'Content-Type': 'application/json'
cli.azure.cli.core.sdk.policies:     'Expires': '-1'
cli.azure.cli.core.sdk.policies:     'Vary': 'Accept-Encoding'
cli.azure.cli.core.sdk.policies:     'Server': 'Kestrel'
cli.azure.cli.core.sdk.policies:     'x-ms-failure-cause': 'service'
cli.azure.cli.core.sdk.policies:     'x-ms-ratelimit-remaining-subscription-reads': '11999'
cli.azure.cli.core.sdk.policies:     'x-ms-request-id': '10aa73a1-2913-4601-9535-e6a88e287c2f'
cli.azure.cli.core.sdk.policies:     'x-ms-correlation-request-id': '10aa73a1-2913-4601-9535-e6a88e287c2f'
cli.azure.cli.core.sdk.policies:     'x-ms-routing-request-id': 'CANADACENTRAL:20231220T183009Z:10aa73a1-2913-4601-9535-e6a88e287c2f'
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': 'Wed, 20 Dec 2023 18:30:09 GMT'
cli.azure.cli.core.sdk.policies:     'Connection': 'close'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"error":{"code":"ServiceUnavailable","message":"Service Unavailable. Please retry again later."}}
cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/az/lib/python3.11/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.11/site-packages/azure/cli/core/commands/__init__.py", line 710, in _run_job
    result = list(result)
             ^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 87, in __next__
    return next(self._page_iterator)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 43, in __next__
    self._executor(self._next_link)
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/aaz/_command.py", line 250, in executor_wrapper
    executor()
  File "/home/matt/.azure/cliextensions/quota/azext_quota/aaz/latest/quota/_list.py", line 63, in _execute_operations
    self.QuotaList(ctx=self.ctx)()
  File "/home/matt/.azure/cliextensions/quota/azext_quota/aaz/latest/quota/_list.py", line 88, in __call__
    return self.on_error(session.http_response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.11/site-packages/azure/cli/core/aaz/_operation.py", line 332, in on_error
    raise HttpResponseError(response=response, error_format=error_format)
azure.core.exceptions.HttpResponseError: (ServiceUnavailable) Service Unavailable. Please retry again later.
Code: ServiceUnavailable
Message: Service Unavailable. Please retry again later.

cli.azure.cli.core.azclierror: (ServiceUnavailable) Service Unavailable. Please retry again later.
Code: ServiceUnavailable
Message: Service Unavailable. Please retry again later.
az_command_data_logger: (ServiceUnavailable) Service Unavailable. Please retry again later.
Code: ServiceUnavailable
Message: Service Unavailable. Please retry again later.
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f072ed44fe0>]
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 6.826 seconds (init: 0.101, invoke: 6.725)
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 3669 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.11/site-packages/azure/cli/telemetry/__init__.py /home/matt/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

Expected behavior

CLI output shows that my request may succeed if I wait again and try again later. CLI output tells me how long I should wait.

Environment Summary

~ > az --version
azure-cli                         2.55.0

core                              2.55.0
telemetry                          1.1.0

Extensions:
quota                              1.0.0

Dependencies:
msal                            1.24.0b2
azure-mgmt-resource             23.1.0b2

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

Python (Linux) 3.11.5 (main, Nov 29 2023, 03:40:58) [GCC 11.4.0]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Additional context

No response

@mattwelke mattwelke added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Dec 20, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Dec 20, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 20, 2023

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

@yonzhan yonzhan added quota Service Attention This issue is responsible by Azure service team. labels Dec 20, 2023
@jsntcy
Copy link
Member

jsntcy commented Dec 21, 2023

@Jing-song, please help take a look.

@Jing-song
Copy link
Contributor

Hi, @mattwelke , Whether this is because your subscription has not registered feature aboult quota, please use az feature list --namespace Microsoft.Quota to confirm.
My command output is as follows

az feature list --namespace Microsoft.Quota
[
  {
    "id": "/subscriptions/mysub/providers/Microsoft.Features/providers/Microsoft.Quota/features/AlternativeRecommendations",
    "name": "Microsoft.Quota/AlternativeRecommendations",
    "properties": {
      "state": "NotRegistered"
    },
    "type": "Microsoft.Features/providers/features"
  },
  {
    "id": "/subscriptions/mysub/providers/Microsoft.Features/providers/Microsoft.Quota/features/GroupQuotaPreview",
    "name": "Microsoft.Quota/GroupQuotaPreview",
    "properties": {
      "state": "NotRegistered"
    },
    "type": "Microsoft.Features/providers/features"
  },
  {
    "id": "/subscriptions/mysub/providers/Microsoft.Features/providers/Microsoft.Quota/features/QuotaPreview",
    "name": "Microsoft.Quota/QuotaPreview",
    "properties": {
      "state": "Registered"
    },
    "type": "Microsoft.Features/providers/features"
  }
]

@Jing-song
Copy link
Contributor

Jing-song commented Dec 29, 2023

Hi @mattwelke I have confirmed with the service team. It is caused by not registering the feature. Please run az provider register --namespace Microsoft.Quota to register it.
Reference https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-providers-and-types#azure-cli

@mattwelke
Copy link
Author

Hi @Jing-song,

Thanks for looking into this for me. I was able to determine that this was caused by not registering the resource provider. Registering it resolved my issues with both the CLI and the Go SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. quota Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

4 participants