# "java.io.IOException: java.util.concurrent.TimeoutException: Idle timeout expired: 30000/30000 ms" when up- or downloading large files

**URL:** <https://community.sonatype.com/t/java-io-ioexception-java-util-concurrent-timeoutexception-idle-timeout-expired-30000-30000-ms-when-up-or-downloading-large-files/2891>\
**Category:** Sonatype Nexus Repository\
**Tags:** docker\
**Created:** [November 11, 2019, 10:44am UTC](https://community.sonatype.com/t/java-io-ioexception-java-util-concurrent-timeoutexception-idle-timeout-expired-30000-30000-ms-when-up-or-downloading-large-files/2891 "2019-11-11T10:44:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![y.schinko](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@y.schinko](https://community.sonatype.com/u/y.schinko)\
**Post date:** [November 11, 2019, 10:44am UTC](https://community.sonatype.com/t/java-io-ioexception-java-util-concurrent-timeoutexception-idle-timeout-expired-30000-30000-ms-when-up-or-downloading-large-files/2891/1 "2019-11-11T10:44:19Z")

</div>

Hi. I’ve been running it an issue that has been bugging me for quite a while.  
I work with fairly large Docker images and when up- or downloading them nexus often closes the connection during the up- or download. Docker is able to continue the up- or download so it’s not the end of the world but it’s annoying nonetheless.

Now I did some research into this and several people mentioned that having the server behind a reverse proxy can cause this issue. So I naturally first checked the nginx logs.

There I find lines like these:

```auto
2019/11/11 10:26:13 [error] 21720#21720: *2161084 upstream prematurely closed connection while reading upstream, client: 10.128.1.20, server: master.docker.company.com, request: "GET /v2/comapany/container/blobs/sha256:6db61c12b54fca0d0df15ae2a1fe198685a25e722863bf062201d9632b394924 HTTP/1.1", upstream: "http://127.0.0.1:811/v2/company/container/blobs/sha256:6db61c12b54fca0d0df15ae2a1fe198685a25e722863bf062201d9632b394924", host: "master.docker.company.com"

```

And in the nexus log I find this:

```auto
2019-11-11 10:25:23,132+0000 WARN [qtp1708054081-6023] docker-access org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: GET /repository/docker-master/v2/company/container/blobs/sha256:6db61c12b54fca0d0df15ae2a1fe198685a25e722863bf062201d9632b394924
java.io.IOException: java.util.concurrent.TimeoutException: Idle timeout expired: 30000/30000 ms
        at org.eclipse.jetty.util.SharedBlockingCallback$Blocker.block(SharedBlockingCallback.java:235)
        at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:226)
        at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:524)
        at com.google.common.io.ByteStreams.copy(ByteStreams.java:113)
        at org.sonatype.nexus.repository.view.Payload.copy(Payload.java:61)
        at org.sonatype.nexus.repository.httpbridge.internal.DefaultHttpResponseSender.send(DefaultHttpResponseSender.java:81)
        at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.dispatchAndSend(ViewServlet.java:228)
        at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.doService(ViewServlet.java:174)
        at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.service(ViewServlet.java:126)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:276)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:181)
        at com.google.inject.servlet.DynamicServletPipeline.service(DynamicServletPipeline.java:71)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:112)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
        at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
        at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
        at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
        at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
        at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
        at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
        at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
        at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
        at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
        at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
        at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
        at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
        at org.sonatype.nexus.security.SecurityFilter.executeChain(SecurityFilter.java:85)
        at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
        at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
        at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
        at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
        at org.sonatype.nexus.security.SecurityFilter.doFilterInternal(SecurityFilter.java:101)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at org.sonatype.nexus.repository.httpbridge.internal.ExhaustRequestFilter.doFilter(ExhaustRequestFilter.java:80)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.sonatype.nexus.licensing.internal.LicensingRedirectFilter.doFilter(LicensingRedirectFilter.java:114)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:112)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at org.sonatype.nexus.internal.web.ErrorPageFilter.doFilter(ErrorPageFilter.java:79)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at org.sonatype.nexus.internal.web.EnvironmentFilter.doFilter(EnvironmentFilter.java:101)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at org.sonatype.nexus.internal.web.HeaderPatternFilter.doFilter(HeaderPatternFilter.java:98)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.inject.servlet.DynamicFilterPipeline.dispatch(DynamicFilterPipeline.java:104)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:135)
        at org.sonatype.nexus.bootstrap.osgi.DelegatingFilter.doFilter(DelegatingFilter.java:73)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at com.codahale.metrics.jetty9.InstrumentedHandler.handle(InstrumentedHandler.java:239)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:152)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at org.eclipse.jetty.server.Server.handle(Server.java:505)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.TimeoutException: Idle timeout expired: 30000/30000 ms
        at org.eclipse.jetty.io.IdleTimeout.checkIdleTimeout(IdleTimeout.java:166)
        at org.eclipse.jetty.io.IdleTimeout$1.run(IdleTimeout.java:50)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        ... 1 common frames omitted

```

Those are from the same event btw, so it looks like nexus is failing first, which leads me to believe that is actually not nginx causing the issues here.

Just to be sure, this is my nginx config:

```nginx
server {
        listen 443 ssl http2;

        server_name master.docker.company.com;

        ssl_certificate /etc/letsencrypt/live/company.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/company.com/privkey.pem;

        include global/ssl.conf;
        client_max_body_size 4096m;

        location / {
                proxy_pass http://127.0.0.1:811/;

                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
        }
}

```

Additionally I have increased timeouts in the nginx.conf:

```nginx
http {
...
        ##
        # Proxy settings
        ##

        proxy_connect_timeout 10s;
        proxy_send_timeout 1h;
        proxy_read_timeout 1h;
        send_timeout 1h;
...
}

```

Any idea what’s going on here?

---

<div class="post-metadata">

**Author:** ![rseddon](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/rseddon/32/341_2.png) [@rseddon](https://community.sonatype.com/u/rseddon)\
**Post date:** [November 11, 2019, 2:31pm UTC](https://community.sonatype.com/t/java-io-ioexception-java-util-concurrent-timeoutexception-idle-timeout-expired-30000-30000-ms-when-up-or-downloading-large-files/2891/2 "2019-11-11T14:31:56Z")

</div>

Disable “proxy\_buffering” in nginx, that should solve this. See here:

[https://help.sonatype.com/display/NXRM3/Run+Behind+a+Reverse+Proxy#RunBehindaReverseProxy-nginx](https://help.sonatype.com/display/NXRM3/Run+Behind+a+Reverse+Proxy#RunBehindaReverseProxy-nginx)

Rich

---

<div class="post-metadata">

**Author:** ![y.schinko](https://avatars.discourse-cdn.com/v4/letter/y/a183cd/32.png) [@y.schinko](https://community.sonatype.com/u/y.schinko)\
**Post date:** [November 13, 2019, 8:19am UTC](https://community.sonatype.com/t/java-io-ioexception-java-util-concurrent-timeoutexception-idle-timeout-expired-30000-30000-ms-when-up-or-downloading-large-files/2891/3 "2019-11-13T08:19:45Z")

</div>

This does appear to fix it. Thank you!

---

<div class="post-metadata">

**Author:** ![rymmis](https://avatars.discourse-cdn.com/v4/letter/r/ad7895/32.png) [@rymmis](https://community.sonatype.com/u/rymmis)\
**Post date:** [November 15, 2019, 1:32pm UTC](https://community.sonatype.com/t/java-io-ioexception-java-util-concurrent-timeoutexception-idle-timeout-expired-30000-30000-ms-when-up-or-downloading-large-files/2891/4 "2019-11-15T13:32:20Z")

</div>

Hi Rich,

By any chance you know why I could see the same problem running Nexus behind Apache HTTP. We are seeing exactly the same WARN messages.

The configuration of apache is very similar to what’s described in the link you have provided. It seems to work without any issue in our pilot environment where the load is not really great. But as soon as we move it to environment where there a lot of docker pulls (huge and small layers) it gives us this.

I would really appreciate your input. Thanks!

---

<div class="post-metadata">

**Author:** ![mgassmann](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@mgassmann](https://community.sonatype.com/u/mgassmann)\
**Post date:** [May 4, 2020, 9:37am UTC](https://community.sonatype.com/t/java-io-ioexception-java-util-concurrent-timeoutexception-idle-timeout-expired-30000-30000-ms-when-up-or-downloading-large-files/2891/5 "2020-05-04T09:37:06Z")

</div>

I am having the same issue without any proxy.  
We are running Jenkins and Nexus on the same host as docker containers.  
The Jenkins build fails from time to time and the Nexus log shows the exception mentioned above.

Any other ideas to handle this issue?

---

<div class="post-metadata">

**Author:** ![joeche214](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@joeche214](https://community.sonatype.com/u/joeche214)\
**Post date:** [May 9, 2020, 2:46am UTC](https://community.sonatype.com/t/java-io-ioexception-java-util-concurrent-timeoutexception-idle-timeout-expired-30000-30000-ms-when-up-or-downloading-large-files/2891/6 "2020-05-09T02:46:45Z")

</div>

Hi Mike, how are you.  
I am having the similar issue, have you find a solution already?

---

<div class="post-metadata">

**Author:** ![mgassmann](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@mgassmann](https://community.sonatype.com/u/mgassmann)\
**Post date:** [May 11, 2020, 6:09am UTC](https://community.sonatype.com/t/java-io-ioexception-java-util-concurrent-timeoutexception-idle-timeout-expired-30000-30000-ms-when-up-or-downloading-large-files/2891/7 "2020-05-11T06:09:58Z")

</div>

I have no solution yet. But i found out that our Nexus container is also behind a web layer proxy, so the issue described in other postings also apply.  
I tried to put Jenkins and Nexus in the same docker network but each HTTP request leaves the host and flows through the proxy. I thought this could help, but it didn’t, at least so far.

---

<div class="post-metadata">

**Author:** ![bhanupathak](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@bhanupathak](https://community.sonatype.com/u/bhanupathak)\
**Post date:** [May 21, 2020, 5:05pm UTC](https://community.sonatype.com/t/java-io-ioexception-java-util-concurrent-timeoutexception-idle-timeout-expired-30000-30000-ms-when-up-or-downloading-large-files/2891/8 "2020-05-21T17:05:07Z")

</div>

We are also facing the same issue “java.io.IOException: java.util.concurrent.TimeoutException: Idle timeout expired: 30000/30000 ms” we are running Nexus version 3.22.1-02 and there is no proxy in between ,Is there a setting which we can tweak to make it work , one more thing we have this issue for each kind of repo(maven,nuget and npm) specially when we are uploading some artifacts.

---

<div class="post-metadata">

**Author:** ![nicolas](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/nicolas/32/1768_2.png) [@nicolas](https://community.sonatype.com/u/nicolas)\
**Post date:** [April 15, 2021, 7:58am UTC](https://community.sonatype.com/t/java-io-ioexception-java-util-concurrent-timeoutexception-idle-timeout-expired-30000-30000-ms-when-up-or-downloading-large-files/2891/9 "2021-04-15T07:58:38Z")

</div>

Did you find a solution to solve this problem?

---

<div class="post-metadata">

**Author:** ![mpiggott](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mpiggott](https://community.sonatype.com/u/mpiggott)\
**Post date:** [April 15, 2021, 6:11pm UTC](https://community.sonatype.com/t/java-io-ioexception-java-util-concurrent-timeoutexception-idle-timeout-expired-30000-30000-ms-when-up-or-downloading-large-files/2891/10 "2021-04-15T18:11:19Z")

</div>

Check your reverse proxies, virus scanners, etc. something that interferes with network traffic is going to be the cause of your problem.
