Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
MIT License
1.8k stars 320 forks source link

[blob] beginCopyFromURL error response empty body #291

Open ljian3377 opened 4 years ago

ljian3377 commented 4 years ago

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

blob

Which version of the Azurite was used?

3.3.0-preview

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

npm

What's the Node.js version?

v12.13.0

What problem was encountered?

Unit test failure: BlobClient.abortCopyFromClient should failed for a completed copy operation

    try {
      await newBlobClient.beginCopyFromURL(result.copyId!);
      assert.fail(
        "AbortCopyFromClient should be failed and throw exception for an completed copy operation."
      );
    } catch (err) {
      assert.ok((err as any).response.parsedBody.Code === "InvalidHeaderValue");
    }

This case is using a copyId to beginCopyFromURL, so an error is expected. But the difference is azurite returned an empty body.

Steps to reproduce the issue?

Re-run the test-case.

Have you found a mitigation/solution?

N/A

debug.log

2019-12-12T10:28:59.070Z f31f7afa-9f3c-4b25-a866-50bc8ee5fc6d error: ErrorMiddleware: Received an error, fill error information to HTTP response
2019-12-12T10:28:59.071Z f31f7afa-9f3c-4b25-a866-50bc8ee5fc6d error: ErrorMiddleware: ErrorName=TypeError ErrorMessage=Invalid URL: 3cba73fc-d8d9-4bac-b930-2d3a8cb2ca05 ErrorStack="TypeError [ERR_INVALID_URL]: Invalid URL: 3cba73fc-d8d9-4bac-b930-2d3a8cb2ca05\n    at onParseError (internal/url.js:243:9)\n    at new URL (internal/url.js:319:5)\n    at BlobHandler.startCopyFromURL (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\blob\\handlers\\BlobHandler.js:366:21)\n    at C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\blob\\generated\\middleware\\HandlerMiddlewareFactory.js:58:18\n    at C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\azurite\\dist\\src\\blob\\generated\\ExpressMiddlewareFactory.js:77:63\n    at Layer.handle [as handle_request] (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\azurite\\node_modules\\express\\lib\\router\\layer.js:95:5)\n    at trim_prefix (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\azurite\\node_modules\\express\\lib\\router\\index.js:317:13)\n    at C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\azurite\\node_modules\\express\\lib\\router\\index.js:284:7\n    at Function.process_params (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\azurite\\node_modules\\express\\lib\\router\\index.js:335:12)\n    at next (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\azurite\\node_modules\\express\\lib\\router\\index.js:275:10)\n    at runMicrotasks (<anonymous>)\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)"
2019-12-12T10:28:59.071Z f31f7afa-9f3c-4b25-a866-50bc8ee5fc6d error: ErrorMiddleware: Set HTTP code: 500

debug.log

request_id

4396a275-302c-450d-a3e2-2ebff3cc0da1

ljian3377 commented 4 years ago

@XiaoningLiu

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.