[BUG] RuntimeException when using BlobContainerClient
Describe the bug
I am trying to list and download blobs from a public blob storage. However, I am getting strange errors.
Exception or Stack Trace
Exception in thread "main" java.lang.RuntimeException: Unexpected header value. Expected response to echo x-ms-client-request-id: f64bd375-2558-4625-8626-7c647eae58c5. Got value b734e8e5-a1dc-4eb1-8829-82f97253e89f. at com.azure.storage.common.policy.ResponseValidationPolicyBuilder.lambda$addOptionalEcho$0(ResponseValidationPolicyBuilder.java:48) at com.azure.storage.common.policy.ResponseValidationPolicyBuilder$ResponseValidationPolicy.lambda$process$0(ResponseValidationPolicyBuilder.java:79) at java.base/java.util.ArrayList.forEach(ArrayList.java:1511) at com.azure.storage.common.policy.ResponseValidationPolicyBuilder$ResponseValidationPolicy.lambda$process$1(ResponseValidationPolicyBuilder.java:79) at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:113) at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1839) at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151) 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.Operators$ScalarSubscription.request(Operators.java:2402) at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.request(FluxContextWrite.java:136) at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onSubscribeInner(MonoFlatMapMany.java:150) at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onSubscribe(MonoFlatMapMany.java:245) at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onSubscribe(FluxContextWrite.java:101) at reactor.core.publisher.FluxJust.subscribe(FluxJust.java:68) at reactor.core.publisher.Flux.subscribe(Flux.java:8642) at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onNext(MonoFlatMapMany.java:195) at reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99) at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onNext(FluxRetryWhen.java:174) at reactor.core.publisher.MonoCreate$DefaultMonoSink.success(MonoCreate.java:172) at reactor.netty.http.client.HttpClientConnect$HttpIOHandlerObserver.onStateChange(HttpClientConnect.java:435) at reactor.netty.ReactorNetty$CompositeConnectionObserver.onStateChange(ReactorNetty.java:707) at reactor.netty.resources.DefaultPooledConnectionProvider$DisposableAcquire.onStateChange(DefaultPooledConnectionProvider.java:193) at reactor.netty.resources.DefaultPooledConnectionProvider$PooledConnection.onStateChange(DefaultPooledConnectionProvider.java:454) at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:703) at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:114) 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.fireChannelRead(ByteToMessageDecoder.java:333) at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:454) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) 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:1475) at io.netty.handler.ssl.SslHandler.decodeNonJdkCompatible(SslHandler.java:1349) at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1389) 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:100) at reactor.core.publisher.Mono.block(Mono.java:1742) at com.azure.storage.common.implementation.StorageImplUtils.blockWithOptionalTimeout(StorageImplUtils.java:147) at com.azure.storage.blob.specialized.BlobClientBase.downloadContent(BlobClientBase.java:875) at org.example.Main.main(Main.java:14)
To Reproduce Steps to reproduce the behavior: Run the code provided below. It may succeed, but also fails quite often with the exception above
Code Snippet ` package org.example;
import com.azure.storage.blob.BlobContainerClientBuilder; import com.azure.storage.blob.models.ListBlobsOptions;
import java.time.Duration;
public class Main { public static void main(String[] argv) { var client = new BlobContainerClientBuilder() .endpoint("https://archive.data.elexon.co.uk/iris-archive") .buildClient();
System.out.println(client.getBlobClient("data/PN/PN_202312081930_06190.json").downloadContent().toString());
client.listBlobs(
new ListBlobsOptions()
.setPrefix("data/PN/PN_20240130"), Duration.ofSeconds(20)
).forEach(blob -> {
System.out.println(blob.getName());
});
}
} `
Expected behavior No exceptions; blobs listed and downloaded
Screenshots If applicable, add screenshots to help explain your problem.
Setup (please complete the following information):
- OS: Windows
- IDE: IntelliJ
- Library/Libraries: azure-storage-blob:12.25.1
- Java version: 17
- App Server/Environment:
- Frameworks: none
- Build system: maven
If you suspect a dependency version mismatch (e.g. you see NoClassDefFoundError, NoSuchMethodError or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:
- verbose dependency tree (
mvn dependency:tree -Dverbose) - exception message, full stack trace, and any available logs
Additional context Add any other context about the problem here.
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [* ] Bug Description Added
- [*] Repro Steps Added
- [*] Setup information Added
@ibrahimrabab @ibrandes @seanmcc-msft
Thank you for your feedback. Tagging and routing to the team member best able to assist.
Hi @s17b2-voroneckij Can you please try to reproduce the issue and provide us with the latest x-ms-client-request-id so that we can appropriately investigate with the service team? Thanks for your cooperation!
Hi @s17b2-voroneckij. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
@ibrahimrabab, I have already done that multiple times. Please see here: https://github.com/Azure/azure-sdk-for-java/issues/38794
Hi @s17b2-voroneckij
I tried reproducing this issue and looks like that this is a transient error.
The issue you're experiencing is due to a mismatch in the x-ms-client-request-id header between what your client sent and what the server responded with. The server's response contains a different x-ms-client-request-id than expected, causing your application to throw the runtime exception.
Possible Cause : This mismatch could happen when the request is retried but a new ID is generated instead of reusing the original one.
This is a known issue and we will try to fix this.
@s17b2-voroneckij, are you still encountering this error while using the latest version of the SDK?
Hi @s17b2-voroneckij. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.
Hi @s17b2-voroneckij, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
@ibrandes, this error still pops up in the 12.32.0-beta.1 version of the sdk. Each call to listBlob (I did not yet try other calls) results in the error.
I was able to circumvent it by implementing a RandomRequestIdPolicy like below. It feels like the request id should be added per retry, ignoring already existing request id headers in the pass HttpRequest object.
class RandomRequestIdPolicy : HttpPipelinePolicy {
override fun process(context: HttpPipelineCallContext, next: HttpPipelineNextPolicy): Mono<HttpResponse?>? {
setRequestIdHeader(context.httpRequest)
return next.process()
}
override fun processSync(context: HttpPipelineCallContext, next: HttpPipelineNextSyncPolicy): HttpResponse? {
setRequestIdHeader(context.httpRequest)
return next.processSync()
}
companion object {
private val REQUEST_ID_HEADER: HttpHeaderName? = HttpHeaderName.fromString("x-ms-client-request-id")
private fun setRequestIdHeader(request: HttpRequest) {
request.headers.remove(REQUEST_ID_HEADER)
request.headers.set(REQUEST_ID_HEADER, CoreUtils.randomUuid().toString())
}
}
}
EDIT: this does not work for storage accounts which require authentication, as the http pipeline which is built, executes the *CredentialPolicy before any custom "RETRY" policy. This results in the wrong x-ms-request-id being used to calculate the request signature. For now this is solved by manually adding the CredentialPolicy without calling "credential()" on the BlobServiceClientBuilder.
EDIT2: This does not reliably solve the issue. I just was able to list a lot of blobs, but after about 5minutes of listing, it failed with the same error message. At least the error did not show up immediately.
@acfaf
Is what you're running to produce the wrong x-ms-request-id error the same as the sample provided in the original GitHub issue? If not, could you attach an updated sample?
@ibrandes I did not use the exact same sample. Below is what caused the error on my side:
BlobServiceClientBuilder()
.endpoint(endpoint)
.let {
accountKey?.let { key ->
it.credential(StorageSharedKeyCredential(accountName, key))
} ?: it
}
.buildClient().listBlobs()
By now I found, that the policies I published earlier only delayed the problem but did not resolve it. I now prevented the validation from checking the x-ms-request-id like this:
class SkipEchoRequestIdPolicy: HttpPipelinePolicy {
companion object {
private val REQUEST_ID_HEADER: HttpHeaderName? = HttpHeaderName.fromString("x-ms-client-request-id")
}
override fun process(context: HttpPipelineCallContext, next: HttpPipelineNextPolicy): Mono<HttpResponse?>? {
context.setData(Constants.SKIP_ECHO_VALIDATION_KEY, listOf(REQUEST_ID_HEADER))
return next.process()
}
override fun processSync(context: HttpPipelineCallContext, next: HttpPipelineNextSyncPolicy): HttpResponse? {
context.setData(Constants.SKIP_ECHO_VALIDATION_KEY, listOf(REQUEST_ID_HEADER))
return next.processSync()
}
}
creating my client like this:
BlobServiceClientBuilder()
.endpoint(endpoint)
.let {
accountKey?.let { key ->
it.credential(StorageSharedKeyCredential(accountName, key))
} ?: it
}
.addPolicy(SkipEchoRequestIdPolicy())
.buildClient()
@acfaf Thanks for the sample.
Just to add some context around this error: the policy that checks for mismatched x-ms-client-request-id values was originally introduced to catch rare server-side bugs where the storage service returned a different ID than what the SDK sent. While this is significantly less common now, mismatches can still occur due to a few reasons:
- Retry logic: By default, the SDK is designed to preserve the original client-request-id across retries. However, if a custom retry policy is in use, that logic might not be preserved, and a new ID could be generated for each retry — potentially leading to mismatches.
- Middleware interference: Proxies, VPNs, or custom HTTP pipeline policies might modify headers or responses, affecting the ID.
- Parallel or async execution: If the code is part of a larger asynchronous or multi-threaded flow, multiple requests might be sent concurrently, causing ID mismatches.
Although the policy you've implemented should work as intended, it might still be helpful to investigate the root cause of the mismatch. Understanding what’s triggering it could provide more confidence in the robustness of the solution and help prevent similar issues in the future.
To help identify the root cause, we’ll need a bit more information:
- Enable network logging (more info on how to do this here)
- Details about the execution context (e.g., is this part of a parallel or async flow?)
- Any other custom policies or middleware in use
Let us know what you find, and we’ll be happy to dig deeper!
@ibrandes thank you for the additional context.
I am currently running my code on a public Azure VM running Ubuntu 20.04.6 LTS inside a docker container. No proxies, vpns or outgoing firewall rules are set up. I am using kotlin coroutines in general, but the part of code in question is executed sequentially, no asynchronous requests done. This is also shown in the logs, as one request is always followed by one response. I can see though, that the first responses give the correct request id and every subsequent responses are just return the same request id.
Below I added a cleaned up version of the logs, to just include the most relevant fields. If you need more information from the logs, please let me know.
[
{
"url":0,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"833c39f9-f123-4ee8-9caf-2947f3dbb6f7",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":0,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"833c39f9-f123-4ee8-9caf-2947f3dbb6f7",
"x-ms-version":"2025-07-05"
},
{
"url":0,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"72f52267-cdcc-490e-bd6f-ea5dac407cb9",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":0,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"72f52267-cdcc-490e-bd6f-ea5dac407cb9",
"x-ms-version":"2025-07-05"
},
{
"url":1,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":1,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"1f6a6898-1328-403c-9013-56a229712a65",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"de3481b3-416f-483b-bf4a-ddf6b46c7ab6",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"288cffd6-c754-443e-a120-31b338d316b4",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"8ee82986-c5f1-4ba6-9867-0aa219c41e8f",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"6e195127-0805-40ac-823e-e7ff1c2bbbdb",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"8d522013-bc38-4c6d-82c9-771e07b4b3e2",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"4ea7a25f-8000-42ff-bafc-c9cb028d39eb",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"47bd7143-a8ce-4421-8c14-11037dee83c6",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"a14be334-8c03-4d93-90df-de01a6a45a4c",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"01ccb33c-39aa-4a44-947d-6c6a1249bf65",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"13aff23c-29dd-4829-b534-ec066dffd742",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"619fd946-86c9-4df7-9f7f-47abd089ddb9",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"aeba5aad-08d7-43ff-8fcd-e9ea60fe2798",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"6a9d631a-c33b-4cf4-b1bb-7bdd53000e90",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"baa84997-3ec2-47cf-805e-e37412561c83",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"5345a514-8bc3-404a-968c-3ffdadedef97",
"tryCount":1,
"x-ms-version":"2025-07-05"
},
{
"url":2,
"statusCode":200,
"az.sdk.message":"HTTP response",
"x-ms-client-request-id":"b4a2802a-a8ad-4b52-b27b-3553e905d81a",
"x-ms-version":"2025-07-05"
},
{
"url":2,
"az.sdk.message":"HTTP request",
"x-ms-client-request-id":"e19d5ed5-83a8-4647-a130-d5b1ed28cf14",
"tryCount":1,
"x-ms-version":"2025-07-05"
}
]
Hi @s17b2-voroneckij, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!
Hi all and apologies for the delay in responding. I ran the very same code as before, with this dependency:
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>12.31.2</version>
</dependency>
The first time, it ran successfully, but on the second time, I got error:
/home/dima/.jdks/corretto-21.0.7/bin/java -javaagent:/home/dima/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate/lib/idea_rt.jar=46183 -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath /home/dima/IdeaProjects/javapr/target/classes:/home/dima/.m2/repository/com/azure/azure-storage-blob/12.31.2/azure-storage-blob-12.31.2.jar:/home/dima/.m2/repository/com/azure/azure-xml/1.2.0/azure-xml-1.2.0.jar:/home/dima/.m2/repository/com/azure/azure-core/1.56.0/azure-core-1.56.0.jar:/home/dima/.m2/repository/com/azure/azure-json/1.5.0/azure-json-1.5.0.jar:/home/dima/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.18.4/jackson-annotations-2.18.4.jar:/home/dima/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.18.4.1/jackson-core-2.18.4.1.jar:/home/dima/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.18.4/jackson-databind-2.18.4.jar:/home/dima/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.18.4/jackson-datatype-jsr310-2.18.4.jar:/home/dima/.m2/repository/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar:/home/dima/.m2/repository/io/projectreactor/reactor-core/3.7.8/reactor-core-3.7.8.jar:/home/dima/.m2/repository/org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4.jar:/home/dima/.m2/repository/com/azure/azure-core-http-netty/1.16.0/azure-core-http-netty-1.16.0.jar:/home/dima/.m2/repository/io/netty/netty-handler/4.1.123.Final/netty-handler-4.1.123.Final.jar:/home/dima/.m2/repository/io/netty/netty-resolver/4.1.123.Final/netty-resolver-4.1.123.Final.jar:/home/dima/.m2/repository/io/netty/netty-transport/4.1.123.Final/netty-transport-4.1.123.Final.jar:/home/dima/.m2/repository/io/netty/netty-handler-proxy/4.1.123.Final/netty-handler-proxy-4.1.123.Final.jar:/home/dima/.m2/repository/io/netty/netty-codec-socks/4.1.123.Final/netty-codec-socks-4.1.123.Final.jar:/home/dima/.m2/repository/io/netty/netty-buffer/4.1.123.Final/netty-buffer-4.1.123.Final.jar:/home/dima/.m2/repository/io/netty/netty-codec/4.1.123.Final/netty-codec-4.1.123.Final.jar:/home/dima/.m2/repository/io/netty/netty-codec-http/4.1.123.Final/netty-codec-http-4.1.123.Final.jar:/home/dima/.m2/repository/io/netty/netty-codec-http2/4.1.123.Final/netty-codec-http2-4.1.123.Final.jar:/home/dima/.m2/repository/io/netty/netty-transport-native-unix-common/4.1.123.Final/netty-transport-native-unix-common-4.1.123.Final.jar:/home/dima/.m2/repository/io/netty/netty-transport-native-epoll/4.1.123.Final/netty-transport-native-epoll-4.1.123.Final-linux-x86_64.jar:/home/dima/.m2/repository/io/netty/netty-transport-classes-epoll/4.1.123.Final/netty-transport-classes-epoll-4.1.123.Final.jar:/home/dima/.m2/repository/io/netty/netty-transport-native-kqueue/4.1.123.Final/netty-transport-native-kqueue-4.1.123.Final-osx-x86_64.jar:/home/dima/.m2/repository/io/netty/netty-transport-classes-kqueue/4.1.123.Final/netty-transport-classes-kqueue-4.1.123.Final.jar:/home/dima/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.72.Final/netty-tcnative-boringssl-static-2.0.72.Final.jar:/home/dima/.m2/repository/io/netty/netty-tcnative-classes/2.0.72.Final/netty-tcnative-classes-2.0.72.Final.jar:/home/dima/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.72.Final/netty-tcnative-boringssl-static-2.0.72.Final-linux-x86_64.jar:/home/dima/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.72.Final/netty-tcnative-boringssl-static-2.0.72.Final-linux-aarch_64.jar:/home/dima/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.72.Final/netty-tcnative-boringssl-static-2.0.72.Final-osx-x86_64.jar:/home/dima/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.72.Final/netty-tcnative-boringssl-static-2.0.72.Final-osx-aarch_64.jar:/home/dima/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.72.Final/netty-tcnative-boringssl-static-2.0.72.Final-windows-x86_64.jar:/home/dima/.m2/repository/io/projectreactor/netty/reactor-netty-http/1.2.8/reactor-netty-http-1.2.8.jar:/home/dima/.m2/repository/io/netty/netty-resolver-dns/4.1.122.Final/netty-resolver-dns-4.1.122.Final.jar:/home/dima/.m2/repository/io/netty/netty-codec-dns/4.1.122.Final/netty-codec-dns-4.1.122.Final.jar:/home/dima/.m2/repository/io/netty/netty-resolver-dns-native-macos/4.1.122.Final/netty-resolver-dns-native-macos-4.1.122.Final-osx-x86_64.jar:/home/dima/.m2/repository/io/netty/netty-resolver-dns-classes-macos/4.1.122.Final/netty-resolver-dns-classes-macos-4.1.122.Final.jar:/home/dima/.m2/repository/io/projectreactor/netty/reactor-netty-core/1.2.8/reactor-netty-core-1.2.8.jar:/home/dima/.m2/repository/io/netty/netty-common/4.1.123.Final/netty-common-4.1.123.Final.jar:/home/dima/.m2/repository/com/azure/azure-storage-common/12.30.2/azure-storage-common-12.30.2.jar:/home/dima/.m2/repository/com/azure/azure-storage-internal-avro/12.16.2/azure-storage-internal-avro-12.16.2.jar org.example.Main
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.RuntimeException: Unexpected header value. Expected response to echo `x-ms-client-request-id: 74c575bb-0873-4cee-9175-73902a771e5c`. Got value `fbe30664-a91d-4b66-bd8e-b7d68ec521a0`.
at com.azure.storage.common.policy.ResponseValidationPolicyBuilder.lambda$addOptionalEcho$1(ResponseValidationPolicyBuilder.java:93)
at com.azure.storage.common.policy.ResponseValidationPolicyBuilder$ResponseValidationPolicy.lambda$process$0(ResponseValidationPolicyBuilder.java:132)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at com.azure.storage.common.policy.ResponseValidationPolicyBuilder$ResponseValidationPolicy.lambda$process$1(ResponseValidationPolicyBuilder.java:132)
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:113)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:158)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:158)
at reactor.core.publisher.Operators$MonoInnerProducerBase.complete(Operators.java:2864)
at reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:180)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onComplete(MonoFlatMapMany.java:261)
at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onComplete(FluxContextWrite.java:126)
at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2572)
at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.request(FluxContextWrite.java:136)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onSubscribeInner(MonoFlatMapMany.java:150)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onSubscribe(MonoFlatMapMany.java:246)
at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onSubscribe(FluxContextWrite.java:101)
at reactor.core.publisher.FluxJust.subscribe(FluxJust.java:68)
at reactor.core.publisher.Flux.subscribe(Flux.java:8891)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onNext(MonoFlatMapMany.java:196)
at reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)
at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onNext(FluxRetryWhen.java:178)
at reactor.core.publisher.MonoCreate$DefaultMonoSink.success(MonoCreate.java:176)
at reactor.netty.http.client.HttpClientConnect$HttpIOHandlerObserver.onStateChange(HttpClientConnect.java:449)
at reactor.netty.ReactorNetty$CompositeConnectionObserver.onStateChange(ReactorNetty.java:722)
at reactor.netty.resources.DefaultPooledConnectionProvider$DisposableAcquire.onStateChange(DefaultPooledConnectionProvider.java:207)
at reactor.netty.resources.DefaultPooledConnectionProvider$PooledConnection.onStateChange(DefaultPooledConnectionProvider.java:468)
at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:746)
at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:115)
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:224)
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.fireChannelRead(ByteToMessageDecoder.java:333)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:455)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
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:1519)
at io.netty.handler.ssl.SslHandler.decodeNonJdkCompatible(SslHandler.java:1390)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1430)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469)
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:1357)
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:868)
at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:799)
at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe$1.run(AbstractEpollChannel.java:425)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:405)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998)
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:1583)
Suppressed: java.lang.Exception: #block terminated with an error
at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:104)
at reactor.core.publisher.Mono.block(Mono.java:1779)
at com.azure.storage.common.implementation.StorageImplUtils.blockWithOptionalTimeout(StorageImplUtils.java:144)
at com.azure.storage.blob.specialized.BlobClientBase.downloadContent(BlobClientBase.java:1187)
at org.example.Main.main(Main.java:14)
@ibrandes do you know if this is no longer an issue now?
@samvaity We are still in the process of looking into this.