Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

While uploading file to azurite blob storage getting 400 bad request

soumya-222 opened this issue · comments

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

blob

Which version of the Azurite was used?

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

DockerHub

What's the Node.js version?

18.18.0

What problem was encountered?

deployment yaml

apiVersion: apps/v1
kind: Deployment
metadata:
name: maya-server-azurite
namespace: maya-server
labels:
app: maya-server-azurite
spec:
replicas: 1
selector:
matchLabels:
app: maya-server-azurite
template:
metadata:
labels:
app: maya-server-azurite
spec:
containers:
- name: azurite
image: mcr.microsoft.com/azure-storage/azurite
command: ["azurite", "--oauth", "basic", "--cert", "/mnt/maya-deploy.swinfra.net.pem", "--key", "/mnt/maya-deploy.swinfra.net-key.pem", "--blobHost", "0.0.0.0", "--queueHost", "0.0.0.0", "--tableHost", "0.0.0.0"]
ports:
- containerPort: 10000
protocol: TCP
- containerPort: 10001
protocol: TCP
- containerPort: 10002
protocol: TCP
volumeMounts:
- name: "nfs"
mountPath: "/mnt"
subPath: "maya/bin/azurite"

  volumes:
    - name: "nfs"
      persistentVolumeClaim:
        claimName: maya-volume

ingress yaml

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/backend-protocol: HTTPS
ingress.kubernetes.io/proxy-body-size: 4096m
ingress.kubernetes.io/secure-backends: "true"
kubernetes.io/ingress.class: nginx
name: maya-server-azurite-ingress
namespace: maya-server
spec:
rules:
- http:
paths:
- backend:
service:
name: maya-azurite-service
port:
number: 443
path: /devstoreaccount1
pathType: Prefix

while trying to connect to the blob and trying upload file but it is failing with 400 bad request

EXCEPTION:

Exception in thread "main" com.azure.storage.blob.models.BlobStorageException: Status code 400, (empty body)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
at com.azure.core.implementation.http.rest.ResponseExceptionConstructorCache.invoke(ResponseExceptionConstructorCache.java:56)
at com.azure.core.implementation.http.rest.RestProxyBase.instantiateUnexpectedException(RestProxyBase.java:356)
at com.azure.core.implementation.http.rest.AsyncRestProxy.lambda$ensureExpectedStatus$1(AsyncRestProxy.java:127)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:113)
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2400)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:171)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2196)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2070)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96)
at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55)
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129)
at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129)
at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)
at reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)
at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onNext(FluxRetryWhen.java:174)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)
at reactor.core.publisher.Operators$MonoInnerProducerBase.complete(Operators.java:2666)
at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:180)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onComplete(MonoFlatMapMany.java:260)
at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onComplete(FluxContextWrite.java:126)
at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onComplete(FluxMap.java:275)
at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:85)
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2402)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2196)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2070)
at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55)
at reactor.core.publisher.Mono.subscribe(Mono.java:4490)
at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:82)
at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onComplete(FluxDoFinally.java:128)
at reactor.core.publisher.FluxHandle$HandleSubscriber.onComplete(FluxHandle.java:220)
at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onComplete(FluxMap.java:275)
at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onComplete(FluxDoFinally.java:128)
at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:208)
at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839)
at reactor.core.publisher.MonoCollectList$MonoCollectListSubscriber.onComplete(MonoCollectList.java:129)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260)
at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144)
at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:413)
at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:424)
at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:478)
at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:712)
at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:113)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at com.azure.core.http.netty.implementation.AzureSdkHandler.channelRead(AzureSdkHandler.java:222)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1383)
at io.netty.handler.ssl.SslHandler.decodeNonJdkCompatible(SslHandler.java:1257)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1297)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:468)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
Suppressed: java.lang.Exception: #block terminated with an error
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:99)
at reactor.core.publisher.Mono.block(Mono.java:1742)
at com.azure.storage.common.implementation.StorageImplUtils.blockWithOptionalTimeout(StorageImplUtils.java:146)
at com.azure.storage.blob.BlobContainerClient.createIfNotExistsWithResponse(BlobContainerClient.java:374)
at com.azure.storage.blob.BlobContainerClient.createIfNotExists(BlobContainerClient.java:340)
at org.example.AzuriteExample.main(AzuriteExample.java:89)
SERVER LOG:
[root@maya-deploy realized]# kubectl logs -f maya-server-azurite-67b669c9f7-xl6mr -n maya-server
Azurite Blob service is starting at https://0.0.0.0:10000
Azurite Blob service is successfully listening at https://0.0.0.0:10000
Azurite Queue service is starting at https://0.0.0.0:10001
Azurite Queue service is successfully listening at https://0.0.0.0:10001
Azurite Table service is starting at https://0.0.0.0:10002
Azurite Table service is successfully listening at https://0.0.0.0:10002
172.16.0.80 - - [29/Jan/2024:07:14:19 +0000] "PUT /devstoreaccount1/maya-container?restype=container HTTP/1.1" 400 -

