Skip to content

az interactive cli gets stuck on the same error, after an error with the 'keys()' query function #27228

Description

@emielsteerneman

Describe the bug

When an error occurs where the keys function was used within the --query string, the cli becomes unusable, throwing the same error, no matter the command.

image

Related command

az resource list --query [0].NonExistingProperty
az resource list --query [0].keys(NonExistingProperty)
Error occurs here
az resource list --query [0].NonExistingProperty
Same error occurs, even though this command worked before
az resource list
Same error occurs, even though a --query flag is not even provided

Errors

Invalid jmespath query supplied for --query: In function keys(), invalid type for value: None, expected one of: ['object'], received: "null"

Issue script & Debug output

image

Expected behavior

The cli should be able to execute the third and fourth command without problem, not throwing the same error over and over.

Environment Summary

azure-cli                         2.49.0 *

core                              2.49.0 *
telemetry                          1.0.8 *

Extensions:
interactive                        0.5.1

Dependencies:
msal                              1.20.0
azure-mgmt-resource               22.0.0

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\e.steerneman\.azure\cliextensions'

Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:05:00) [MSC v.1929 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal


You have 3 update(s) available. Consider updating your CLI installation with 'az upgrade'

Additional context

No response

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions