# Maven Central dependency resolution constantly fails with "connect timed out"

**URL:** <https://travis-ci.community/t/maven-central-dependency-resolution-constantly-fails-with-connect-timed-out/4582>\
**Category:** Linux\
**Tags:** build-env\
**Created:** [August 6, 2019, 2:21pm UTC](https://travis-ci.community/t/maven-central-dependency-resolution-constantly-fails-with-connect-timed-out/4582 "2019-08-06T14:21:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottlowe](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/scottlowe/32/2436_2.png) [@scottlowe](https://travis-ci.community/u/scottlowe)\
**Post date:** [August 6, 2019, 2:21pm UTC](https://travis-ci.community/t/maven-central-dependency-resolution-constantly-fails-with-connect-timed-out/4582/1 "2019-08-06T14:21:11Z")

</div>

Hello,

We’ve had problems over the last few days with Maven dependencies failing to be retrieved from Maven Central due to connection timeouts.

My build is now failing 100% of the time with this same “connect timed out” error from the Maven Central repo. Other builds are failing with the same issue.

Could this is related to rate-limiting from Maven Central?

An example of a failing (private) build is this here: [https://travis-ci.com/Swirrl/muttnik/builds/121991654](https://travis-ci.com/Swirrl/muttnik/builds/121991654)

I have tried extending the timeout in my own settings.xml, but I have no idea if this is having any effect on the Travis Maven behaviour - it doesn’t seem to.

Can the timeout be extended, and if so what is the recommended approach?

Example stacktrace:

```auto
Error building classpath. Failed to read artifact descriptor for com.google.inject:guice:jar:no_aop:4.0
org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for com.google.inject:guice:jar:no_aop:4.0
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:323)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:192)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:253)
	at clojure.tools.deps.alpha.extensions.maven$eval709$fn__711.invoke(maven.clj:96)
	at clojure.lang.MultiFn.invoke(MultiFn.java:244)
	at clojure.tools.deps.alpha$expand_deps$fn__1083.invoke(alpha.clj:192)
	at clojure.tools.deps.alpha$expand_deps.invokeStatic(alpha.clj:191)
	at clojure.tools.deps.alpha$expand_deps.invoke(alpha.clj:172)
	at clojure.tools.deps.alpha$resolve_deps.invokeStatic(alpha.clj:239)
	at clojure.tools.deps.alpha$resolve_deps.invoke(alpha.clj:221)
	at clojure.tools.deps.alpha.script.make_classpath$create_classpath.invokeStatic(make_classpath.clj:59)
	at clojure.tools.deps.alpha.script.make_classpath$create_classpath.invoke(make_classpath.clj:52)
	at clojure.tools.deps.alpha.script.make_classpath$run.invokeStatic(make_classpath.clj:70)
	at clojure.tools.deps.alpha.script.make_classpath$run.invoke(make_classpath.clj:64)
	at clojure.tools.deps.alpha.script.make_classpath$_main.invokeStatic(make_classpath.clj:109)
	at clojure.tools.deps.alpha.script.make_classpath$_main.doInvoke(make_classpath.clj:84)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.core$apply.invokeStatic(core.clj:665)
	at clojure.main$main_opt.invokeStatic(main.clj:491)
	at clojure.main$main_opt.invoke(main.clj:487)
	at clojure.main$main.invokeStatic(main.clj:598)
	at clojure.main$main.doInvoke(main.clj:561)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.main.main(main.java:37)
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Could not transfer artifact com.google:google:pom:5 from/to central (https://repo1.maven.org/maven2/): connect timed out
	at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:178)
	at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:224)
	at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1051)
	at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:829)
	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:331)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:314)
	... 25 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact com.google:google:pom:5 from/to central (https://repo1.maven.org/maven2/): connect timed out
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:422)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:201)
	at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:174)
	... 30 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.google:google:pom:5 from/to central (https://repo1.maven.org/maven2/): connect timed out
	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:52)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:365)
	at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:583)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:259)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:498)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:399)
	... 33 more
Caused by: java.net.SocketTimeoutException: connect timed out
	at java.net.PlainSocketImpl.socketConnect(Native Method)

```

Thank you

---

<div class="post-metadata">

**Author:** ![potiuk](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/potiuk/32/1610_2.png) [@potiuk](https://travis-ci.community/u/potiuk)\
**Post date:** [August 6, 2019, 2:30pm UTC](https://travis-ci.community/t/maven-central-dependency-resolution-constantly-fails-with-connect-timed-out/4582/2 "2019-08-06T14:30:02Z")

</div>

We also have similar problems but with pulling images from docker. I think it is Travis-wide issue

```auto
Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

746+rm -rf -- /home/travis/build/apache/airflow/.build/cache/UVy7yccSkc

```

---

<div class="post-metadata">

**Author:** ![pauljamescleary](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@pauljamescleary](https://travis-ci.community/u/pauljamescleary)\
**Post date:** [August 6, 2019, 3:38pm UTC](https://travis-ci.community/t/maven-central-dependency-resolution-constantly-fails-with-connect-timed-out/4582/3 "2019-08-06T15:38:24Z")

</div>

+1 samsies

---

<div class="post-metadata">

**Author:** ![scottlowe](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/scottlowe/32/2436_2.png) [@scottlowe](https://travis-ci.community/u/scottlowe)\
**Post date:** [August 6, 2019, 5:10pm UTC](https://travis-ci.community/t/maven-central-dependency-resolution-constantly-fails-with-connect-timed-out/4582/4 "2019-08-06T17:10:54Z")

</div>

Could be related to this issue: [Travis Network Timeout Issue](https://travis-ci.community/t/travis-network-timeout-issue/4584)

---

<div class="post-metadata">

**Author:** ![scottlowe](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/scottlowe/32/2436_2.png) [@scottlowe](https://travis-ci.community/u/scottlowe)\
**Post date:** [August 7, 2019, 1:19pm UTC](https://travis-ci.community/t/maven-central-dependency-resolution-constantly-fails-with-connect-timed-out/4582/5 "2019-08-07T13:19:57Z")

</div>

This issue seems to have been fixed by the recent NAT gateway reversions, applied by Travis staff.

---

<div class="post-metadata">

**Author:** ![miguelduarte42](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/miguelduarte42/32/2443_2.png) [@miguelduarte42](https://travis-ci.community/u/miguelduarte42)\
**Post date:** [August 7, 2019, 2:22pm UTC](https://travis-ci.community/t/maven-central-dependency-resolution-constantly-fails-with-connect-timed-out/4582/6 "2019-08-07T14:22:04Z")

</div>

It’s working for me now

---

<div class="post-metadata">

**Author:** ![dominic](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/dominic/32/14_2.png) [@dominic](https://travis-ci.community/u/dominic)\
**Post date:** [August 13, 2019, 6:36pm UTC](https://travis-ci.community/t/maven-central-dependency-resolution-constantly-fails-with-connect-timed-out/4582/7 "2019-08-13T18:36:47Z")

</div>

We are sorry for the troubles you have experienced last week.

We needed to have new IP addresses safelisted over [at Maven Central](https://issues.sonatype.org/browse/MVNCENTRAL-4985?focusedCommentId=777221&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-777221). They were safelisted last Friday in the end. I’ll close this issue for now but please open a new one if it happens again.

---

<div class="post-metadata">

**Author:** ![dominic](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/dominic/32/14_2.png) [@dominic](https://travis-ci.community/u/dominic)\
**Post date:** [August 13, 2019, 6:36pm UTC](https://travis-ci.community/t/maven-central-dependency-resolution-constantly-fails-with-connect-timed-out/4582/8 "2019-08-13T18:36:51Z")

</div>


