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

BeginCopyAsync is throwing wrong exception when source blob is not found. #2423

Open
johnemmanuelm opened this issue Jul 5, 2024 · 2 comments
Assignees
Labels
alignment Alignment between Azurite with Azure Storage production blob-storage bug Something isn't working

Comments

@johnemmanuelm
Copy link

johnemmanuelm commented Jul 5, 2024

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

Blob (BlobCopier)

Which version of the Azurite was used?

3.31.0

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

npm

What's the Node.js version?

v20.10.0

What problem was encountered?

The exception thrown when a source blob was not found is "InternalServerError" (500) instead of a "notfound".

Steps to reproduce the issue?

If possible, please provide the debug log using the -d parameter, replacing <pathtodebuglog> with an appropriate path for your OS, or review the instructions for docker containers:

-d "<pathtodebuglog>"

Please be sure to remove any PII or sensitive information before sharing!
The debug log will log raw request headers and bodies, so that we can replay these against Azurite using REST and create tests to validate resolution.

Have you found a mitigation/solution?

No

@blueww blueww added bug Something isn't working blob-storage alignment Alignment between Azurite with Azure Storage production labels Jul 8, 2024
@blueww
Copy link
Member

blueww commented Jul 8, 2024

@EmmaZhu

It look related with your code change on copy source permission check.
Would you please help to look?

@EmmaZhu
Copy link
Member

EmmaZhu commented Sep 10, 2024

Hi @johnemmanuelm ,

Could share the code you used to reproduce the issue?

I tried with following code, and Azurite return 404s error as expected:

const sourceBlobClient = containerClient.getBlockBlobClient(sourceBlob);
    const destBlobClient = containerClient.getBlockBlobClient(destBlob);

    const tmr = new Date();
    tmr.setDate(tmr.getDate() + 1);

    const url = await sourceBlobClient.generateSasUrl({
      permissions: BlobSASPermissions.parse('rwd'),
      expiresOn: tmr
    });

    try {
      await destBlobClient.beginCopyFromURL(
        url
      );
    }
    catch (err) {
      err;
    }

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
Projects
None yet
Development

No branches or pull requests

3 participants