Steps to reproduce the issue?

deployment yaml

apiVersion: apps/v1
kind: Deployment
metadata:
name: maya-server-azurite
namespace: maya-server
labels:
app: maya-server-azurite
spec:
replicas: 1
selector:
matchLabels:
app: maya-server-azurite
template:
metadata:
labels:
app: maya-server-azurite
spec:
containers:
- name: azurite
image: mcr.microsoft.com/azure-storage/azurite
command: ["azurite", "--oauth", "basic", "--cert", "/mnt/maya-deploy.swinfra.net.pem", "--key", "/mnt/maya-deploy.swinfra.net-key.pem", "--blobHost", "0.0.0.0", "--queueHost", "0.0.0.0", "--tableHost", "0.0.0.0"]
ports:
- containerPort: 10000
protocol: TCP
- containerPort: 10001
protocol: TCP
- containerPort: 10002
protocol: TCP
volumeMounts:
- name: "nfs"
mountPath: "/mnt"
subPath: "maya/bin/azurite"

  volumes:
    - name: "nfs"
      persistentVolumeClaim:
        claimName: maya-volume

ingress yaml

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/backend-protocol: HTTPS
ingress.kubernetes.io/proxy-body-size: 4096m
ingress.kubernetes.io/secure-backends: "true"
kubernetes.io/ingress.class: nginx
name: maya-server-azurite-ingress
namespace: maya-server
spec:
rules:
- http:
paths:
- backend:
service:
name: maya-azurite-service
port:
number: 443
path: /devstoreaccount1
pathType: Prefix

while trying to connect to the blob and trying upload file but it is failing with 400 bad request

EXCEPTION:

