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.

[BUG] copyFromUrlWithResponse fails with 404 CannotVerifyCopySource if blob name contains %20

See original GitHub issue

Scanario

  • Copying Container of Blobstore A to Container of Blobstore B.
  • A Blob exists with the name my%20testfile.txt. You see this name in the AzurePortal (Its not the URL Encoded name)

Application functionality:

  1. Get list of all Blobs from Blobstore A
  2. Create a BlockBlobClient with the name from the source blob (containerClient.getBlobClient(name)
  3. Add a SASToken to the BlobURL
  4. Trigger server side copy process to create Blob in Blobstore B with URL from source blob

Example:

  1. Get blob with name my%20testfile.txt
  2. Create BlockBlobClient:
    URL is e.g. https://xyz.blob.core.windows.net/container/my testfile.txt (URL Encoding)
  3. Add SAS Token
  4. Trigger server side copy: -> 404, because it tries to copy the file my testfile.txt

Error Exception: com.azure.storage.blob.models.BlobStorageException: Status code 404 Errorcode: CannotVerifyCopySource Message: The specified blob does not exist.

Reproduce

  • Create a blob with %20 in its name.
  • Create a BlockBlobClient with this name
  • Optional: Add a SAS Token if not public readable
  • Trigger Copy Process with: targeBlockBlobClient.copyFromUrlWithResponse(...)

Expected behavior Successful copy of the file

Workaround … for now is to replace the character % with %20.

  1. my%20testfile.txt to my%2020testfile.txt
  2. URL of BlockBlobClient: https://xyz.blob.core.windows.net/container/my%20testfile.txt
  3. Copy successful

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rickle-msftcommented, May 15, 2020

@daolis Thank you for reporting this.

@alzimmermsft I suspsect you are right about the connection. @gapra-msft Can you be sure to test this case for blobs while you’re working on files?

0reactions
rickle-msftcommented, Jun 23, 2020

I am going to close this issue as we have given a recommendation on how to appropriately resolve the problem and there has been no follow up.

Please feel free to reach back out to us if you need further support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure blob storage returns 404 with some files - Stack Overflow
404 error indicates that the specified blob does not exist, as Gaurav Mantri said, Blob name is case-sensitive, please make sure the filename...
Read more >
Azure Blob Storage error codes - Microsoft Learn
Error code HTTP status code User message BlobAlreadyExists Conflict (409) The specified blob already exists. BlobNotFound Not Found (404) The specified blob does not exist. ContainerAlreadyExists...
Read more >
umbraco 10 plus azure blob storage not showing files if file ...
After reviewing the log in the application Insights we see that it is trying to URL encode the filename twice and because of...
Read more >
[Azure Blob Storage] ERROR: "The specified resource name ...
Question Connector setup fails with the error: "The specified resource name contains invalid characters." Environment Azure...
Read more >
Error 404 on Download using ASP.NET MVC Azure File ...
I'm experiencing a 404 not found error using the ASP.NET MVC Azure File Provider when trying to download an file from the azure...
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