question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: '_SharedAccessHelper' object has no attribute 'add_resource_signature'

See original GitHub issue

Which service(blob, file, queue) does this issue concern?

blob

Which version of the SDK was used? Please provide the output of pip freeze.

2.0.0

What problem was encountered?

This code doesn’t work anymore in 2.0.0:

        # create a template sas token for the container
        service = BlockBlobService(account_name=storage_account_name,
                                   # don't sign the template with the storage account key use key 00000000
                                   account_key='00000000')
        permissions = ContainerPermissions(read=True, write=True, delete=True, list=True)
        temp_token = service.generate_container_shared_access_signature(container_name='blobcontainer',
                                                                        permission=permissions,
                                                                        expiry='2020-01-01')

Stack trace (enhanced by pytest):

self = <azure.storage.blob.sharedaccesssignature.BlobSharedAccessSignature object at 0x7fd42a8182b0>
container_name = 'blobcontainer'
permission = <azure.storage.blob.models.ContainerPermissions object at 0x7fd42a80c0f0>
expiry = '2020-01-01', start = None, id = None, ip = None, protocol = None
cache_control = None, content_disposition = None, content_encoding = None
content_language = None, content_type = None

    def generate_container(self, container_name, permission=None, expiry=None,
                           start=None, id=None, ip=None, protocol=None,
                           cache_control=None, content_disposition=None,
                           content_encoding=None, content_language=None,
                           content_type=None):

        sas = _SharedAccessHelper()
        sas.add_base(permission, expiry, start, ip, protocol, self.x_ms_version)
        sas.add_id(id)
        sas.add_resource('c')
        sas.add_override_response_headers(cache_control, content_disposition,
                                          content_encoding, content_language,
                                          content_type)
>       sas.add_resource_signature(self.account_name, self.account_key, 'blob', container_name)
E       AttributeError: '_SharedAccessHelper' object has no attribute 'add_resource_signature'

Have you found a mitigation/solution?

No

Note: for table service, please post the issue here instead: https://github.com/Azure/azure-cosmosdb-python.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
zezha-msftcommented, May 9, 2019

@lmazuel should be fixed now. Could you please re-trigger your CI to verify?

0reactions
lmazuelcommented, May 10, 2019

No problem 😃. Indeed it works with 1.4.2. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: '' object has no attribute '' - python - Stack Overflow
Your NewsFeed class instance n doesn't have a Canvas attribute. If you want to pass the Canvas defined in your Achtergrond class instance ......
Read more >
AttributeError: 'MultivariateSample' object has no attribute 'train'
While running the python code that is available in the linkclient-libraries-multivariate , i got the below error in "Run the Application" area.
Read more >
AttributeError: 'NoneType' object has no attribute 'call' on ...
Hello, I'm at a loss to explain why this flow fails and succeeds at the same time… It only consists in triggering a...
Read more >
AttributeError: 'NoneType' object has no attribute 'get_items'
Hello everyone, We have imported one job (Local Resolution Estimation) from an old project and an old instance onto a newly installed, ...
Read more >
Python AttributeError — What is it and how do you fix it?
AttributeError : '***' object has no attribute '***'What is an AttributeError in Python? What can you do to fix it? When does it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found