IOException: Transfer for nexus-maven-repository-index.zip failed

Hi,

1) I just updated to build #7935 and still have a same problem:

java.io.IOException: Transfer for nexus-maven-repository-index.zip failed; Error transferring file
at org.sonatype.nexus.index.updater.DefaultIndexUpdater.downloadResource(DefaultIndexUpdater.java:225)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater$1.invoke(DefaultIndexUpdater.java:73)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater.run(DefaultIndexUpdater.java:155)
at org.sonatype.nexus.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:49)
at org.jetbrains.idea.maven.indices.MavenIndex.updateRemoteContext(MavenIndex.java:294)
at org.jetbrains.idea.maven.indices.MavenIndex.updateContext(MavenIndex.java:264)
at org.jetbrains.idea.maven.indices.MavenIndex.update(MavenIndex.java:218)
at org.jetbrains.idea.maven.indices.MavenIndices.update(MavenIndices.java:115)
at org.jetbrains.idea.maven.indices.MavenIndicesManager.doUpdateIndices(MavenIndicesManager.java:153)
at org.jetbrains.idea.maven.indices.MavenIndicesManager.access$000(MavenIndicesManager.java:28)
at org.jetbrains.idea.maven.indices.MavenIndicesManager$1.run(MavenIndicesManager.java:132)
at com.intellij.openapi.progress.BackgroundTaskQueue$1.run(BackgroundTaskQueue.java:53)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$5.run(ProgressManagerImpl.java:3)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:12)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:72)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:9)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:2)
at com.intellij.openapi.application.impl.ApplicationImpl$5.run(ApplicationImpl.java:2)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:5)

This exception is in the log file when I try to update remote maven repository indices by clicking on Update button in Maven Integration plugin.

2) In this build there should be more detailed message as described in
http://www.jetbrains.net/jira/browse/IDEADEV-27950
but it's not :)

Edited by: Steve Hickson on Aug 7, 2008 1:20 PM. Added maven tag

28 comments
Comment actions Permalink

we have this error as well in 7925. its seems to be fine indexing the local repo, but it gives this error when trying to contact our Artifactory instance. it seems to contact http://repo1.maven.org/maven2 just fine though.

0
Comment actions Permalink

Steve,

This exception occurs in case Maven couldn't find any indices in the specified repository.
You shouldn't worry about it.
As for being more informative, it is, probably, a good idea to write something like 'The repository doesn't have an index file' instead. What do you think?

Thanks,
Anton Makeev

0
Comment actions Permalink

Hi, it depends if you know that repository really does not have the file.

I was investigating the issue little bit more. I found that in our artifactory which we have in our company there is the zip file available on the following url: http://maven:8081/artifactory/repo1-cache/.index/nexus-maven-repository-index.zip. The remote repository url visible in maven plugin is http://maven:8081/artifactory/repo. The repo is redirected to repo1-cache. So downloading http://maven:8081/artifactory/repo/.index/nexus-maven-repository-index.zip is working ok. The zip file is 23MB. Properties file is also downloadable.

So in my case the index file is there. Unfortunately the error in stack trace is so general that we don't know any details. Maybe IDEA could log url?

I found that Eclipse users had similar problems and solution was to run Eclipse in JDK instead of JRE. I tried this with IDEA but it did not help.

0
Comment actions Permalink

Hi,

I had the same problem at the office and it was because I'm behind an HTTP proxy.
It seems that the Maven plugin code doesn't use the proxy settings of IntelliJ so tried setting the standard Java environment properties for HTTP proxy and it worked!

To do that edit the idea.exe.vmoptions (under IDEA_HOME/bin) and append the following (configure to suit your environment):
-Dhttp.proxyHost=myProxy.com
-Dhttp.proxyPort=80
-Dhttp.nonProxyHosts=myLocalServer

Thanks Steve for pointing out where the IntelliJ log file is ... I didn't know that.

Another thing is that the error reported by IntelliJ doesn't give more detail because the original exception is not nested! but is not a fault of IntelliJ code is the Nexus Indexer code.
See IDEA_HOME/plugins/maven/lib/nexus-indexer-1.0.0-SNAPSHOT.jar, file org/sonatype/nexus/index/updater/DefaultIndexUpdater line 225:


