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 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

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:

  1. 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:closed
  • Created 4 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gmantricommented, Jun 18, 2020

@saralpa Please share the complete code. Make sure to omit any sensitive information.

0reactions
andresreibelcommented, Oct 22, 2021
  1. https://gist.github.com/OJezu/6248584c52f9a2095576d24b3f4bed94 if the content is empty, then this will be empty => await sourceBlobClient.upload(content, content.byteLength);

  2. if use syncCopyFromUrl and the blob is archived, then you get an error: ‘Copy source blob has been modified.’

  3. 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?

Read more comments on GitHub >

github_iconTop 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 >

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