Azure / Azure/azure-cli

az backup container unregister - 'NoneType' object has no attribute 'name'

Open
#32,571 6 comments 1 reaction 2 assignees Assigned to @a0x1ab View on GitHub
act-observability-squad Auto-Assign bug customer-reported Recovery Services Backup Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

Running the "az backup container unregister" command in a PowerShell script results in an error with a non-existent path.

### Related command

`az backup container unregister`

### Errors

The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'name'
Traceback (most recent call last):
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 666, in execute
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_job
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/backup/_exception_handler.py", line 11, in backup_exception_handler
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 703, in _run_job
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 336, in __call__
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 120, in handler
File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/backup/custom_base.py", line 374, in unregister_container
AttributeError: 'NoneType' object has no attribute 'name'

### Issue script & Debug output

az backup container unregister --backup-management-type AzureIaasVM --container-name "MyFriendlyName" --resource-group "MyResourceGroup" --subscription "MySubscriptionID" --vault-name "MyVaultName" --yes

### Expected behavior

The container is unregistered

### Environment Summary

Windows-11-10.0.26200-SP0
Python 3.13.9
Installer: MSI

azure-cli 2.81.0

Extensions:
bastion 1.4.2
serviceconnector-passwordless 3.3.6
ssh 2.0.6

Dependencies:
msal 1.34.0b1
azure-mgmt-resource 23.3.0

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.