void downloadResource(Wagon wagon, String name, File targetFile) throws IOException {
try {
wagon.get(name, targetFile);
}
catch (AuthorizationException e) {
throw new IOException((new StringBuilder()).append("Authorization exception retrieving ").append(name).toString());
}
catch (ResourceDoesNotExistException e) {
throw new IOException((new StringBuilder()).append("Resource ").append(name).append(" does not exist").toString());
}
catch (WagonException e) {
throw new IOException((new StringBuilder()).append("Transfer for ").append(name).append(" failed; ").append(e.getMessage()).toString()); // Line 225
}
}

0
Comment actions Permalink

This problem should have been fixed recently (in one of the 8.0 eaps). I've updated the bundled Wagon library that includes the bug fix. It shouldn't be necessary to change idea.properties files, the proxy settings are taken from Maven's settings.xml file.

Please let me know, if the problem still reccurs in the latest 8.0 eap.

Thanks,
Anton Makeev

0
Comment actions Permalink

I'm getting this error in 8.1 and I've triple-checked the URLs, the zip exists there, and I've turned off all the possible HTTP proxy settings (in my settings.xml as well as within IDEA Preferences).  What am I doing wrong?

0
Comment actions Permalink

Hi, Brain,

Probably your repository manager doesn't provide indexes.
What manager do you use?

Thanks,
Anton Makeev

0
Comment actions Permalink

Nexus 1.2.1 OSS is the version of Nexus I'm using.  That's what I meant when I said I triple-checked the URLs and that the zip exists.

0
Comment actions Permalink

Is your repository in public access? I could check it.

Thanks,
Anton Makeev

0
Comment actions Permalink

Sorry, its our internal private Nexus server.  I'll gladly run any commands you need for additional debugging information.  I'm suspecting its still getting its HTTP proxy information from somewhere and trying to go through our HTTP proxy to hit our internal server and failing.  This is on Mac OS X 10.5.6.  Is it possible that IDEA is using the Apple JVM and there by using the proxy settings setup under the System Preferences / Network panel?

0
Comment actions Permalink

Hi, Brian,

You said that you have disabled proxy settings, do your repository is behind a proxy? If so, try the workaround Juan suggested:
"It seems that the Maven plugin code doesn't use the proxy settings of IntelliJ so tried setting the standard Java environment properties for HTTP proxy and it worked!


To do that edit the idea.exe.vmoptions (under IDEA_HOME/bin) and append the following (configure to suit your environment):
-Dhttp.proxyHost=myProxy.com
-Dhttp.proxyPort=80
-Dhttp.nonProxyHosts=myLocalServer"

If not could you attach your pom.xml that declares the repository and your setting.xml file?

Thanks,
Anton Makeev

0
Comment actions Permalink

That worked, thank you.  Though since I'm on a Mac, I needed to make the change to the VMOptions entry in the Info.plist.

Is there a ticket open in your bug tracking system for this issue?

0
Comment actions Permalink

Does your settings.xml file contains the proxy information?
Thanks,
Anton Makeev

0
Comment actions Permalink

Changing the proxy settings in my settings.xml had no effect.  Before this final fix, I tried it with the http proxy settings in that file and without them, to no effect.  They are currently in the settings.xml since Maven itself uses those settings properly and I do need them.  The IDEA Maven plugin does not use the proxy settings from the settings.xml when trying to connect to the Nexus repositories.

0
Comment actions Permalink

IDEA uses Maven embedder to download the indices and it, in turn, uses settings.xml and proxies defined it this file.
Please check if Settings->Maven->Maven User Settings File path is set correctly.

Thanks,
Anton Makeev

0
Comment actions Permalink

Yes I've double and triple checked that setting over the past several weeks trying to debug this issue. The only thing that has finally worked was setting the system properties in the VMOptions.

0
Comment actions Permalink

Brian,

Please attach your settings.xml file.

Thanks,
Anton Makeev

0
Comment actions Permalink

I have the same problem with IDEA 9 and Nexus 1.3.4 Open Source. My index is available but downloading requires authentication. When IDEA tries to download the index it receives a HTTP 401 response but does not send the credentials. They are present in the settings.xml and standalone Maven is able to use them.

0
Comment actions Permalink

We are investigating the problem, I'll let you know when it is fixed.

Anton Makeev

0
Comment actions Permalink

Thanks. This is my settings.xml:

