[BUG] copyFromUrlWithResponse fails with 404 CannotVerifyCopySource if blob name contains %20
See original GitHub issueScanario
- 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:
- Get list of all Blobs from Blobstore A
- Create a BlockBlobClient with the name from the source blob (containerClient.getBlobClient(name)
- Add a SASToken to the BlobURL
- Trigger server side copy process to create Blob in Blobstore B with URL from source blob
Example:
- Get blob with name
my%20testfile.txt
- Create BlockBlobClient:
URL is e.g.https://xyz.blob.core.windows.net/container/my testfile.txt
(URL Encoding) - Add SAS Token
- 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
.
my%20testfile.txt
tomy%2020testfile.txt
- URL of BlockBlobClient:
https://xyz.blob.core.windows.net/container/my%20testfile.txt
- Copy successful
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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?
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.