com.azure.storage.blob.models.BlobStorageException: Status code 400, (empty body)
See original GitHub issueWhich service(blob, file, queue, table) does this issue concern?
blob
Which version of the Azurite was used?
3.7.0 (mcr.microsoft.com/azure-storage/azurite:3.7.0) I also used azurite:latest.
Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
DockerHub
What’s the Node.js version?
na (FROM node:10-alpine in Dockerfile)
What problem was encountered?
When using com.azure:azure-storage-blob:12.6.1
and using listBlobs an exception is thrown:
com.azure.storage.blob.models.BlobStorageException: Status code 400, (empty body)
^ this is inconsistent with the production Azure blob storage service. This issue is documented here: https://github.com/Azure/azure-sdk-for-java/issues/6945. Azurite should have the same behaviour as the production service.
Steps to reproduce the issue?
//String connectionString = realConnectionString;
String connectionString = fakeConnectionString;
System.out.println("Using the Connection String: " + connectionString);
String containerName = "somecontainer";
StorageSharedKeyCredential credential = StorageSharedKeyCredential.fromConnectionString(connectionString);
BlobContainerClient blobContainerClient = new BlobContainerClientBuilder()
.connectionString(connectionString)
.containerName(containerName)
.credential(credential)
.buildClient();
// create the container if it doesn't already exist
if (!blobContainerClient.exists()) {
blobContainerClient.create();
}
String location = "testing";
// As documented by https://github.com/Azure/azure-sdk-for-java/issues/6945
ListBlobsOptions options = new ListBlobsOptions().setDetails(new BlobListDetails().setRetrieveMetadata(true));
// this passes ✅
//PagedIterable<BlobItem> blobs = blobContainerClient.listBlobsByHierarchy(location, options, Duration.ofSeconds(15));
// this fails ❌
PagedIterable<BlobItem> blobs = blobContainerClient.listBlobsByHierarchy(location);
assertFalse(blobs.iterator().hasNext());
Have you found a mitigation/solution?
ListBlobsOptions options = new ListBlobsOptions().setDetails(new BlobListDetails().setRetrieveMetadata(true));
blobContainerClient.listBlobsByHierarchy(location, options, Duration.ofSeconds(15));
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Getting error 400 bad request when accessing Azure blob ...
I am running in to the "400 bad request" error that many have posted about when accessing Azure blob storage. Most of the...
Read more >Azure Blob Storage error codes - Microsoft Learn
Error code HTTP status code User message
BlobAlreadyExists Conflict (409) The specified blob already exists.
BlobNotFound Not Found (404) The specified blob does not exist.
ContainerAlreadyExists...
Read more >com.azure.storage.blob.models.BlobStorageException
azure.storage.blob.models.BlobStorageException: Status code 404, (empty body) on deleting files in Azure connection.
Read more >BlobStorageException (Azure SDK for Java Reference ... - NET
declaration: package: com.azure.storage.blob.models, ... is thrown whenever Azure Storage successfully returns an error code that is not 200-level.
Read more >[NEXUS-31948] Attempting to create Azure blob store with an ...
BlobStorageException: Status code 404, (empty body)'; mapped from: com.azure.storage.blob.models.BlobStorageException: Status code 404, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s another undocumented behavior for Azure Storage production, not an issue of Azurite.
@snodnipper
Thanks for the info! I get the failure happens when “include=” don’t have any value. As I see, Java SDK has fixed the issue, and I don’t see other SDK (like .net) has this issue. So seems the issue is not blocking currently.
We will discuss how to fix it, and update when get a decision.