Azure-docs: Listing untagged manifests doesn't work in PowerShell or Git Bash

Created on 15 Feb 2019  Â·  9Comments  Â·  Source: MicrosoftDocs/azure-docs

I ran the command listed in https://docs.microsoft.com/en-us/azure/container-registry/container-registry-delete#list-untagged-images and I got this error back:
".digest] was unexpected at this time."
It works fine from a regular "cmd" prompt though.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

assigned-to-author container-registrsvc doc-bug triaged

Most helpful comment

I updated to 2.0.58 and still have the problem with the original query, but the null version does work for me.

All 9 comments

Thanks for the feedback! We are currently investigating and will update you shortly.

@dlepow I am seeing the same error when trying on Windows Powershell ISE but it works well in command prompt. Is this something you can shed some light on? Please let me know your thoughts on this. Thanks

@adinunzio84 @Karishma-Tiwari-MSFT - Thanks also for the feedback. I think this difference could be due to the way az acr repository show-manifests returns data in different CLI versions. I don't see different behavior by shell in my environment with a recent version of the CLI (v. 2.0.58). So, this command shows untagged image in the output with an empty tags array:

az acr repository show-manifests --name myregistry --repository myrepo
...
{
    "digest": "sha256:bbda.....",
    "tags": [],
    "timestamp": "2019-02-07T20:08:17.9237913Z"
},

And the JMESPath query in that example should correctly detect any empty array: --query "[?!(tags[?'*'])].digest"

However, in earlier versions such as CLI version 2.0.49 the tags value returned for an untagged image was null:

...
{
    "digest": "sha256:bbda.....",
    "tags": null,
    "timestamp": "2019-02-07T20:08:17.9237913Z"
},

and that same JMESPath query would cause the error you found. You'd need a different query like: --query "[?tags==null].digest" for that case.

Can you please let me know what version of the Azure CLI is running (run az -v) in your different shells? And if you update to the latest CLI, does the command work as written? Thanks!

@dlepow Thanks for helping out on this. :)

I was getting the error with the Azure-CLI version 2.0.49 for this command with JMESPath query:
az acr repository show-manifests --name myregistry --repository myrepo --query "[?!(tags[?'*'])].digest"

I updated my CLI version to latest (2.0.58) and I am getting the same error with the above command (--query "[?!(tags[?'*'])].digest) but works with the --query "[?tags==null].digest"

Should we include this information in the doc?

@Karishma-Tiwari-MSFT - That sounds like the right approach. Can you please assign to me and I will address in the documentation? Thanks!

I updated to 2.0.58 and still have the problem with the original query, but the null version does work for me.

Thanks @dlepow
@adinunzio84 Thanks for the feedback! I have assigned the issue to the content author to update the document as appropriate.

@adinunzio84 @Karishma-Tiwari-MSFT - The engineering team recommends this query for untagged manifests returned by az acr repository show-manifests: --query "[?tags[0]==null].digest". I have updated the article accordingly. This should now work in your various shell environment, but let us know if your experience is different. Thanks!

Thanks @dlepow
@adinunzio84 Thanks for bringing this to our attention. We will now close this issue. If there are further questions regarding this matter, please tag me in a comment. I will reopen it and we will gladly continue the discussion.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

monteledwards picture monteledwards  Â·  3Comments

JamesDLD picture JamesDLD  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments

Agazoth picture Agazoth  Â·  3Comments