Exception in thread "main" com.azure.storage.blob.models.BlobStorageException: Status code 400, (empty body)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)
at com.azure.core.implementation.http.rest.ResponseExceptionConstructorCache.invoke(ResponseExceptionConstructorCache.java:56)
at com.azure.core.implementation.http.rest.RestProxyBase.instantiateUnexpectedException(RestProxyBase.java:356)
at com.azure.core.implementation.http.rest.AsyncRestProxy.lambda$ensureExpectedStatus$1(AsyncRestProxy.java:127)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:113)
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2400)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:171)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2196)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2070)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96)
at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55)
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129)
at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129)
at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:137)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:129)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)
at reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)
at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onNext(FluxRetryWhen.java:174)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)
at reactor.core.publisher.Operators$MonoInnerProducerBase.complete(Operators.java:2666)
at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:180)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onComplete(MonoFlatMapMany.java:260)
at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onComplete(FluxContextWrite.java:126)
at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onComplete(FluxMap.java:275)
at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:85)
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2402)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2196)
at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2070)
at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:55)
at reactor.core.publisher.Mono.subscribe(Mono.java:4490)
at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onComplete(FluxSwitchIfEmpty.java:82)
at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onComplete(FluxDoFinally.java:128)
at reactor.core.publisher.FluxHandle$HandleSubscriber.onComplete(FluxHandle.java:220)
at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onComplete(FluxMap.java:275)
at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onComplete(FluxDoFinally.java:128)
at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:208)
at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107)
at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839)
at reactor.core.publisher.MonoCollectList$MonoCollectListSubscriber.onComplete(MonoCollectList.java:129)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260)
at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144)
at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:413)
at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:424)
at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:478)
at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:712)
at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:113)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at com.azure.core.http.netty.implementation.AzureSdkHandler.channelRead(AzureSdkHandler.java:222)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1383)
at io.netty.handler.ssl.SslHandler.decodeNonJdkCompatible(SslHandler.java:1257)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1297)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:468)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
Suppressed: java.lang.Exception: #block terminated with an error
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:99)
at reactor.core.publisher.Mono.block(Mono.java:1742)
at com.azure.storage.common.implementation.StorageImplUtils.blockWithOptionalTimeout(StorageImplUtils.java:146)
at com.azure.storage.blob.BlobContainerClient.createIfNotExistsWithResponse(BlobContainerClient.java:374)
at com.azure.storage.blob.BlobContainerClient.createIfNotExists(BlobContainerClient.java:340)
at org.example.AzuriteExample.main(AzuriteExample.java:89)

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?

Hi @soumya-222 ,

Can you share Azurite's detailed debug log? Cannot see why it failed with only a 400 error code...

@EmmaZhu

Please find below the debug log

=======================

