Getting lock for specified resource with az lock show --resource xxx fails with exception
See original GitHub issueThis is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az lock show
Errors:
The command failed with an unexpected error. Here is the traceback:
No value for given attribute
Traceback (most recent call last):
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 663, in execute
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 363, in handler
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/arm.py", line 429, in show_exception_handler
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 361, in handler
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/custom.py", line 3125, in get_lock
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/core/tracing/decorator.py", line 73, in wrapper_use_tracer
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/mgmt/resource/locks/v2016_09_01/operations/_operations.py", line 1355, in get_at_resource_level
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/mgmt/resource/locks/v2016_09_01/operations/_operations.py", line 381, in build_management_locks_get_at_resource_level_request
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 652, in url
File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\msrest/serialization.py", line 760, in serialize_data
ValueError: No value for given attribute
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Put any pre-requisite steps here…
az lock show --resource {}
Expected Behavior
Environment Summary
Windows-10-10.0.22621-SP0
Python 3.10.5
Installer: MSI
azure-cli 2.40.0
Extensions:
quota 0.1.0
Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1
Additional Context
Issue Analytics
- State:
- Created a year ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Azure Service Bus - messaging exceptions
The MessageLockLostException is thrown when a message is received using the PeekLock Receive mode and the lock held by the client expires on...
Read more >Transaction (Process ID xxx) was deadlocked on lock ...
error message: Transaction (Process ID 237) was deadlocked on lock resources with another process and has been chosen as the deadlock victim.
Read more >Azure Java SDK - Can't add resource locks
According to the error message, you do not have enough permissions to create resource locks. In fact, to create or delete management locks, ......
Read more >Safari Technology Preview Release Notes
Fixed an issue where browser.tabs sometimes returned an incorrect URL for pinned tabs. Bug Fixes. Fixed the Share Menu when sharing an image...
Read more >Error Messages
NOTE: when a command is locked, this does not automatically imply that subcommands ... breakpoint resource on the debug hardware, e.g. if the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Fireblade954 This problem is actually caused by a mistake in usage. Please distinguish the
--resource
parameter from--name
parameterAs we can see in the help message, the
--resource
parameter needs to pass in the ID of the resource being locked, while the--name
parameter needs to pass in the lock name. Therefore, the--resource
parameter should NOT be passed in the lock ID. The correct usage should be:az lock show --resource {locked_resouce_id} --name {lock_name}
@Fireblade954 The action is currently pending on you to try the action plan mentioned above. Please feel free to reopen this thread if you need any further assistance on this in future. We would be happy to help.