question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`az acr repository delete` fails with exception

See original GitHub issue

Description

Outline the issue here:

I am executing ac acr repository delete and the command is failing with the following exception:

$ az acr repository delete -n myRegistry -u myUser -p myPass --repository myorg/myrepo

'NoneType' object has no attribute 'tier'
Traceback (most recent call last):
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/main.py", line 36, in main
    cmd_result = APPLICATION.execute(args)
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/core/application.py", line 212, in execute
    result = expanded_arg.func(params)
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 377, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 626, in _execute_command
    reraise(*sys.exc_info())
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 603, in _execute_command
    result = op(client, **kwargs) if client else op(**kwargs)
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/command_modules/acr/repository.py", line 281, in acr_repository_delete
    registry_name, resource_group_name, DELETE_NOT_SUPPORTED)
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/command_modules/acr/_utils.py", line 286, in managed_registry_validation
    if arm_resource.sku.tier == SkuTier.basic.value:
AttributeError: 'NoneType' object has no attribute 'tier'

NOTE that the SKU of the registry is “Classic” – it was created a while ago.


Environment summary

Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here: rpm on Fedora 26

CLI Version: What version of the CLI and modules are installed? (Use az --version)
Answer here:

az --version
azure-cli (2.0.17)

acr (2.0.11)
acs (2.0.15)
appservice (0.1.16)
batch (3.1.3)
billing (0.1.4)
cdn (0.0.8)
cloud (2.0.7)
cognitiveservices (0.1.7)
command-modules-nspkg (2.0.1)
component (2.0.7)
configure (2.0.10)
consumption (0.1.4)
container (0.1.10)
core (2.0.16)
cosmosdb (0.1.12)
dla (0.0.11)
dls (0.0.13)
eventgrid (0.1.3)
extension (0.0.2)
feedback (2.0.6)
find (0.2.6)
interactive (0.3.9)
iot (0.1.11)
keyvault (2.0.10)
lab (0.0.10)
monitor (0.0.9)
network (2.0.14)
nspkg (3.0.1)
profile (2.0.12)
rdbms (0.0.6)
redis (0.2.8)
resource (2.0.14)
role (2.0.11)
servicefabric (0.0.3)
sf (1.0.8)
sql (2.0.11)
storage (2.0.15)
vm (2.0.14)

Python location '/usr/lib64/az/bin/python'
Extensions directory '/home/raman/.azure/cliextensions'

Python (Linux) 2.7.13 (default, Sep  5 2017, 08:53:59) 
[GCC 7.1.1 20170622 (Red Hat 7.1.1-3)]

Legal docs and information: aka.ms/AzureCliLegal

OS Version: What OS and version are you using?
Answer here: Fedora 26

Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: fish (bash also doesn’t work)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
djyoucommented, Sep 21, 2017

@rocketraman Since you mentioned Classic, did you create the registry from Azure Portal? In this case ARM didn’t return the SKU properly. Do you mind sharing your registry name or login URI so we can investigate? My email is doyou@microsoft.com if you would like to send it privately. Thank you.

Also Classic/Basic registries don’t support deleting repositories or images, which is the exact intent of this check.

/cc @SajayAntony

0reactions
troydaicommented, Sep 22, 2017

@djyou since this is a solvable issue, I will assign this to the next milestone. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Delete image resources - Azure Container Registry
To delete by tag, use az acr repository delete and specify the image name in the --image parameter. All layers unique to the...
Read more >
Azure container registry repository or image delete giving ...
Error was coming due to passing repository name should be lower case. It won't allow upper or mixed case. Wrong Command: $ az...
Read more >
Fix list for IBM WebSphere Application Server V8.5
IBM WebSphere Application Server provides periodic fixes for the base and Network Deployment editions of release V8.5. The following is a complete listing ......
Read more >
Troubleshooting errors with Docker commands when using ...
You can also delete old images to make room for new ones. Use the docker images ... Client cannot connect to the remote...
Read more >
How to automate the building of SQL Snapshot images using ...
Microsoft provide a framework for building container images in Azure called ACR, which can be called using the Azure CLI: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found