Uploaded image for project: 'Dev - Nexus'
  1. Dev - Nexus
  2. NEXUS-5218

Cannot fetch remote index for repository "Central", SocketTimeoutException: Read timed out - with Java 7

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      Nexus 2.1.1 on Windows 7 64-bit with Java SDK 1.7.0_06 (both 32 and 64.bit)
    • Release Note:
      Yes

      Description

      After I installed Nexus and enabled remote index download for repository "Central" following exception occurred (Excerpt from the log-file):

      jvm 1 | 2012-08-18 20:05:11 ERROR [pool-1-thread-1] - org.apache.maven.index.updater.DefaultIndexUpdater - Fallback to *.zip also failed: org.sonatype.nexus.proxy.RemoteStorageException: Transport error while executing GET method [repositoryId="central", requestPath="/.index/nexus-maven-repository-index.zip", remoteUrl="http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.zip"]
      jvm 1 | 2012-08-18 20:05:11 WARN [pool-1-thread-1] - org.sonatype.nexus.index.DefaultIndexerManager - Cannot fetch remote index for repository "Central" [id=central]
      jvm 1 | java.net.SocketTimeoutException: Read timed out
      jvm 1 | at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.7.0_06]
      jvm 1 | at java.net.SocketInputStream.read(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at java.net.SocketInputStream.read(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at java.io.BufferedInputStream.read1(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at java.io.BufferedInputStream.read(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at org.apache.commons.httpclient.ContentLengthInputStream.read(Unknown Source) ~[commons-httpclient-3.1.SONATYPE.jar:3.1]
      jvm 1 | at java.io.FilterInputStream.read(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at org.apache.commons.httpclient.AutoCloseInputStream.read(Unknown Source) ~[commons-httpclient-3.1.SONATYPE.jar:3.1]
      jvm 1 | at org.sonatype.nexus.util.WrappingInputStream.read(WrappingInputStream.java:59) ~[nexus-utils-2.1.1.jar:na]
      jvm 1 | at org.sonatype.nexus.proxy.storage.remote.commonshttpclient.HttpClientInputStream.read(HttpClientInputStream.java:95) ~[nexus-proxy-2.1.1.jar:na]
      jvm 1 | at java.io.BufferedInputStream.read1(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at java.io.BufferedInputStream.read(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at java.io.BufferedInputStream.fill(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at java.io.BufferedInputStream.read1(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at java.io.BufferedInputStream.read(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at java.util.zip.InflaterInputStream.fill(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at java.util.zip.InflaterInputStream.read(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at java.util.zip.GZIPInputStream.read(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at java.io.DataInputStream.readFully(Unknown Source) ~[na:1.7.0_06]
      jvm 1 | at org.apache.maven.index.updater.IndexDataReader.readUTF(IndexDataReader.java:193)~[indexer-core-4.1.3-SONATYPE.jar:4.1.3-SONATYPE]
      jvm 1 | at org.apache.maven.index.updater.IndexDataReader.readField(IndexDataReader.java:162) ~[indexer-core-4.1.3-SONATYPE.jar:4.1.3-SONATYPE]
      jvm 1 | at org.apache.maven.index.updater.IndexDataReader.readDocument(IndexDataReader.java:137) ~[indexer-core-4.1.3-SONATYPE.jar:4.1.3-SONATYPE]
      jvm 1 | at org.apache.maven.index.updater.IndexDataReader.readIndex(IndexDataReader.java:90) ~[indexer-core-4.1.3-SONATYPE.jar:4.1.3-SONATYPE]
      jvm 1 | at org.apache.maven.index.updater.DefaultIndexUpdater.unpackIndexData(DefaultIndexUpdater.java:509) ~[indexer-core-4.1.3-SONATYPE.jar:4.1.3-SONATYPE]
      jvm 1 | at org.apache.maven.index.updater.DefaultIndexUpdater.loadIndexDirectory(DefaultIndexUpdater.java:197) ~[indexer-core-4.1.3-SONATYPE.jar:4.1.3-SONATYPE]
      jvm 1 | at org.apache.maven.index.updater.DefaultIndexUpdater.access$300(DefaultIndexUpdater.java:76) ~[indexer-core-4.1.3-SONATYPE.jar:4.1.3-SONATYPE]
      jvm 1 | at org.apache.maven.index.updater.DefaultIndexUpdater$LuceneIndexAdaptor.setIndexFile(DefaultIndexUpdater.java:642) ~[indexer-core-4.1.3-SONATYPE.jar:4.1.3-SONATYPE]
      jvm 1 | at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:862) ~[indexer-core-4.1.3-SONATYPE.jar:4.1.3-SONATYPE]
      jvm 1 | at org.apache.maven.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:157) ~[indexer-core-4.1.3-SONATYPE.jar:4.1.3-SONATYPE]
      jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.updateRemoteIndex(DefaultIndexerManager.java:1139) [nexus-indexer-lucene-plugin-2.1.1.jar:na]
      jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.downloadRepositoryIndex(DefaultIndexerManager.java:1016) [nexus-indexer-lucene-plugin-2.1.1.jar:na]
      jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.reindexRepository(DefaultIndexerManager.java:890) [nexus-indexer-lucene-plugin-2.1.1.jar:na]
      jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.reindexRepository(DefaultIndexerManager.java:838) [nexus-indexer-lucene-plugin-2.1.1.jar:na]
      jvm 1 | at org.sonatype.nexus.index.DefaultIndexerManager.reindexRepository(DefaultIndexerManager.java:812) [nexus-indexer-lucene-plugin-2.1.1.jar:na]
      jvm 1 | at org.sonatype.nexus.tasks.ReindexTaskHandlerLegacy.reindexRepository(ReindexTaskHandlerLegacy.java:54) [nexus-indexer-lucene-plugin-2.1.1.jar:na]
      jvm 1 | at org.sonatype.nexus.tasks.AbstractIndexerTask.doRun(AbstractIndexerTask.java:69) [nexus-indexer-lucene-plugin-2.1.1.jar:na]
      jvm 1 | at org.sonatype.nexus.scheduling.AbstractNexusTask.call(AbstractNexusTask.java:158)[nexus-app-2.1.1.jar:na]
      jvm 1 | at org.sonatype.scheduling.DefaultScheduledTask.call(DefaultScheduledTask.java:459)[plexus-task-scheduler-1.6.0.jar:na]
      jvm 1 | at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [na:1.7.0_06]
      jvm 1 | at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.7.0_06]
      jvm 1 | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [na:1.7.0_06]
      jvm 1 | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(UnknownSource) [na:1.7.0_06]
      jvm 1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_06]
      jvm 1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_06]
      jvm 1 | at java.lang.Thread.run(Unknown Source) [na:1.7.0_06]

      The problem appears to be caused by Java 7 (the issue does not occur with Java 6) and its default use of IPv6.

      I solved the problem by adding the following line in the wrapper.conf properties file (directory $NEXUS_HOME/bin/jsw/conf):
      wrapper.java.additional.1=-Djava.net.preferIPv4Stack=true

      I can hardly imagine that this issue can be solved in the Nexus code but an entry in some Release Notes, FAQs or a hint in the log-file about activating IPv4 when a SocketTimeoutException: Read timed out happens during index download in a Java 7 environment might be helpful and spare others a few hours investigating this issue again

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                erikfk Erik
                Last Updated By:
                Rich Seddon
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: