az storage fails with TypeError: NoneType object is not iterable
See original GitHub issueDescribe the bug
Upload of a storage blob or listing of the storage account keys using the current version of the azure-cli
from https://packages.microsoft.com/yumrepos/azure-cli (Version 2.38.0) fails with a TypeError:
return ' '.join(['({}){}'.format(x[0], x[1:]) for x in allowed_values])
TypeError: 'NoneType' object is not iterable
Command Name
Issue arises in either of those commands:
az storage blob upload
az storage account keys list
Errors:
az storage blob upload
The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
Traceback (most recent call last):
File "/usr/lib64/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 561, in execute
self.commands_loader.load_arguments(command)
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 516, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/storage/__init__.py", line 31, in load_arguments
load_arguments(self, command)
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/storage/_params.py", line 684, in load_arguments
get_permission_help_string(t_account_permissions)),
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/storage/_validators.py", line 862, in get_permission_help_string
return ' '.join(['({}){}'.format(x[0], x[1:]) for x in allowed_values])
TypeError: 'NoneType' object is not iterable
$ az storage account keys list --resource-group {}--account-name {}
The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
Traceback (most recent call last):
File "/usr/lib64/az/lib/python3.6/site-packages/knack/cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 561, in execute
self.commands_loader.load_arguments(command)
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 516, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/storage/__init__.py", line 31, in load_arguments
load_arguments(self, command)
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/storage/_params.py", line 684, in load_arguments
get_permission_help_string(t_account_permissions)),
File "/usr/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules/storage/_validators.py", line 862, in get_permission_help_string
return ' '.join(['({}){}'.format(x[0], x[1:]) for x in allowed_values])
TypeError: 'NoneType' object is not iterable
To Reproduce:
az storage blob upload --max-connections 4 --container-name {} --account-name {} --type page --file {} --name {}
or
az storage account keys list --resource-group {}--account-name {}
Expected Behavior
- The corresponding command runs instead of the TypeError
Environment Summary
Linux-6.0.8-1-default-x86_64-with-glibc2.36, openSUSE Tumbleweed
Python 3.10.8
Installer: RPM
azure-cli 2.38.0 *
Additional Context
Issue Analytics
- State:
- Created 10 months ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
`az storage account list` TypeError: NoneType object is not ...
The command failed with an unexpected error. Here is the traceback: 'NoneType' object is not iterable Traceback (most recent call last): ...
Read more >How to Fix TypeError in Python: NoneType Object Is Not Iterable
The Python TypeError: NoneType Object Is Not Iterable error can be avoided by checking if a value is None or not before iterating...
Read more >az servicebus list gives NoneType error in python
I have realized that this error exist only when there are no servicebus in the account. Instead of giving value = [] cli...
Read more >AzureCLI@1 running az acr build. ERROR: 'NoneType' object ...
ERROR : 'NoneType' object is not callable ... We are running a couple of pipelines which use az acr build to build and...
Read more >I am getting failures when trying to download a blob from ...
and I am getting this error: The command failed with an unexpected error. Here is the traceback: 'BlobServiceClient' object has no attribute 'exists'...
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
Please ensure the storage dependency is correctly installed. This error occurs when no enum definition read from dependency SDK.
Here’s the official doc for installing cli together with all the dependencies: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli
Thank you! I leave this here for any other folk who find this issue. I switched in the meantime to my distribution-package, where this issue is not present.
Closing issue as it is not present anymore. Thanks everyone for the input and help! 🙂