2024-01-29T08:31:41.100Z info: Azurite Blob service is starting on 0.0.0.0:10000
2024-01-29T08:31:41.116Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:31:41.117Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:31:41.147Z info: BlobGCManager:start() Starting BlobGCManager. Set status to Initializing.
2024-01-29T08:31:41.147Z info: BlobGCManager:start() Trigger mark and sweep loop. Set status to Running.
2024-01-29T08:31:41.148Z info: BlobGCManager:markSweepLoop() Start next mark and sweep.
2024-01-29T08:31:41.149Z info: BlobGCManager:markSweep() Get all extents.
2024-01-29T08:31:41.152Z info: BlobGCManager:start() BlobGCManager successfully started.
2024-01-29T08:31:41.159Z info: BlobGCManager:markSweep() Got 0 extents.
2024-01-29T08:31:41.160Z info: BlobGCManager:markSweep() Get referred extents.
2024-01-29T08:31:41.163Z info: BlobGCManager:markSweep() Got referred extents, unreferenced extents count is 0.
2024-01-29T08:31:41.163Z info: BlobGCManager:markSweepLoop() Mark and sweep finished, taken 15ms.
2024-01-29T08:31:41.164Z info: BlobGCManager:markSweepLoop() Sleep for 600000ms.
2024-01-29T08:31:41.171Z info: Azurite Blob service successfully listens on https://0.0.0.0:10000
2024-01-29T08:31:41.172Z info: Azurite Queue service is starting on 0.0.0.0:10001
2024-01-29T08:31:41.173Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:31:41.173Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:31:41.183Z info: QueueGCManager:start() Starting QueueGCManager, set status to Initializing
2024-01-29T08:31:41.184Z info: QueueGCManager:start() Trigger mark and sweep loop, set status to Running.
2024-01-29T08:31:41.184Z info: QueueGCManager:markSweepLoop() Start new mark and sweep.
2024-01-29T08:31:41.185Z info: QueueGCManger:markSweep() Get all extents.
2024-01-29T08:31:41.186Z info: QueueGCManager:start() QueueGCManager successfully started.
2024-01-29T08:31:41.187Z info: QueueGCManager:marksweep() Get 0 extents.
2024-01-29T08:31:41.187Z info: QueueGCManager:markSweep() Get referred extents, then remove from allExtents.
2024-01-29T08:31:41.188Z info: QueueGCManager:markSweep() Got referred extents, unreferenced extents count is 0.
2024-01-29T08:31:41.188Z info: QueueGCManager:markSweepLoop() Mark and sweep finished, take 3ms.
2024-01-29T08:31:41.188Z info: QueueGCManager:markSweepLoop() Sleep for 60000
2024-01-29T08:31:41.190Z info: Azurite Queue service successfully listens on https://0.0.0.0:10001
2024-01-29T08:31:41.190Z info: Azurite Table service is starting on 0.0.0.0:10002
2024-01-29T08:31:41.191Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:31:41.191Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:31:41.197Z info: Azurite Table service successfully listens on https://0.0.0.0:10002
2024-01-29T08:32:26.798Z b569fabf-8619-46cf-b967-2bba9f3bb20a info: BlobStorageContextMiddleware: RequestMethod=PUT RequestURL=https://maya-deploy.swinfra.net/devstoreaccount1/maya-container?restype=container RequestHeaders:{"host":"maya-deploy.swinfra.net","x-request-id":"210f0c210685d02c3523a5bda27be7c6","x-real-ip":"172.16.0.1","x-forwarded-for":"172.16.0.1","x-forwarded-host":"maya-deploy.swinfra.net","x-forwarded-port":"443","x-forwarded-proto":"https","x-forwarded-scheme":"https","x-scheme":"https","original_request_url":"https://maya-deploy.swinfra.net:8443/devstoreaccount1/maya-container?restype=container","content-length":"0","date":"Mon, 29 Jan 2024 08:32:26 GMT","authorization":"SharedKey devstoreaccount1:dIJBOP8a1IG8eTkeSY563mFgRednneO1xzCwMKZEzaI=","x-ms-version":"2023-01-03","x-ms-client-request-id":"289a90f8-e3c1-439d-998f-7403e9c1e79a","accept":"application/xml","user-agent":"azsdk-java-azure-storage-blob/12.23.1 (17.0.6; Windows 10; 10.0)"} ClientIP=172.16.0.79 Protocol=https HTTPVersion=1.1
2024-01-29T08:32:26.801Z b569fabf-8619-46cf-b967-2bba9f3bb20a info: BlobStorageContextMiddleware: Account=maya-deploy Container=devstoreaccount1 Blob=maya-container
2024-01-29T08:32:26.802Z b569fabf-8619-46cf-b967-2bba9f3bb20a verbose: DispatchMiddleware: Dispatching request...
2024-01-29T08:32:26.812Z b569fabf-8619-46cf-b967-2bba9f3bb20a error: DispatchMiddleware: Incoming URL doesn't match any of swagger defined request patterns.
2024-01-29T08:32:26.815Z b569fabf-8619-46cf-b967-2bba9f3bb20a error: ErrorMiddleware: Received a MiddlewareError, fill error information to HTTP response
2024-01-29T08:32:26.815Z b569fabf-8619-46cf-b967-2bba9f3bb20a error: ErrorMiddleware: ErrorName=UnsupportedRequestError ErrorMessage=Incoming URL doesn't match any of swagger defined request patterns. ErrorHTTPStatusCode=400 ErrorHTTPStatusMessage=undefined ErrorHTTPHeaders=undefined ErrorHTTPBody=undefined ErrorStack="UnsupportedRequestError: Incoming URL doesn't match any of swagger defined request patterns.\n at dispatchMiddleware (/opt/azurite/dist/src/blob/generated/middleware/dispatch.middleware.js:41:30)\n at /opt/azurite/dist/src/blob/generated/ExpressMiddlewareFactory.js:50:47\n at Layer.handle [as handle_request] (/opt/azurite/node_modules/express/lib/router/layer.js:95:5)\n at trim_prefix (/opt/azurite/node_modules/express/lib/router/index.js:328:13)\n at /opt/azurite/node_modules/express/lib/router/index.js:286:9\n at Function.process_params (/opt/azurite/node_modules/express/lib/router/index.js:346:12)\n at next (/opt/azurite/node_modules/express/lib/router/index.js:280:10)\n at blobStorageContextMiddleware (/opt/azurite/dist/src/blob/middlewares/blobStorageContext.middleware.js:137:5)\n at /opt/azurite/dist/src/blob/middlewares/blobStorageContext.middleware.js:15:16\n at Layer.handle [as handle_request] (/opt/azurite/node_modules/express/lib/router/layer.js:95:5)"
2024-01-29T08:32:26.815Z b569fabf-8619-46cf-b967-2bba9f3bb20a error: ErrorMiddleware: Set HTTP code: 400
2024-01-29T08:32:26.816Z b569fabf-8619-46cf-b967-2bba9f3bb20a error: ErrorMiddleware: Set HTTP body: undefined
2024-01-29T08:32:26.817Z b569fabf-8619-46cf-b967-2bba9f3bb20a info: EndMiddleware: End response. TotalTimeInMS=21 StatusCode=400 StatusMessage=undefined Headers={"server":"Azurite-Blob/3.29.0"}
2024-01-29T08:32:41.117Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:32:41.118Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:32:41.174Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:32:41.174Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:32:41.190Z info: QueueGCManager:markSweepLoop() Start new mark and sweep.
2024-01-29T08:32:41.190Z info: QueueGCManger:markSweep() Get all extents.
2024-01-29T08:32:41.190Z info: QueueGCManager:marksweep() Get 0 extents.
2024-01-29T08:32:41.190Z info: QueueGCManager:markSweep() Get referred extents, then remove from allExtents.
2024-01-29T08:32:41.191Z info: QueueGCManager:markSweep() Got referred extents, unreferenced extents count is 0.
2024-01-29T08:32:41.191Z info: QueueGCManager:markSweepLoop() Mark and sweep finished, take 1ms.
2024-01-29T08:32:41.191Z info: QueueGCManager:markSweepLoop() Sleep for 60000
2024-01-29T08:32:41.191Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:32:41.191Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:33:41.118Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:33:41.118Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:33:41.174Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:33:41.175Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:33:41.192Z info: QueueGCManager:markSweepLoop() Start new mark and sweep.
2024-01-29T08:33:41.193Z info: QueueGCManger:markSweep() Get all extents.
2024-01-29T08:33:41.194Z info: QueueGCManager:marksweep() Get 0 extents.
2024-01-29T08:33:41.194Z info: QueueGCManager:markSweep() Get referred extents, then remove from allExtents.
2024-01-29T08:33:41.194Z info: QueueGCManager:markSweep() Got referred extents, unreferenced extents count is 0.
2024-01-29T08:33:41.194Z info: QueueGCManager:markSweepLoop() Mark and sweep finished, take 1ms.
2024-01-29T08:33:41.195Z info: QueueGCManager:markSweepLoop() Sleep for 60000
2024-01-29T08:33:41.195Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:33:41.195Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:34:41.119Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:34:41.119Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:34:41.175Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:34:41.175Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:34:41.195Z info: QueueGCManager:markSweepLoop() Start new mark and sweep.
2024-01-29T08:34:41.196Z info: QueueGCManger:markSweep() Get all extents.
2024-01-29T08:34:41.196Z info: QueueGCManager:marksweep() Get 0 extents.
2024-01-29T08:34:41.196Z info: QueueGCManager:markSweep() Get referred extents, then remove from allExtents.
2024-01-29T08:34:41.197Z info: QueueGCManager:markSweep() Got referred extents, unreferenced extents count is 0.
2024-01-29T08:34:41.197Z info: QueueGCManager:markSweepLoop() Mark and sweep finished, take 1ms.
2024-01-29T08:34:41.197Z info: QueueGCManager:markSweepLoop() Sleep for 60000
2024-01-29T08:34:41.197Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:34:41.197Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:35:41.119Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:35:41.119Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:35:41.175Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:35:41.176Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:35:41.197Z info: QueueGCManager:markSweepLoop() Start new mark and sweep.
2024-01-29T08:35:41.198Z info: QueueGCManger:markSweep() Get all extents.
2024-01-29T08:35:41.198Z info: QueueGCManager:marksweep() Get 0 extents.
2024-01-29T08:35:41.198Z info: QueueGCManager:markSweep() Get referred extents, then remove from allExtents.
2024-01-29T08:35:41.198Z info: QueueGCManager:markSweep() Got referred extents, unreferenced extents count is 0.
2024-01-29T08:35:41.198Z info: QueueGCManager:markSweepLoop() Mark and sweep finished, take 0ms.
2024-01-29T08:35:41.199Z info: QueueGCManager:markSweepLoop() Sleep for 60000
2024-01-29T08:35:41.199Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:35:41.199Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:36:41.120Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:36:41.120Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:36:41.175Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:36:41.176Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.
2024-01-29T08:36:41.199Z info: QueueGCManager:markSweepLoop() Start new mark and sweep.
2024-01-29T08:36:41.200Z info: QueueGCManger:markSweep() Get all extents.
2024-01-29T08:36:41.200Z info: QueueGCManager:marksweep() Get 0 extents.
2024-01-29T08:36:41.200Z info: QueueGCManager:markSweep() Get referred extents, then remove from allExtents.
2024-01-29T08:36:41.200Z info: QueueGCManager:markSweep() Got referred extents, unreferenced extents count is 0.
2024-01-29T08:36:41.200Z info: QueueGCManager:markSweepLoop() Mark and sweep finished, take 1ms.
2024-01-29T08:36:41.200Z info: QueueGCManager:markSweepLoop() Sleep for 60000
2024-01-29T08:36:41.201Z info: AccountDataStore:init() Refresh accounts from environment variable AZURITE_ACCOUNTS with value undefined
2024-01-29T08:36:41.201Z info: AccountDataStore:init() Fallback to default emulator account devstoreaccount1.

