Copying empty (zero-length) block blob with `syncCopyFromUrl` fails with `CannotVerifyCopySource` error
See original GitHub issue- Package Name: @azure/storage-blob
- Package Version: 12.0.1
- Operating system: linux
- nodejs
- version: 12.13.1
- browser
- name/version:
- typescript
- version: 3.6.4
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug
Copying an empty file (zero-length) from url to a block blob with syncCopyFromUrl
fails with CannotVerifyCopySource
error. The source file is also a block blob, at the same storage account and container.
To Reproduce Steps to reproduce the behavior:
- Try to copy an empty blob with syncCopyFromUrl
Expected behavior Empty blob is copied, with zero-length, just as a file with content is.
Screenshots
Additional context Code from library I’m writing, I hid away most of the set-up code.
const srcBlobClient = this.blockBlobClient(srcPath);
const destBlobClient = this.blockBlobClient(destPath);
const sourceUrl = await this.getSignedUrl(srcPath);
await destBlobClient.syncCopyFromURL(
sourceUrl.signedUrl,
),
Error code: CannotVerifyCopySource
Original stack:
Error: <?xml version="1.0" encoding="utf-8"?><Error><Code>CannotVerifyCopySource</Code><Message>The specified blob does not exist.
RequestId:55009a2d-e01e-005f-4d42-b4d1fd000000
Time:2019-12-16T18:53:59.5491128Z</Message></Error>
at new RestError (/home/krzysztofchrapka/dev/flydrive/node_modules/@azure/core-http/lib/restError.ts:23:5)
at /home/krzysztofchrapka/dev/flydrive/node_modules/@azure/core-http/lib/policies/deserializationPolicy.ts:168:27
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at AzureBlockBlobStorage.convertError (/home/krzysztofchrapka/dev/flydrive/src/Drivers/AzureBlockBlobStorage.ts:255:16)
at AzureBlockBlobStorage.copy (/home/krzysztofchrapka/dev/flydrive/src/Drivers/AzureBlockBlobStorage.ts:66:24)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Copy from ADLSGen2 to Blob storage fails in particular ...
Getting CannotVerifyCopySource error while trying to copy file from a storage account of type StorageV2 to Blob, We are using the same way ......
Read more >azure copy blobs across storage accounts fails with ErrorCode ...
When copying a blob across storage accounts, the source blob must be publicly accessible so that Azure Storage Service can access the source ......
Read more >Errors using azcopy and azure-cli to copy files ... - Mark Powney
My specific scenario is to deploy blobs to a Azure Storage Account Blob with the container name of $web. $web is the container...
Read more >Copy Blob — Zenko 1.2.1 documentation
The source for a Copy Blob operation can be a committed blob or Azure file in any Azure storage account. Request¶. A Copy...
Read more >Azure Blob errors with upgrade to 2022 - Inedo Forums
I searched "CannotVerifyCopySource", and a lot of SDK users (including tools like AzCopy) repot this issue when switching to the new SDK/API. I ......
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
@saralpa Please share the complete code. Make sure to omit any sensitive information.
https://gist.github.com/OJezu/6248584c52f9a2095576d24b3f4bed94 if the content is empty, then this will be empty => await sourceBlobClient.upload(content, content.byteLength);
if use syncCopyFromUrl and the blob is archived, then you get an error: ‘Copy source blob has been modified.’
if you use beginCopyFromUrl and the blob is archived, then you get an error: ‘This operation is not permitted on an archived blob.’
=> I think you cannot copy blobs that have access tier equal to ‘Archive’. You need to use the REST API
Any news?