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.

AzureBlobFileSystem returns UnicodeError: Label too long

See original GitHub issue

When instantiating an AzureBlobFileSystem only with account, container and sas_token. I receive an codec error when trying to basically run ls in the container.

What happened:

Traceback (most recent call last):
  File "C:\Users\bbk63\Anaconda3\lib\encodings\idna.py", line 167, in encode
    raise UnicodeError("label too long")
UnicodeError: label too long
...
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label too long)

What you expected to happen: Returns a list of path inside the container

Minimal Complete Verifiable Example:

abfs = AzureBlobFileSystem(account_name=ACCOUNT_NAME, sas_token=sas_token, container_name=CONTAINER_NAME)
abfs.ls('*')

Environment:

  • Dask version: 2021.2.0
  • Python version: 3.6
  • Operating System: Windows 10 Enterprise
  • Install method (conda, pip, source): pip

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10

github_iconTop GitHub Comments

1reaction
hayesgbcommented, Mar 16, 2021

Thanks.

adfs completes the URI by appending the sas token to the account url, which highlights a shortcoming in the approach.

Currently, the user passes ACCOUNT_NAME, and the token would be created as: https://{self.account_name}.blob.core.windows.net + sas_token

But it needs to conform to: https://{self.account_name}.blob.core.windows.net + "/" + {container_name} + "/" + {blob} + "?" + sas_token

The most straight solution would be to allow the end-user to create and pass the full URI (with SAS) and passed to it to adlfs, requiring account_name to be None.

Thoughts?

0reactions
hayesgbcommented, Mar 18, 2021

I’ve added a check for the leading “?” in the sas_token, as mentioned above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"encoding with 'idna' codec failed (UnicodeError: label too ...
Your issue was caused by your incorrect code block_blob_service = BlockBlobService(connection_string) . According to the constructor ...
Read more >
Failed to run az acr check-health after login failure against ML ...
Describe the bug Command Name az acr check-health Errors: encoding with 'idna' codec failed (UnicodeError: label empty or too long) ...
Read more >
Bug #1032863 “UnicodeError:"label empty or too long"
An internal server error has occurred. This most likely means that you have found a bug in SchoolTool. Please report it on the...
Read more >
encoding with 'idna' codec failed (UnicodeError: label empty or...
Bug 1279614 - UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long). Summary: UnicodeError: encoding with ...
Read more >
socket module calls with long host names can fail with idna ...
gethostbyname(hostonly) UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long) The error can be consistently ...
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