Hi @soumya-222 ,

The URL to container should be https://maya-deploy.swinfra.net:443/maya-container instead of https://maya-deploy.swinfra.net:443/account1/maya-container.

Could you have a try?

Thanks
Emma

Hi @EmmaZhu
As you suggest to try with "https://maya-deploy.swinfra.net:443/maya-container" not working
because i am trying to create container we need to go through account name

BlobContainerClient blobContainerClient = new BlobContainerClientBuilder()
.endpoint("https://maya-deploy.swinfra.net:443/maya-container")
.credential(credential)
.buildClient();

   System.out.println("Container URL: " + blobContainerClient.getAccountUrl());
    System.out.println("Container Name: " + blobContainerClient.getBlobContainerName());

            blobContainerClient.createIfNotExists();
            
            when i try with above code the azurite prints 
            Container URL: https://maya-deploy.swinfra.net:443/maya-container
            Container Name: $root
            
            and same error 400 Bad Request 
            
            Exception in thread "main" com.azure.storage.blob.models.BlobStorageException: Status code 400, (empty body)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732)

@EmmaZhu
i have managed to fix the 400 bad request issue but while using custom account getting 403 unauthorized error
env:
- name: AZURITE_ACCOUNTS
value: account1:ZGV2c3RvcmVhY2NvdW50Mw==

          getting 403 what is the proper value of key  i feel key value needs to be proper i have provided some random base64 value 
          
          in case of devstoreaccount1 it is working but with custom account saying 
AuthorizationFailure Server failed to authenticate the request. Make sure the value of the Authorization header is formed correctly including the signature. RequestId:775363f9-104c-4e1a-8760-c272ea109e55 Time:2024-02-05T18:16:23.918Z "

Hi @soumya-222 ,

Tried with latest Azurite, account1:ZGV2c3RvcmVhY2NvdW50Mw== works well.

Can you share Azurite's debug logs to me to take a look?