java.io.FileNotFoundException: The specified user settings file does not exist: /tmp/osx-slave-1/workspace/Folder

Google Groups | aburda...@cloudbees.com (JIRA) | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    [JIRA] (JENKINS-36678) Configuration File Provider fails when inside Folder named with Spaces

    Google Groups | 8 months ago | aburda...@cloudbees.com (JIRA)
    java.io.FileNotFoundException: The specified user settings file does not exist: /tmp/osx-slave-1/workspace/Folder
  2. 0

    h3. Issue I have a Folder "Folder Test". Inside that folder I have a Pipeline job. I am using the config file provider to pass on maven settings to to my maven command: {code} sh "${tool 'mvn'}/bin/mvn clean install --settings ${env.GLOBAL_SETTINGS}" {code} I use the *Variable* option to pass them as Environment Variable. My build fails as it cannot find the file provided. The location of the settings file is truncated: {code} [ERROR] Error executing Maven. java.io.FileNotFoundException: The specified user settings file does not exist: /tmp/osx-slave-1/workspace/Folder at org.apache.maven.cli.configuration.SettingsXmlConfigurationProcessor.process(SettingsXmlConfigurationProcessor.java:91) at org.apache.maven.cli.MavenCli.configure(MavenCli.java:1017) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) {code} h3. More Information In the console logs, we can see that the space is encoded with *%20*. However when I echo the value of my environment variable, I can see it contains the space: {code} [Pipeline] wrap provisoning config files... copy managed file [MyGlobalSettings] to file:/tmp/osx-slave-1/workspace/Folder%20Test/test-bitbucket-team-project/test-space/master@tmp/config1407003690735796100tmp [Pipeline] { [Pipeline] sh [master] Running shell script + echo /tmp/osx-slave-1/workspace/Folder Test/test-bitbucket-team-project/test-space/master@tmp/config1407003690735796100tmp /tmp/osx-slave-1/workspace/Folder Test/test-bitbucket-team-project/test-space/master@tmp/config1407003690735796100tmp [Pipeline] tool [Pipeline] sh [master] Running shell script + /usr/local/Cellar/maven/3.3.9/libexec/bin/mvn clean install -X -Dmaven.test.skip=true --settings /tmp/osx-slave-1/workspace/Folder Test/test-bitbucket-team-project/test-space/master@tmp/config1407003690735796100tmp {code} I reproduce with Pipeline and a Freestyle job as well: {code} [...] copy managed file [MyGlobalSettings] to file:/tmp/je-1-home/workspace/Folder%20Test/test-junit@tmp/config297328061101523050tmp [test-junit] $ mvn -Dmaven.test.failure.ignore=true clean install --settings /tmp/je-1-home/workspace/Folder Test/test-junit@tmp/config297328061101523050tmp [ERROR] Error executing Maven. [ERROR] The specified user settings file does not exist: /tmp/je-1-home/workspace/Folder [...] {code} h3. How to Reproduce * Create a global maven config file `global-settings` * Create a pipeline to run a Maven project with the following Jenkinsfile: {code} node { stage 'Checkout' checkout scm stage 'Build Maven' wrap([$class: 'ConfigFileBuildWrapper', managedFiles: [[fileId: 'global-settings', targetLocation: '', variable: 'GLOBAL_SETTINGS']]]) { sh "echo {env.GLOBAL_SETTINGS}" sh "${tool 'mvn'}/bin/mvn clean install --settings ${env.GLOBAL_SETTINGS}" } } {code}

    Jenkins JIRA | 8 months ago | Allan BURDAJEWICZ
    java.io.FileNotFoundException: The specified user settings file does not exist: /tmp/osx-slave-1/workspace/Folder

    Root Cause Analysis

    1. java.io.FileNotFoundException

      The specified user settings file does not exist: /tmp/osx-slave-1/workspace/Folder

      at org.apache.maven.cli.configuration.SettingsXmlConfigurationProcessor.process()
    2. org.apache.maven
      SettingsXmlConfigurationProcessor.process
      1. org.apache.maven.cli.configuration.SettingsXmlConfigurationProcessor.process(SettingsXmlConfigurationProcessor.java:91)
      1 frame
    3. M3 Interceptor
      MavenCli.main
      1. org.apache.maven.cli.MavenCli.configure(MavenCli.java:1017)
      2. org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283)
      3. org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      3 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:498)
      4 frames
    5. Plexus
      Launcher.main
      1. org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      2. org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      3. org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      4. org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      4 frames