Azure / azure-cli

Azure Command-Line Interface
MIT License
3.96k stars 2.94k forks source link

Inconsistent behaviour when listing Gen2 filesystems #16142

Open pablobi00 opened 3 years ago

pablobi00 commented 3 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

I can list the content of another FS with the same properties in this storage account, there is another one that always fails.

Command Name az storage fs file list

Errors:

'dict' object has no attribute 'iter'
Traceback (most recent call last):
storagev2/filedatalake/v2020_02_10/_list_paths_helper.py, ln 50, in _get_next_cb
    return self._command(
v2020_02_10/_generated/operations/_file_system_operations.py, ln 442, in list_paths
    raise models.StorageErrorException(response, self._deserialize)
azure.multiapi.storagev2.filedatalake.v2020_02_10._generated.models._models_py3.StorageErrorException: (AuthorizationPermissionMismatch) This request is not authorized to perform this operation using this permission.
RequestId:4223f5fa-801f-001b-0fca-c9cfb9000000
Time:2020-12-03T23:20:11.1879656Z

...

filedatalake/v2020_02_10/_shared/response_handlers.py, ln 94, in process_storage_error
    for info in error_body.iter():
AttributeError: 'dict' object has no attribute 'iter'

To Reproduce:

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

Expected Behavior

Environment Summary

macOS-11.0.1-x86_64-i386-64bit
Python 3.8.6
Installer: HOMEBREW

azure-cli 2.15.1

Additional Context

yonzhan commented 3 years ago

storage

Juliehzl commented 3 years ago

dupe of #16217

Juliehzl commented 3 years ago

Hi @pablobi00, could you add --debug in your command and share the debug info with us?

Juliehzl commented 3 years ago

According to info you share, are you using --auth-mode login in your command? If you want to use AAD credential, you need to assign RBAC roles like Storage Blob Data Contributor to your account. If you don't want to use AAD credential, please use --account-key or --connection-string as your credential.

Juliehzl commented 3 years ago

@xiafu-msft please pay attention to process_storage_error method. AttributeError should be avoid in your code and just raise error message to customer. The actual error (AuthorizationPermissionMismatch) This request is not authorized to perform this operation using this permission. is overridden by SDK code issue with AttributeError.

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

Issue Details
### **This is autogenerated. Please review and update as needed.** ## Describe the bug I can list the content of another FS with the same properties in this storage account, there is another one that always fails. ------------------------------------------------------------------------------------------------------- **Command Name** `az storage fs file list` **Errors:** ``` 'dict' object has no attribute 'iter' Traceback (most recent call last): storagev2/filedatalake/v2020_02_10/_list_paths_helper.py, ln 50, in _get_next_cb return self._command( v2020_02_10/_generated/operations/_file_system_operations.py, ln 442, in list_paths raise models.StorageErrorException(response, self._deserialize) azure.multiapi.storagev2.filedatalake.v2020_02_10._generated.models._models_py3.StorageErrorException: (AuthorizationPermissionMismatch) This request is not authorized to perform this operation using this permission. RequestId:4223f5fa-801f-001b-0fca-c9cfb9000000 Time:2020-12-03T23:20:11.1879656Z ... filedatalake/v2020_02_10/_shared/response_handlers.py, ln 94, in process_storage_error for info in error_body.iter(): AttributeError: 'dict' object has no attribute 'iter' ``` ## 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 storage fs file list -f {} --account-name {} --auth-mode {}` ## Expected Behavior ## Environment Summary ``` macOS-11.0.1-x86_64-i386-64bit Python 3.8.6 Installer: HOMEBREW azure-cli 2.15.1 ``` ## Additional Context
Author: pablobi00
Assignees: Juliehzl
Labels: `OKR3.2 Candidate`, `Service Attention`, `Storage`, `feature-request`
Milestone: S185