Skip to content

The command failed with an unexpected error. Here is the traceback: 'metadata' #27696

@avneeshkumar

Description

@avneeshkumar

Describe the bug

I am getting following error when updating the container app with new Image in ACR.

Related command

az containerapp update -n ca-extrnlfrm-evnt-wrkr-debug -g $RESOURCE_GROUP --image $ACR_SERVER/externalform-events-worker-debug:bf41ee93067eb9b8b8ed2876f4fc21eb565fc3f5

Errors

The command failed with an unexpected error. Here is the traceback:
'metadata'
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/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/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job
    return cmd_copy.exception_handler(ex)
  File "/Users/avneeshkumar/.azure/cliextensions/containerapp/azext_containerapp/_client_factory.py", line 28, in _polish_bad_errors
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 705, in _run_job
    result = transform_op(result)
  File "/Users/avneeshkumar/.azure/cliextensions/containerapp/azext_containerapp/_transformers.py", line 32, in transform_sensitive_values
    val["metadata"] = dict((k, "") for k, v in val["metadata"].items())
KeyError: 'metadata'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

cli.azure.cli.core.util: Response status: 200
cli.azure.cli.core.util: Response headers:
cli.azure.cli.core.util:     'Cache-Control': 'no-cache'
cli.azure.cli.core.util:     'Pragma': 'no-cache'
cli.azure.cli.core.util:     'Transfer-Encoding': 'chunked'
cli.azure.cli.core.util:     'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.util:     'Content-Encoding': 'gzip'
cli.azure.cli.core.util:     'Expires': '-1'
cli.azure.cli.core.util:     'Vary': 'Accept-Encoding,Accept-Encoding'
cli.azure.cli.core.util:     'x-ms-ratelimit-remaining-subscription-reads': '11999'
cli.azure.cli.core.util:     'api-supported-versions': '2022-01-01-preview, 2022-03-01, 2022-06-01-preview, 2022-10-01, 2022-11-01-preview, 2023-04-01-preview, 2023-05-01, 2023-05-02-preview, 2023-08-01-preview'
cli.azure.cli.core.util:     'Server': 'Microsoft-IIS/10.0'
cli.azure.cli.core.util:     'X-Powered-By': 'ASP.NET'
cli.azure.cli.core.util:     'x-ms-request-id': '774a706a-94d3-4126-b71c-8b3b39988e10'
cli.azure.cli.core.util:     'x-ms-correlation-request-id': '774a706a-94d3-4126-b71c-8b3b39988e10'
cli.azure.cli.core.util:     'x-ms-routing-request-id': 'SOUTHINDIA:20231026T164331Z:774a706a-94d3-4126-b71c-8b3b39988e10'
cli.azure.cli.core.util:     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.util:     'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.util:     'Date': 'Thu, 26 Oct 2023 16:43:30 GMT'
cli.azure.cli.core.util: Response content:
{"id":"/subscriptions/***/resourceGroups/rg-mm-apps-debug/providers/Microsoft.App/containerapps/ca-extrnlfrm-evnt-wrkr-debug","name":"ca-extrnlfrm-evnt-wrkr-debug","type":"Microsoft.App/containerApps","location":"West US","tags":{"createdBy":"pulumi-infra","environment":"debug"},"systemData":{"createdBy":"","createdByType":"User","createdAt":"2023-09-28T14:44:28.9084489","lastModifiedBy":"","lastModifiedByType":"User","lastModifiedAt":"2023-10-26T16:42:59.9444394"},"properties":{"provisioningState":"Succeeded","runningStatus":"Running","managedEnvironmentId":"/subscriptions/***/resourceGroups/rg-mm-apps-debug/providers/Microsoft.App/managedEnvironments/cae-mm-container-apps-debug","environmentId":"/subscriptions/***/resourceGroups/rg-mm-apps-debug/providers/Microsoft.App/managedEnvironments/cae-mm-container-apps-debug","workloadProfileName":null,"outboundIpAddresses":["20.245.201.184"],"latestRevisionName":"ca-extrnlfrm-evnt-wrkr-debug--7ogmdiv","latestReadyRevisionName":"ca-extrnlfrm-evnt-wrkr-debug--7ogmdiv","latestRevisionFqdn":"","customDomainVerificationId":"***","configuration":{"secrets":[{"name":"reg-pwd"},{"name":"azure-storage"}],"activeRevisionsMode":"Single","ingress":null,"registries":[{"server":"***","username":"acrmmdebug","passwordSecretRef":"reg-pwd","identity":""}],"dapr":null,"maxInactiveRevisions":null,"service":null},"template":{"revisionSuffix":"","terminationGracePeriodSeconds":null,"containers":[{"image":"***/externalform-events-worker-debug:bf41ee93067eb9b8b8ed2876f4fc21eb565fc3f5","name":"ca-extrnlfrm-evnt-wrkr-debug","env":[{"name":"AZURE_CLIENT_ID","value":"***"},{"name":"CONFIG_SOURCE_URL","value":"***"},{"name":"CONFIG_SOURCE","value":"***"},{"name":"DEPLOYMENT","value":"DEBUG"},{"name":"NODE_ENV","value":"production"},{"name":"WEBSITE_ALT_DNS_SERVER","value":"8.8.8.8"},{"name":"WEBSITE_DNS_ATTEMPTS","value":"3"},{"name":"WEBSITE_DNS_TIMEOUT","value":"10"}],"resources":{"cpu":0.5,"memory":"1Gi","ephemeralStorage":"2Gi"}}],"initContainers":null,"scale":{"minReplicas":0,"maxReplicas":1,"rules":[{"name":"azure-queue-based-scaler","azureQueue":{"queueName":"debug-externalform-payload-queue","queueLength":1,"auth":[{"secretRef":"azure-storage","triggerParameter":"connection"}]}}]},"volumes":null,"serviceBinds":null},"eventStreamEndpoint":"https://westus.azurecontainerapps.dev/subscriptions/***/resourceGroups/rg-mm-apps-debug/containerApps/ca-extrnlfrm-evnt-wrkr-debug/eventstream"},"identity":{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/***/resourcegroups/portal-debug-apps/providers/Microsoft.ManagedIdentity/userAssignedIdentities/AzureAppConfigAccessDebug":{"principalId":"***","clientId":"***"}}}}
cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/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/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job
    return cmd_copy.exception_handler(ex)
  File "/Users/avneeshkumar/.azure/cliextensions/containerapp/azext_containerapp/_client_factory.py", line 28, in _polish_bad_errors
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 705, in _run_job
    result = transform_op(result)
  File "/Users/avneeshkumar/.azure/cliextensions/containerapp/azext_containerapp/_transformers.py", line 32, in transform_sensitive_values
    val["metadata"] = dict((k, "") for k, v in val["metadata"].items())
KeyError: 'metadata'

cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback:
az_command_data_logger: The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.azclierror: 'metadata'
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/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/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job
    return cmd_copy.exception_handler(ex)
  File "/Users/avneeshkumar/.azure/cliextensions/containerapp/azext_containerapp/_client_factory.py", line 28, in _polish_bad_errors
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 705, in _run_job
    result = transform_op(result)
  File "/Users/avneeshkumar/.azure/cliextensions/containerapp/azext_containerapp/_transformers.py", line 32, in transform_sensitive_values
    val["metadata"] = dict((k, "") for k, v in val["metadata"].items())
KeyError: 'metadata'
az_command_data_logger: 'metadata'
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/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/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 718, in _run_job
    return cmd_copy.exception_handler(ex)
  File "/Users/avneeshkumar/.azure/cliextensions/containerapp/azext_containerapp/_client_factory.py", line 28, in _polish_bad_errors
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 705, in _run_job
    result = transform_op(result)
  File "/Users/avneeshkumar/.azure/cliextensions/containerapp/azext_containerapp/_transformers.py", line 32, in transform_sensitive_values
    val["metadata"] = dict((k, "") for k, v in val["metadata"].items())
KeyError: 'metadata'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x10598f0a0>]
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 37.012 seconds (init: 0.097, invoke: 36.915)
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 7341 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.53.1/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.53.1/libexec/lib/python3.10/site-packages/azure/cli/telemetry/__init__.py /Users/avneeshkumar/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

Expected behavior

It give result like


  "id": "/subscriptions/***/resourceGroups/rg-mm-apps-uat/providers/Microsoft.App/containerapps/ca-sync-shopify-uat",
  "identity": ***
    "type": "UserAssigned",
    "userAssignedIdentities": ***
      "/subscriptions/***/resourcegroups/portal-prod-apps/providers/Microsoft.ManagedIdentity/userAssignedIdentities/AzureAppConfigAccessProd": ***
        "clientId": "8ade79f4-a7c6-4821-bfbe-7d288ffa666f",
        "principalId": "4213a4c0-5d54-428f-909f-277e9be35850"
      ***
    ***
  ***,
  "location": "West US",
  "name": "ca-sync-shopify-uat",
  "properties": ***
    "configuration": ***
      "activeRevisionsMode": "Single",
      "dapr": null,
      "ingress": null,
      "maxInactiveRevisions": null,
      "registries": [
        ***
          "identity": "",
          "passwordSecretRef": "reg-pwd",
          "server": "***",
          "username": "***"
        ***
      ],
      "secrets": [
        ***
          "name": "reg-pwd"
        ***
      ],
      "service": null
    ***,
    "customDomainVerificationId": "34BF7B5E6632FA59AEBD81F721D43C35233454DFAEDA6B9ECF34F935284DE78F",
    "environmentId": "/subscriptions/***/resourceGroups/rg-mm-apps-uat/providers/Microsoft.App/managedEnvironments/cae-mm-container-apps-uat",
    "eventStreamEndpoint": "https://westus.azurecontainerapps.dev/subscriptions/***/resourceGroups/rg-mm-apps-uat/containerApps/name-of-container-appt/eventstream",
    "latestReadyRevisionName": "ca-sync-shopify-uat--tftph12",
    "latestRevisionFqdn": "",
    "latestRevisionName": "latest-revision-name",
    "managedEnvironmentId": "/subscriptions/***/resourceGroups/rg-mm-apps-uat/providers/Microsoft.App/managedEnvironments/cae-mm-container-apps-uat",
    "outboundIpAddresses": [
      "20.245.102.6"
    ],
    "provisioningState": "Succeeded",
    "runningStatus": "Running",
    "template": ***
      "containers": [
        ***
          "env": [
            
          ],
          "image": "***/<imagename>t:3aa30908f2fd655b2a71cc03889ab9470aa86f0a",
          "name": "container-app-name",
          "resources": ***
            "cpu": 0.5,
            "ephemeralStorage": "2Gi",
            "memory": "1Gi"
          ***
        ***
      ],
      "initContainers": null,
      "revisionSuffix": "",
      "scale": ***
        "maxReplicas": 1,
        "minReplicas": 0,
        "rules": [
          ***
            "custom": ***
              "metadata": ***
                "activationValue": "",
                "credentialsFromEnv": "",
                "mode": "",
                "subscriptionName": "",
                "value": ""
              ***,
              "type": "gcp-pubsub"
            ***,
            "name": "gcp-pubsub-based-scaler"
          ***
        ]
      ***,
      "serviceBinds": null,
      "terminationGracePeriodSeconds": null,
      "volumes": null
    ***,
    "workloadProfileName": null
  ***,
  "resourceGroup": "rg-mm-apps-uat",
  "systemData": ***
    "createdAt": "2023-07-24T06:20:11.5369824",
    "createdBy": "",
    "createdByType": "User",
    "lastModifiedAt": "2023-10-26T06:35:27.6662754",
    "lastModifiedBy": "***",
    "lastModifiedByType": "Application"
  ***,
  "tags": ***
    "createdBy": "pulumi-infra",
    "environment": "uat"
  ***,
  "type": "Microsoft.App/containerApps"
***

az script ran successfully.

Environment Summary

azure-cli                         2.53.1

core                              2.53.1
telemetry                          1.1.0

Extensions:
containerapp                      0.3.42

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

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botAuto-ResolveAuto resolve by botContainerAppPossible-SolutionService AttentionThis issue is responsible by Azure service team.Similar-Issueact-observability-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions