Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-11998

Shouldn't prevent build from starting if WS doesn't exist and we're using a pattern

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When trying to build a job that uses the cleanup plugin with a pattern, I get the following exception (where I replaced the real job name with $job_name):

      Deleting project workspace... FATAL: basedir /tmp/jenkins-root-ssh/workspace/$job_name does not exist.
      java.lang.IllegalStateException: basedir /tmp/jenkins-root-ssh/workspace/$job_name does not exist.
      	at org.apache.tools.ant.DirectoryScanner.scan(DirectoryScanner.java:852)
      	at hudson.plugins.ws_cleanup.Cleanup.invoke(Cleanup.java:30)
      	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2022)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:287)
      	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:680)
      

      Creating the directory made it stop complaining.

        Attachments

          Issue Links

            Activity

            Show
            jorgenpt Jørgen Tjernø added a comment - Proposed fix: https://github.com/jenkinsci/ws-cleanup-plugin/pull/2
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jørgen P. Tjernø
            Path:
            src/main/java/hudson/plugins/ws_cleanup/PreBuildCleanup.java
            src/main/java/hudson/plugins/ws_cleanup/WsCleanup.java
            http://jenkins-ci.org/commit/ws-cleanup-plugin/7de3080b62f1a4e93f047427e6bd335b7000e2ae
            Log:
            JENKINS-11998 Don't try to clean up without WS.

            This checks for ws.exists() before doing any work on it - this prevents an
            exception when using org.apache.tools.ant.DirectoryScanner.scan on an
            nonexistant directory.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jørgen P. Tjernø Path: src/main/java/hudson/plugins/ws_cleanup/PreBuildCleanup.java src/main/java/hudson/plugins/ws_cleanup/WsCleanup.java http://jenkins-ci.org/commit/ws-cleanup-plugin/7de3080b62f1a4e93f047427e6bd335b7000e2ae Log: JENKINS-11998 Don't try to clean up without WS. This checks for ws.exists() before doing any work on it - this prevents an exception when using org.apache.tools.ant.DirectoryScanner.scan on an nonexistant directory.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: vjuranek
            Path:
            src/main/java/hudson/plugins/ws_cleanup/PreBuildCleanup.java
            src/main/java/hudson/plugins/ws_cleanup/WsCleanup.java
            http://jenkins-ci.org/commit/ws-cleanup-plugin/a11b6724dc868782d4b0269f36caac8c4ed8e751
            Log:
            Merge pull request #2 from jorgenpt/fix-missing-workspace

            JENKINS-11998 Don't try to clean up without WS.

            Compare: https://github.com/jenkinsci/ws-cleanup-plugin/compare/f630b23...a11b672

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: vjuranek Path: src/main/java/hudson/plugins/ws_cleanup/PreBuildCleanup.java src/main/java/hudson/plugins/ws_cleanup/WsCleanup.java http://jenkins-ci.org/commit/ws-cleanup-plugin/a11b6724dc868782d4b0269f36caac8c4ed8e751 Log: Merge pull request #2 from jorgenpt/fix-missing-workspace JENKINS-11998 Don't try to clean up without WS. Compare: https://github.com/jenkinsci/ws-cleanup-plugin/compare/f630b23...a11b672
            Hide
            evernat evernat added a comment -

            committed so resolving as fixed

            Show
            evernat evernat added a comment - committed so resolving as fixed

              People

              • Assignee:
                vjuranek vjuranek
                Reporter:
                jorgenpt Jørgen Tjernø
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: