# Error auto-installing maven tool

**URL:** <https://community.jenkins.io/t/error-auto-installing-maven-tool/12094>\
**Category:** Using Jenkins\
**Tags:** question, pipeline\
**Created:** [January 30, 2024, 8:23am UTC](https://community.jenkins.io/t/error-auto-installing-maven-tool/12094 "2024-01-30T08:23:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgpiury](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@dgpiury](https://community.jenkins.io/u/dgpiury)\
**Post date:** [January 30, 2024, 8:23am UTC](https://community.jenkins.io/t/error-auto-installing-maven-tool/12094/1 "2024-01-30T08:23:50Z")

</div>

We recently changed jenkins agent nodes for more updated ones (updated OS and libraries) and we have found that now we cannot automatically install maven tools. We have another environment with the old nodes and the same jenkins version and it works here.

It doesn’t seem to be a connectivity issue since if we try to download maven, unpack it and move to the target path using sh commands inside a pipeline it works, but when we try to use it as a Tool and select “install automatically from apache” it show the following error:

```auto
Unpacking https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip to /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven-3.9.4 on slave-test-02
ERROR: Failed to download https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip from agent; will retry from controller
java.io.IOException: No such file or directory
	at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
	at java.base/java.io.File.createTempFile(File.java:2129)
	at java.base/java.io.File.createTempFile(File.java:2175)
	at hudson.FilePath.unzip(FilePath.java:701)
	at hudson.FilePath$Unpack.invoke(FilePath.java:1084)
Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to slave-test-02
		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1787)
		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
		at hudson.remoting.Channel.call(Channel.java:1003)
		at hudson.FilePath.act(FilePath.java:1192)
		at hudson.FilePath.act(FilePath.java:1181)
		at hudson.FilePath.installIfNecessaryFrom(FilePath.java:1044)
		at hudson.FilePath.installIfNecessaryFrom(FilePath.java:980)
		at hudson.tools.ZipExtractionInstaller.performInstallation(ZipExtractionInstaller.java:86)
		at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:70)
		at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:109)
		at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:221)
		at hudson.tasks.Maven$MavenInstallation.forNode(Maven.java:683)
		at hudson.tasks.Maven$MavenInstallation.forNode(Maven.java:496)
		at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:157)
		at org.jenkinsci.plugins.workflow.steps.ToolStep$Execution.run(ToolStep.java:138)
		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
Caused: java.io.IOException: Failed to unpack https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip (0 bytes read)
	at hudson.FilePath$Unpack.invoke(FilePath.java:1089)
	at hudson.FilePath$Unpack.invoke(FilePath.java:1072)
	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3578)
	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
	at hudson.remoting.Request$2.run(Request.java:377)
	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

```

We don’t know what else we can check to solve this.

---

<div class="post-metadata">

**Author:** ![doofus\_canadensis](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/doofus_canadensis/32/771_2.png) [@doofus\_canadensis](https://community.jenkins.io/u/doofus_canadensis)\
**Post date:** [January 30, 2024, 3:42pm UTC](https://community.jenkins.io/t/error-auto-installing-maven-tool/12094/2 "2024-01-30T15:42:03Z")

</div>

> [@dgpiury](#):
>
> ```auto
> ERROR: Failed to download https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip from agent; will retry from controller
> 
> ```

> [@dgpiury](#):
>
> `Caused: java.io.IOException: Failed to unpack https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip (0 bytes read)`

These are your key lines in the output. It looks like this web site isn’t accessible from your agent. Can you test that by logging into the agent directly?

---

<div class="post-metadata">

**Author:** ![Ian\_W](https://avatars.discourse-cdn.com/v4/letter/i/cab0a1/32.png) [@Ian\_W](https://community.jenkins.io/u/Ian_W)\
**Post date:** [January 31, 2024, 8:00am UTC](https://community.jenkins.io/t/error-auto-installing-maven-tool/12094/3 "2024-01-31T08:00:42Z")

</div>

Perhaps check if your old nodes had an outbound proxy available to the agent account not configured on the new ones? Remember that an agent uses a non-interactive shell so environment variables may not be set or set properly.

ps: latest maven is now 3.9.6

---

<div class="post-metadata">

**Author:** ![dgpiury](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@dgpiury](https://community.jenkins.io/u/dgpiury)\
**Post date:** [January 31, 2024, 9:19am UTC](https://community.jenkins.io/t/error-auto-installing-maven-tool/12094/4 "2024-01-31T09:19:55Z")

</div>

I found the solution!, problem was that we had configured jenkins process startup with a java parameter where we indicated a route that no longer exists in the new agent, we realized that when doing a “ps -a” and check that our jenkins process was with this parameter “-Dtmp. out.dir=…”

Logs are not really usseful in these case…

Now we are facing another issue with config file parameter… where jenkins cannot copy the maven settings.xml (defined in managed file) to the agent workspace… Again logs doesn’t show anything, pipeline just get stucked copying until timeout… I have to investigate this.

Thanks.
