Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azurite doesn’t support error "CannotVerifyCopySource" in Copy Blob From URL operation on blob #634

Open
zzhxiaofeng opened this issue Nov 18, 2020 · 6 comments
Assignees
Labels
alignment Alignment between Azurite with Azure Storage production blob-storage bug Something isn't working NewArch Tracking issues for NewArch

Comments

@zzhxiaofeng
Copy link
Contributor

zzhxiaofeng commented Nov 18, 2020

Error Description:
In Azure, it will return error "CannotVerifyCopySource" when use Copy Blob From URL operation with invalid blob url.
But in Azurite, it copy blob successfully in this case.
Azure error is shown as following:
Screenshot 2020-11-19 145100

To Reproduce

import {
  BlobServiceClient
} from "@azure/storage-blob";
import * as assert from "assert"

async function main() {
  const blobServiceClient = await BlobServiceClient.fromConnectionString("Azurite-https-connectionString");
  const containerClient = await blobServiceClient.getContainerClient("<container-name>");
  const originBlobClient = await containerClient.getBlockBlobClient("<origin-blob-name>");
  const newBlobClient = await containerClient.getBlockBlobClient("<new-blob-name>");
  try{
    await newBlobClient.syncCopyFromURL(originBlobClient.url);
  }catch(err){
    console.log(err);
    assert.ok((err as any).response.parsedBody.Code === "CannotVerifyCopySource");
  }
}

main();

Error Track
The reason maybe is that the copyFromURL handler method lacks the error handler for "CannotVerifyCopySource"
The copyFromURL handler method is defined in https://github.com/Azure/Azurite/blob/master/src/blob/handlers/BlobHandler.ts#L801
The startCopyFromURL handler method have the error handler which is defined in
https://github.com/Azure/Azurite/blob/master/src/blob/handlers/BlobHandler.ts#L647

Expected Behavior
When use Copy Blob From URL operation with invalid blob url, it doesn't copy blob successfully and return error "CannotVerifyCopySource" in Azurite.

@jongio for notification.

@blueww
Copy link
Member

blueww commented Nov 19, 2020

@zzhxiaofeng
Thanks for raising the issue!

For different error, it's better to open different git hub issues to track them. As we already have https://github.com/Azure/Azurite/issues/603to track issue #2, will only use this to track #1.

It would be great if you can include the current Azurite behavior of #1 to this issue, then we can know the severity of the issue.
We will investigate and evaluate the issue.

We welcome contribution to Azurite.
It would be great if you could contribute the the fix of this issue.

@blueww blueww added alignment Alignment between Azurite with Azure Storage production blob-storage bug Something isn't working NewArch Tracking issues for NewArch labels Nov 19, 2020
@blueww blueww self-assigned this Nov 19, 2020
@zzhxiaofeng
Copy link
Contributor Author

@blueww Ok, I have updated the error description. Please have a look.

@blueww
Copy link
Member

blueww commented Nov 19, 2020

Thanks for the reply @zzhxiaofeng
For "return nothing in Azurite", do you mean Azurite will not return error, also not return any responds?
Could you please clarify?

BTW, for Azurite issue, it's better to attach the debug log for the related request.
For Azurite behavior different with Azure Server, beside debug log, please also describe clearly the different behavior of both Azurite and Azure server?

@zzhxiaofeng
Copy link
Contributor Author

zzhxiaofeng commented Nov 20, 2020

@blueww When use Copy Blob From URL operation with invalid blob url, it will return the error "CannotVerifyCopySource" in Azure Server. But in Azurite, it don't return the error and run successfully(return 200) in this case.

@blueww
Copy link
Member

blueww commented Nov 20, 2020

@zzhxiaofeng
Thanks for the details!
We will evaluate it.

@zzhxiaofeng zzhxiaofeng changed the title Azurite doesn’t support error "CannotVerifyCopySource" in Copy Blob From URL operation on blob and the response of this operation lacks CopyStatus field Azurite doesn’t support error "CannotVerifyCopySource" in Copy Blob From URL operation on blob Nov 26, 2020
@v-xuto
Copy link
Member

v-xuto commented May 17, 2021

azsdk-azurite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alignment Alignment between Azurite with Azure Storage production blob-storage bug Something isn't working NewArch Tracking issues for NewArch
Projects
None yet
Development

No branches or pull requests

3 participants