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

When retrieving blobs: DeserializationError: Unable to deserialize to object: type, KeyError: 'name' #247

Closed
tappoz opened this issue Jan 20, 2021 · 2 comments

Comments

@tappoz
Copy link

tappoz commented Jan 20, 2021

Which version of the SDK was used?

$ pip show azure-storage-blob
Name: azure-storage-blob
Version: 12.7.0
...

Which platform are you using? (ex: Windows, Linux, Debian)

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:        20.04
Codename:       focal

What problem was encountered?

I am not able to retrieve blobs because an exception is being thrown by the library: DeserializationError: Unable to deserialize to object: type, KeyError: 'name'

How can we reproduce the problem in the simplest way?

Take a container with some files in it, then with ipython do:

In [1]: from azure.storage.blob import BlobServiceClient, BlobClient                                                                                       

In [2]: ASA_CONNECTION_STRING = "DefaultEndpointsProtocol=https;BlobEndpoint=https://<<SOMETHING>>.blob.core.windows.net/;AccountName=<<SOMETHING>>;AccountKey=<<SOMETHING_ELSE>>"                                              

In [3]: ASA_CONTAINER_NAME = "<<SOME_NAME>>"                                                                                            

In [4]: blob = BlobServiceClient.from_connection_string(ASA_CONNECTION_STRING)                                                                             

In [5]: container = blob.get_container_client(ASA_CONTAINER_NAME)                                                                                          

In [6]: stuff = container.list_blobs()

In [7]: thing = stuff.next()

Then you'll see: DeserializationError: Unable to deserialize to object: type, KeyError: 'name'.
It seems to be coming from the package msrest which I am assuming is a dependency for this package.

Have you found a mitigation/solution?

No - I am trying to find alternatives to filter blobs from a blob storage or containers, but so far no luck.

@tappoz
Copy link
Author

tappoz commented Jan 20, 2021

For some reason if I uninstall all the pip packages containing the string "azure" with this:

for i in `pip list | awk '/azure/ {print $1}'`; do pip uninstall -y $i ; done

Then I remove this msrest package (version msrest-0.6.10) with:

pip uninstall msrest

Then I install again this package azure-storage-blob:

pip install azure-storage-blob --upgrade

Then the code snippet above to retrieve a blob works.

The interesting fact is that this msrest is re-installed with the version msrest-0.6.19.
There must be something wrong with msrest-0.6.10 that is not captured by the requirements for azure-storage-blob.

@tappoz
Copy link
Author

tappoz commented Jan 20, 2021

Apologies for mixing Go with Python. I am closing this issue, but opened it in the relevant Python repository for the SDK: Azure/azure-sdk-for-python#16250

@tappoz tappoz closed this as completed Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant