Skip to content

AMG: KeyError: 'meta' #8298

@WhiteTomX

Description

@WhiteTomX

Describe the bug

When I run az grafana dashboard import --resource-group "$(tf_grafana_resource_group_name)" --name "$(tf_grafana_instance_name)" --definition $file --overwrite an error occurs

Related command

az grafana dashboard import

Errors

ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: 'meta'
Traceback (most recent call last):
  File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
    raise ex
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 733, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 703, in _run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 336, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
           ^^^^^^^^^^^^^^^^^^
  File "/opt/az/azcliextensions/amg/azext_amg/custom.py", line 389, in import_dashboard
    if data["meta"]["isFolder"]:
       ~~~~^^^^^^^^
KeyError: 'meta'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

I can't provide a debug log right now, as it is run in a pipeline. Will try to reproduce locally and update later.

Expected behavior

The dashboard should be imported, as it is a vlid file and not a folder.

Environment Summary

azure-cli 2.66.0 *

core 2.66.0 *
telemetry 1.1.0

Extensions:
azure-devops 1.0.1

Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

Python location '/opt/az/bin/python3'
Extensions directory '/opt/az/azcliextensions'

Python (Linux) 3.12.7 (main, Oct 30 2024, 03:56:40) [GCC 11.4.0]

Additional context

I had a look into the files and the line in question was added in #8207. I will try to use the version 2.5.0 instead of newest version to verify. I can't easily reproduce that locally as it runs in a pipeline.

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botService AttentionThis issue is responsible by Azure service team.bugThis 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.extension/grafanaaz grafana

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions