Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack Trace for az storage account create #30127

Open
psenger opened this issue Oct 18, 2024 · 17 comments
Open

Stack Trace for az storage account create #30127

psenger opened this issue Oct 18, 2024 · 17 comments
Assignees
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Similar-Issue Storage az storage
Milestone

Comments

@psenger
Copy link

psenger commented Oct 18, 2024

Describe the bug

Unable to create a simple Blob Storage in my Subscription when Im the owner / tenant
azure-cli 2.65.0

Image

Related command

az storage account create --resource-group terraform-state-rg --name tfstate-MindMap-8192c793 --sku Standard_LRS --encryption-services blob

Errors

The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 564, in execute
self.commands_loader.load_arguments(command)
File "/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/lib/python3.12/site-packages/azure/cli/core/init.py", line 527, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/lib/python3.12/site-packages/azure/cli/command_modules/storage/init.py", line 42, in load_arguments
load_arguments(self, command)
File "/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/lib/python3.12/site-packages/azure/cli/command_modules/storage/_params.py", line 758, in load_arguments
get_permission_help_string(t_account_permissions)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/lib/python3.12/site-packages/azure/cli/command_modules/storage/_validators.py", line 871, in get_permission_help_string
return ' '.join(['({}){}'.format(x[0], x[1:]) for x in allowed_values])
^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable

Issue script & Debug output

(azure-cli-env) psenger@Philips-MacBook-Pro ~ % az storage account create --resource-group terraform-state-rg --name tfstate-MindMap-8192c793 --sku Standard_LRS --encryption-services blob
The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 564, in execute
self.commands_loader.load_arguments(command)
File "/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/lib/python3.12/site-packages/azure/cli/core/init.py", line 527, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/lib/python3.12/site-packages/azure/cli/command_modules/storage/init.py", line 42, in load_arguments
load_arguments(self, command)
File "/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/lib/python3.12/site-packages/azure/cli/command_modules/storage/_params.py", line 758, in load_arguments
get_permission_help_string(t_account_permissions)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/lib/python3.12/site-packages/azure/cli/command_modules/storage/_validators.py", line 871, in get_permission_help_string
return ' '.join(['({}){}'.format(x[0], x[1:]) for x in allowed_values])
^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
(azure-cli-env) psenger@Philips-MacBook-Pro ~ %

Expected behavior

a blob created

Environment Summary

azure-cli 2.65.0

core 2.65.0
telemetry 1.1.0

Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.65.0/libexec/bin/python'
Extensions directory '/Users/psenger/.azure/cliextensions'

