Azure / azure-cli

Azure Command-Line Interface
MIT License
4.03k stars 3.01k forks source link

Issue running az storage blob list on CentOS and AmazonLinux2 VMs #23809

Open garrett-gkp opened 2 years ago

garrett-gkp commented 2 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

Hello, I am having issues connecting to my Azure storage blob but only from a few flavors of Linux - CentOS and Amazon Linux2. The issue popped up 2 weeks ago with no changes made on my side in the Azure portal or to the machines. I noticed the issue on an AWS instance but repro it in a CentOS VM on my local machine. Please let me know how I can address this issue, thank you.

Command Name az storage blob list

Errors:

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 1713, in load_arguments
    help_str = 'Allowed values: {}. Can be combined'.format(get_permission_help_string(t_share_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:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Expected Behavior

Environment Summary

Linux-5.10.135-122.509.amzn2.x86_64-x86_64-with-glibc2.2.5, Amazon Linux 2
Python 3.7.10
Installer: RPM

azure-cli 2.38.0 *

Additional Context

yonzhan commented 2 years ago

@evelyn-ys for awareness

evelyn-ys commented 2 years ago

The dependency azure-multiapi-storage package is not installed properly. So that we get None for enum definition from SDK.

Please make sure you have installed CLI successfully following https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=script

The Azure CLI 2.38.0 you used may not from official CLI. @jiasli for awareness

ghost commented 2 years ago

Thank you for your feedback. This has been routed to the support team for assistance.

garrett-gkp commented 2 years ago

Oh, I installed using yum and the instructions on that website. Is there a way for me to upgrade the azure-multiapi-storage package you mentioned?

Note that my Azure connection failed after a few months of no issues and no changes from my side, so I suspect something changed on the Azure side. Is there any sense of an ETA for a fix?

garrett-gkp commented 2 years ago

Any ideas what might be going on here? @yonzhan @evelyn-ys @jiasli ?

evelyn-ys commented 2 years ago

Do you mean that this issue still exist after installing Azure CLI following https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=script?

garrett-gkp commented 2 years ago

Correct. I followed that page before filing this ticket.

garrett-gkp commented 2 years ago

Oh, I see what you meant. I used the generic install script with Curl and now I am able to list the file blobs. Any thoughts on how I can tell what is different between the two installations?

evelyn-ys commented 2 years ago

Any thoughts on how I can tell what is different between the two installations?

cc our packaging expert @jiasli

ferben commented 1 month ago

Hello, I have almost the same error on macOS (both processors M1 or Intel):

az storage blob download ...
ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: '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

Azure-CLI version, fresh install using hombrew:

% 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/developer/.azure/cliextensions'
Python (Darwin) 3.12.7 (main, Oct  1 2024, 02:05:46) [Clang 15.0.0 (clang-1500.3.9.4)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
calvinhzy commented 1 month ago

Hi @ferben please install setuptools, similar issue to https://github.com/Azure/azure-cli/issues/30127