<settings>
  <mirrors>
    <mirror>
      <id>company</id>
      <mirrorOf>*</mirrorOf>
      <url>https://company/nexus/content/groups/all</url>
    </mirror>
  </mirrors>
  <profiles>
    <profile>
      <id>company-profile</id>
      <activation>
        <activeByDefault/>
      </activation>
      <repositories>
        <repository>
          <id>central</id>
          <url>https://company/nexus/content/groups/all</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>https://company/nexus/content/groups/all</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>company-profile</activeProfile>
  </activeProfiles>
  <servers>
     <server>
      <id>company</id>
      <username>user</username>
      <password>pass</password>
     </server>
     <server>
      <id>central</id>
      <username>user</username>
      <password>pass</password>
     </server>
  </servers>
</settings>

0
Comment actions Permalink

I have exactly the same problem. My nexus repo is not accesible anonymously and all versions of intelliJ fail to retrieve the indexes. My settings.conf is ok (maven works fine) and manually specified. If I enable anonymous access the indexes are retrieved.

This is what I see in the logs:

2009-07-14 19:55:42,430 [ 239249]   INFO -      #org.jetbrains.idea.maven - Failed to update Maven indices for: http://dev.***.nl/nexus/content/groups/public
java.io.IOException: Transfer for nexus-maven-repository-index.zip failed; Error transferring file
    at org.sonatype.nexus.index.updater.DefaultIndexUpdater.downloadResource(DefaultIndexUpdater.java:225)
    at org.sonatype.nexus.index.updater.DefaultIndexUpdater$1.invoke(DefaultIndexUpdater.java:73)
    at org.sonatype.nexus.index.updater.DefaultIndexUpdater.run(DefaultIndexUpdater.java:155)
    at org.sonatype.nexus.index.updater.DefaultIndexUpdater.fetchAndUpdateIndex(DefaultIndexUpdater.java:49)
    at org.jetbrains.idea.maven.indices.MavenIndex.updateContext(MavenIndex.java:320)
    at org.jetbrains.idea.maven.indices.MavenIndex.updateOrRepair(MavenIndex.java:263)
    at org.jetbrains.idea.maven.indices.MavenIndices.updateOrRepair(MavenIndices.java:136)
    at org.jetbrains.idea.maven.indices.MavenIndicesManager.doUpdateIndices(MavenIndicesManager.java:245)
    at org.jetbrains.idea.maven.indices.MavenIndicesManager.access$200(MavenIndicesManager.java:41)
    at org.jetbrains.idea.maven.indices.MavenIndicesManager$3.run(MavenIndicesManager.java:224)
    at com.intellij.openapi.progress.BackgroundTaskQueue$1.run(BackgroundTaskQueue.java:58)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:8)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:6)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:20)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:66)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:11)
    at com.intellij.openapi.application.impl.ApplicationImpl$5.run(ApplicationImpl.java:10)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:10)

0
Comment actions Permalink

Hi,

I've fixed the problem (hopefully) and updated the bundled nexus library.

IDEA will use proxy/mirror/authentication settings from Maven's settings.xml file.

Please try the next eap and let me know if you still have any problem downloading the indices.

Thanks,

Anton Makeev

0
Comment actions Permalink

I am still having the issue with latest IDEA version. We have a similar settings.xml. Is it resolved ?
Mathieu.

0
Comment actions Permalink

I think the problem is still there.

I think the root cause is that when mirrorOf * is used the credentials for the mirror's id are not looked up, adding a server with id=central allowed the required download to work

0
Comment actions Permalink

With latest 11 RC2 and latest nexus 2.0.2 the problem still exists

0
Comment actions Permalink

Im new to intellij and trying to run through a Maven Spring tutorial but have problems also with repositories for maven not loading.

I tried setting the proxy setting in the idea64.exe.vmoptions but update still fails with:

java.lang.RuntimeException: java.io.IOException: Tansfer for nexus-maven-repository-index.properties failed.

 

Not sure where to go from here.

0
Comment actions Permalink

I had the same problem as described in the original post (manual download of index from . I was able to resolve it by specifying 2 proxy servers in the settings.xml. Now my <home dir>/.m2/settings.xml contains following:

<settings>
  <proxies>
    <proxy>
      <id>HTTP proxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy</host>
      <port>8080</port>
    </proxy>

    <proxy>
      <id>HTTPS proxy</id>
      <active>true</active>
      <protocol>https</protocol>
      <host>proxy</host>
      <port>8080</port>
    </proxy>
 </proxies>
</settings>

Looks like <protocol> makes sense when downloading indexes from remote repositories. E.g. repository is defined with https scheme in Settings -> Maven -> Repositories.

1
Comment actions Permalink

Thanks, Tysonite!

0

Please sign in to leave a comment.