Python (Darwin) 3.12.7 (main, Oct 1 2024, 02:05:46) [Clang 16.0.0 (clang-1600.0.26.3)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

Im on a mac...

@psenger psenger added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 18, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Oct 18, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Oct 18, 2024

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 18, 2024
@psenger
Copy link
Author

psenger commented Oct 18, 2024

this looks the same as #23990

@psenger
Copy link
Author

psenger commented Oct 18, 2024

By the way Im in the Azure Shell in Azure, and I keep getting this error:

(SubscriptionNotFound) Subscription xxxxxxxxxxxxxxxx was not found.
Code: SubscriptionNotFound
Message: Subscription xxxxxxxxxxxxxxxx was not found.

same thing.. very strange.

@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Oct 18, 2024
@yonzhan yonzhan added this to the Backlog milestone Oct 18, 2024
@Oli1071
Copy link

Oli1071 commented Oct 19, 2024

I encounter the same error when running:
az storage entity query --table-name your_table_name --account-name your_storage_account --auth-mode login --query "items"
Installed:
azure-cli 2.65.0

core 2.65.0
telemetry 1.1.0

Extensions:
account 0.2.5

Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

However, on my MacBook, where I am still using azure-cli 2.62.0, I do not encounter any errors when running the same command.

@x97-epe
Copy link

x97-epe commented Oct 20, 2024

I have updated azure-cli to 2.65.0 on my MacBook running Sequoia and a script I have used for while started failing with same error reported here. Many command related to "storage account" seems to fail, no even the "help" can be used. Example:

% az storage account create --help
The command failed with an unexpected error. Here is the traceback:
'NoneType' object is not iterable
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.65.0_1/libexec/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.65.0_1/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 564, in execute
self.commands_loader.load_arguments(command)
File "/opt/homebrew/Cellar/azure-cli/2.65.0_1/libexec/lib/python3.12/site-packages/azure/cli/core/init.py", line 527, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.65.0_1/libexec/lib/python3.12/site-packages/azure/cli/command_modules/storage/init.py", line 42, in load_arguments
load_arguments(self, command)
File "/opt/homebrew/Cellar/azure-cli/2.65.0_1/libexec/lib/python3.12/site-packages/azure/cli/command_modules/storage/_params.py", line 758, in load_arguments
get_permission_help_string(t_account_permissions)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.65.0_1/libexec/lib/python3.12/site-packages/azure/cli/command_modules/storage/_validators.py", line 871, in get_permission_help_string
return ' '.join(['({}){}'.format(x[0], x[1:]) for x in allowed_values])
^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

About Azure-cli:

% az --version
azure-cli 2.65.0

core 2.65.0
telemetry 1.1.0

Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.65.0_1/libexec/bin/python'
Extensions directory '/Users/XXXXXX/.azure/cliextensions'

Python (Darwin) 3.12.7 (main, Oct 1 2024, 02:05:46) [Clang 16.0.0 (clang-1600.0.26.3)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Thanks!

@calvinhzy
Copy link
Member

Can you run pip show azure-multiapi-storage and see if the package is properly installed? Might need to reinstall using brew update && brew install azure-cli
Image

@psenger
Copy link
Author

psenger commented Oct 21, 2024

@calvinhzy Ive actually uninstalled Azure CI, verified it was uninstalled, and reinstalled it, I cant execute pip show azure-multiapi-storage

By the way, I got the same error with the In-Browser Azure Command. If it doesn't work there, I doubt it works anywhere.

@calvinhzy
Copy link
Member

calvinhzy commented Oct 21, 2024

Can you try the suggestion in #29904 (comment) to install setuptools, will fix the sdk azure-multiapi-storage-python to remove dependency with setuptools

@rjollos
Copy link

rjollos commented Oct 21, 2024

Installing setuptools fixes the problem for me on macOS with Azure CLI installed by Homebrew.

$ /opt/homebrew/Cellar/azure-cli/2.65.0_1/libexec/bin/pip install setuptools
Collecting setuptools
  Downloading setuptools-75.2.0-py3-none-any.whl.metadata (6.9 kB)
Downloading setuptools-75.2.0-py3-none-any.whl (1.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 18.9 MB/s eta 0:00:00
Installing collected packages: setuptools
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
azure-cli 2.65.0 requires pycomposefile>=0.0.29, but you have pycomposefile 0.0.1a1 which is incompatible.

@calvinhzy
Copy link
Member

#30138 (comment)
seems like for some reason even if setuptools is put as required in CLI dependencies, homebrew 3.12 does not install it

@x97-epe
Copy link

x97-epe commented Oct 21, 2024

@rjollos Thanks, you suggestion worked for me.

I have other homebrew:
% brew -v
Homebrew 4.4.2

And it took me some extra effort (and brew doctor feedback) to get "setuptools" installed, but once done (still with errors) "azure-cli storage account" works.

@jaromirmikulik
Copy link

From my perspective, it could be caused by: #30148

@ferben
Copy link

ferben commented Oct 21, 2024

Installing setuptools fixes the problem for me on macOS with Azure CLI installed by Homebrew.

$ /opt/homebrew/Cellar/azure-cli/2.65.0_1/libexec/bin/pip install setuptools
Collecting setuptools
  Downloading setuptools-75.2.0-py3-none-any.whl.metadata (6.9 kB)
Downloading setuptools-75.2.0-py3-none-any.whl (1.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 18.9 MB/s eta 0:00:00
Installing collected packages: setuptools
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
azure-cli 2.65.0 requires pycomposefile>=0.0.29, but you have pycomposefile 0.0.1a1 which is incompatible.

This help, regardless of it install setuptools with error.

@allullk
Copy link

allullk commented Oct 21, 2024

@psenger I just used:

az provider register --namespace Microsoft.Storage

Worked for me 😊

Credits:
@kenorb
#29215

@rogerkeizer
Copy link

rogerkeizer commented Oct 22, 2024

I ran in this problem as well and had the luxury of a Macbook with hardly any data on it. So I could try out a few suggestions mentioned here.

This is what I did to finally solve my issue:

  • Clean install Sonoma 14.4 (System Settings / General / Transfer or Reset)
  • No installation of Xcode developer tools (you need them if you want to do python3 --version)
  • Upgrade to Python 3.12.7 (Python 3.12.7) using the macOS 64-bit universal2 installer
  • Install Certificates.command
  • python3 --version -> 3.12.7
  • Install Homebrew Homebrew.pkg 4.4.2
    • pre-requisite Command Line Tools (CLT): xcode-select --install -> follow instructions on screen
    • eval "$(/opt/homebrew/bin/brew shellenv)"
  • brew update && brew install azure-cli
  • az login
  • az storage account list returns my storage accounts and not the 'NoneType' object is not iterable error anymore

az --version returns

azure-cli                         2.65.0

core                              2.65.0
telemetry                          1.1.0

Dependencies:
msal                              1.31.0
azure-mgmt-resource               23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.65.0_2/libexec/bin/python'
Extensions directory '/Users/roger/.azure/cliextensions'

Python (Darwin) 3.11.10 (main, Sep  7 2024, 01:03:31) [Clang 15.0.0 (clang-1500.3.9.4)]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

@Oli1071
Copy link

Oli1071 commented Oct 22, 2024

It seems an update fixed it. I run brew update and brew upgrade, what updates azure-cli. Now my storage account comments work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Similar-Issue Storage az storage
Projects
None yet
Development

No branches or pull requests