Azure / Azure/Azurite

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

Open
#634 8 comments 1 reaction 1 assignee Claimed by @blueww View on GitHub
alignment blob-storage bug NewArch
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

**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](https://user-images.githubusercontent.com/20970631/99631493-a81e5600-2a76-11eb-89d5-f7ef6aeedaf1.png)

**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("");
const originBlobClient = await containerClient.getBlockBlobClient("");
const newBlobClient = await containerClient.getBlockBlobClient("");
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](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](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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.