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.

Copying between storage accounts within same instance fails

See original GitHub issue

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

Blob

Which version of the Azurite was used?

3.20.1

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

DockerHub

What’s the Node.js version?

N/A

What problem was encountered?

When copying files between storage accounts within the same Azurite instance, I get an error that:

The specified blob does not exist.
RequestId:9078173b-3037-4c64-b03f-a499c852c918
Time:2022-10-26T13:59:49.995Z
Status: 404 (The specified blob does not exist.)
ErrorCode: BlobNotFound

Content:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Error>
  <Code>BlobNotFound</Code>
  <Message>The specified blob does not exist.
RequestId:9078173b-3037-4c64-b03f-a499c852c918
Time:2022-10-26T13:59:49.995Z</Message>
</Error>

Headers:
Server: Azurite-Blob/3.20.1
x-ms-error-code: BlobNotFound
x-ms-request-id: 9078173b-3037-4c64-b03f-a499c852c918
Date: Wed, 26 Oct 2022 13:59:49 GMT
Connection: keep-alive
Keep-Alive: REDACTED
Transfer-Encoding: chunked
Content-Type: application/xml

I expect this to work, since the support matrix specifies that Copy Blob From URL works within the same Azurite instance.

Steps to reproduce the issue?

First, start Azurite with multiple storage accounts, like:

docker run -p 10000:10000 -v c:/azurite:/workspace -e "AZURITE_ACCOUNTS=devstoreaccount1:Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;devstoreaccount2:Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" mcr.microsoft.com/azure-storage/azurite azurite-blob -d /workspace/debug.log --blobHost 0.0.0.0

Then, create a container in each storage account, upload a non-empty file to one of them, then start a copy to the other one:

var sourceBlobServiceClient = new BlobServiceClient("DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;");
var sourceContainer = sourceBlobServiceClient.GetBlobContainerClient("test");
await sourceContainer.CreateAsync();
var sourceBlob = sourceContainer.GetBlobClient("test.txt");
await sourceBlob.UploadAsync(BinaryData.FromString("Lorem ipsum dolor sit amet..."));

var sourceBlobSasUri = sourceBlob.GenerateSasUri(BlobSasPermissions.All, DateTimeOffset.UtcNow.AddDays(1));

var destinationBlobServiceClient = new BlobServiceClient("DefaultEndpointsProtocol=http;AccountName=devstoreaccount2;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount2;");
var destinationContainer = destinationBlobServiceClient.GetBlobContainerClient("test");
await destinationContainer.CreateAsync();
var destinationBlob = destinationContainer.GetBlobClient("test.txt");
await destinationBlob.SyncCopyFromUriAsync(sourceBlobSasUri);

See debug.log.

Have you found a mitigation/solution?

No, other than avoiding the use of the copy function and instead downloading an uploading files.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bluewwcommented, Nov 7, 2022

@kimsey0

We already have other issues to track Put Blob From Uri like https://github.com/Azure/Azurite/issues/852 So we can close this issue when the PR #1742 is merged. And use other issue to track Put Blob from Uri.

1reaction
bluewwcommented, Nov 3, 2022

@kimsey0

Look at the first log file, and I believe https://github.com/Azure/Azurite/pull/1742 can fix the 404 error of “Operation=Blob_CopyFromURL” in this log.

For “Put Blob From URL”, we currently is working on other high priority features, will consider it in the future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Guidance for copy blobs between storage accounts with ...
To copy blobs between storage accounts directly, we can use AZCOPY following the below syntax.
Read more >
Copy file from one Azure storage account to another
i recently ran into this error trying to copy from /uploads to /raw within a single blob account. The issue was that the...
Read more >
Introducing Asynchronous Cross-Account Copy Blob
Of course, Copy Blob operations within the same account will continue to work ... in Windows Azure Storage: Windows Azure Virtual Machine Disks...
Read more >
How to copy files between Azure subscription from Windows ...
Here an example to upload a single file into an Azure Blob Storage. az storage blob upload --file /home/frank/demo/CloudIsStrong.jpg \ --account-name ...
Read more >
How to use AzCopy to move data with Storage Accounts in ...
Comments • 7 ; How to Synchronize changes between Azure Storage Accounts using AZCOPY utility. asar cloud Chef · 691 views ; 10...
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