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

add support for x-ms-encryption-algorithm #676

Open efiop opened 3 years ago

efiop commented 3 years ago

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

blob

Which version of the Azurite was used?

3.10.0

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

dockerhub

What's the Node.js version?

?

What problem was encountered?

2021-01-14T16:09:43.1140570Z     return client.upload(
2021-01-14T16:09:43.1141820Z   File "/opt/hostedtoolcache/Python/3.8.7/x64/lib/python3.8/site-packages/azure/storage/blob/_generated/operations/_block_blob_operations.py", line 233, in upload
2021-01-14T16:09:43.1142819Z     raise HttpResponseError(response=response, model=error)
2021-01-14T16:09:43.1145036Z azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'x-ms-encryption-algorithm header or parameter is not supported in Azurite strict mode. Switch to loose model by Azurite command line parameter "--loose" or Visual Studio Code configuration "Loose". Please vote your wanted features to https://github.com/azure/azurite/issues'

Steps to reproduce the issue?

upload with azure-storage-blob 2.7.0

Have you found a mitigation/solution?

--loose

XiaoningLiu commented 3 years ago

Thanks for bringing up this. Customer encryption key is not supported by Azurite, will evaluate further.

phooey commented 2 years ago

Any update here? It is a bit confusing to have to run Azurite in loose mode (which is not the default) even when following the basic examples, e.g.: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-blob#create-a-blob-by-uploading-data

XiaoningLiu commented 2 years ago

Thanks for bringing it up, sorry we don't have an accurate date for this feature yet : (

j71h commented 2 years ago

This issue should be easier to find as it consumed a lot of time to figure out the cause of not being able to use for example Azurite with Azure Storage Explorer. After searching for a solution for this issue on several occasions, filing issues and trying different things I did find the --loose option and got it to work. Eventually I found my way here. If I hade to put in such an effort to figure this out, chances are that a lot of other people are suffering the same issue and needs to spend a lot of time and frustration.

A solution for this would be nice, and a first step would be to return a clear error message using a suitable http response code.

blueww commented 2 years ago

@j71h

When you add unsupported header "x-ms-encryption-algorithm" in request to Azurite , normally azurite will return 500 with clear error message like "x-ms-encryption-algorithm header or parameter is not supported in Azurite strict mode. Switch to loose model by Azurite command line parameter "--loose" or Visual Studio Code configuration "Loose"."

It looks the tools you use might hide the error message. If you can access Azurite with some SDK and wait for the exception throw, the exception should include the clear error. Or if you look into Azurite debug log and find the log for the failed request, you should also can see the details.