{"error":{"code":"DeploymentNotFound","message":"Deployment 'deploymentName-***' could not be found."}}
Describe the bug
The Azure Cli output "{"error":{"code":"DeploymentNotFound","message":"Deployment 'deploymentName-***' could not be found."}}"
but actually it has deployed successfully, and when I check in the Azure Portal, there is no error.
How to reproduce
-
Download and Unzip the file: test_guid.bicep.zip, you will get
test_guid.bicep -
Run following steps from Step-1 to Step-3
Step-1 ---------------------------------------------------------
export RESOURCE_GROUP=test-resource-group-$(date +%s) export deploymentName=deploymentName-$(date +%s) az group create --name $RESOURCE_GROUP -l eastus az deployment group create --name ${deploymentName}eastus -f test_guid.bicep -g $RESOURCE_GROUPStep-2 ---------------------------------------------------------
az group delete --name $RESOURCE_GROUP --yesStep-3 ---------------------------------------------------------
az group create --name $RESOURCE_GROUP -l westus az deployment group create --name ${deploymentName}westus -f test_guid.bicep -g $RESOURCE_GROUP --debug
Related command
NA
Errors
{"error":{"code":"DeploymentNotFound","message":"Deployment 'deploymentName-***' could not be found."}}
Issue script & Debug output
cli.knack.cli: Command arguments: ['deployment', 'group', 'create', '--name', 'deploymentName-1714056289westus', '-f', 'test_guid.bicep', '-g', 'test-resource-group-1714056289', '--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 0x1048eb9a0>, <function OutputProducer.on_global_arguments at 0x104a41ab0>, <function CLIQuery.on_global_arguments at 0x104e6add0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'deployment': ['azure.cli.command_modules.resource']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: resource 0.111 51 228
cli.azure.cli.core: Total (1) 0.111 51 228
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: Total (0) 0.000 0 0
cli.azure.cli.core: Loaded 51 groups, 228 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : deployment group create
cli.azure.cli.core: Command table: deployment group create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x105c9b9a0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/backwind1233/.azure/commands/2024-04-25.22-47-46.deployment_group_create.99220.log'.
az_command_data_logger: command args: deployment group create --name {} -f {} -g {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/opt/homebrew/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 712, in _run_job result = LongRunningOperation(cmd_copy.cli_ctx, 'Starting {}'.format(cmd_copy.name))(result) File "/opt/homebrew/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 1048, in call raise exception File "/opt/homebrew/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 1035, in call result = poller.result() File "/opt/homebrew/lib/python3.10/site-packages/azure/core/polling/_poller.py", line 242, in result self.wait(timeout) File "/opt/homebrew/lib/python3.10/site-packages/azure/core/tracing/decorator.py", line 76, in wrapper_use_tracer return func(*args, **kwargs) File "/opt/homebrew/lib/python3.10/site-packages/azure/core/polling/_poller.py", line 261, in wait raise self._exception # type: ignore File "/opt/homebrew/lib/python3.10/site-packages/azure/core/polling/_poller.py", line 176, in _start self._polling_method.run() File "/opt/homebrew/lib/python3.10/site-packages/azure/core/polling/base_polling.py", line 734, in run raise HttpResponseError(response=self._pipeline_response.http_response, error=err) from err azure.core.exceptions.HttpResponseError: (DeploymentNotFound) Deployment 'deploymentName-1714056289westus' could not be found. Code: DeploymentNotFound Message: Deployment 'deploymentName-1714056289westus' could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/homebrew/lib/python3.10/site-packages/azure/cli/core/commands/arm.py", line 109, in handle_template_based_exception raise CLIError(ex.inner_exception.error.message) AttributeError: 'BadStatus' object has no attribute 'error'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/homebrew/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) File "/opt/homebrew/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 664, in execute raise ex File "/opt/homebrew/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 731, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) File "/opt/homebrew/lib/python3.10/site-packages/azure/cli/core/commands/init.py", line 723, in _run_job return cmd_copy.exception_handler(ex) File "/opt/homebrew/lib/python3.10/site-packages/azure/cli/core/commands/arm.py", line 112, in handle_template_based_exception raise_subdivision_deployment_error(ex.response.internal_response.text, ex.error.code if ex.error else None) File "/opt/homebrew/lib/python3.10/site-packages/azure/cli/core/commands/arm.py", line 104, in raise_subdivision_deployment_error raise DeploymentError(error_message) azure.cli.core.azclierror.DeploymentError: {"error":{"code":"DeploymentNotFound","message":"Deployment 'deploymentName-1714056289westus' could not be found."}}
cli.azure.cli.core.azclierror: {"error":{"code":"DeploymentNotFound","message":"Deployment 'deploymentName-1714056289westus' could not be found."}} az_command_data_logger: {"error":{"code":"DeploymentNotFound","message":"Deployment 'deploymentName-1714056289westus' could not be found."}} cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x105c9bbe0>] az_command_data_logger: exit code: 1 cli.main: Command ran in 12.416 seconds (init: 0.136, invoke: 12.280) 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 3936 in cache telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "/opt/homebrew/opt/[email protected]/bin/python3.10 /opt/homebrew/lib/python3.10/site-packages/azure/cli/telemetry/init.py /Users/backwind1233/.azure" telemetry.process: Return from creating process telemetry.main: Finish creating telemetry upload process.
Expected behavior
Everything is ok.
Environment Summary
azure-cli 2.59.0
core 2.59.0 telemetry 1.1.0
Extensions: account 0.2.5 application-insights 1.2.1 containerapp 0.3.50 interactive 0.5.3 rdbms-connect 1.0.5 resource-graph 2.1.0 serviceconnector-passwordless 1.0.3 spring 1.21.0 spring-cloud 3.1.8
Dependencies: msal 1.27.0 azure-mgmt-resource 23.1.0b2
Python location '/opt/homebrew/opt/[email protected]/bin/python3.10' Extensions directory '/Users/backwind1233/.azure/cliextensions'
Python (Darwin) 3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.3.9.4)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response
Thank you for opening this issue, we will look into it.
Any updates?
Is there any updates here please?
I also have this problem in eastus!
I am having the same issue in westus. I am following https://azurearcjumpstart.com/azure_arc_jumpstart/azure_arc_servers/azure/azure_arm_template_win to perform some testing, and the GET request failed with 404:
> az deployment group create --resource-group Arc-Servers-Win-Demo --name arcwinsrvdemo --template-uri https://raw.githubusercontent.com/microsoft/azure_arc/main/azure_arc_servers_jumpstart/azure/windows/arm_template/azuredeploy.json --parameters azuredeploy.parameters.json --debug
...
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/Arc-Servers-Win-Demo/providers/Microsoft.Resources/deployments/arcwinsrvdemo/operationStatuses/08584827209803016684?api-version=2022-09-01'
cli.azure.cli.core.sdk.policies: Request method: 'GET'
cli.azure.cli.core.sdk.policies: Request headers:
cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': '261221cc-2eff-11ef-b124-1091d1f98a2a'
cli.azure.cli.core.sdk.policies: 'CommandName': 'deployment group create'
cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--resource-group --name --template-uri --parameters --debug'
cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.61.0 (ZIP) azsdk-python-core/1.28.0 Python/3.11.8 (Windows-10-10.0.22631-SP0)'
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: https://management.azure.com:443 "GET /subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourcegroups/Arc-Servers-Win-Demo/providers/Microsoft.Resources/deployments/arcwinsrvdemo/operationStatuses/08584827209803016684?api-version=2022-09-01 HTTP/1.1" 404 98
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-Length': '98'
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-ratelimit-remaining-subscription-reads': '249'
cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-global-reads': '3749'
cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '23f838eb-27a8-4ff4-80d6-d3f3e82dc36f'
cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '23f838eb-27a8-4ff4-80d6-d3f3e82dc36f'
cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'SOUTHEASTASIA:20240620T121836Z:23f838eb-27a8-4ff4-80d6-d3f3e82dc36f'
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: 'X-Cache': 'CONFIG_NOCACHE'
cli.azure.cli.core.sdk.policies: 'X-MSEdge-Ref': 'Ref A: BC64ED3B38D7456FB21E869322D7DAE4 Ref B: MAA201060515033 Ref C: 2024-06-20T12:18:35Z'
cli.azure.cli.core.sdk.policies: 'Date': 'Thu, 20 Jun 2024 12:18:35 GMT'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"error":{"code":"DeploymentNotFound","message":"Deployment 'arcwinsrvdemo' could not be found."}}
azure.core.exceptions.HttpResponseError: (DeploymentNotFound) Deployment 'deploymentName-1714056289westus' could not be found. Code: DeploymentNotFound Message: Deployment 'deploymentName-1714056289westus' could not be found.
Due to the fact that the az deployment related CLI commands have not been updated for a long time, the unexpected error of 404 DeploymentNotFound was responsed by the REST service. Therefore, the ARM service team needs to help investigate the root cause of this error message.
@jorgecotillo Could you please help with this ARM deployment related issue? The impact of this issue seems to be widespread