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

500 when loading config containing publish pmd step if workspace was deleted

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: pmd-plugin
    • Labels:
      None
    • Environment:
      pmd-plugin 3.46
    • Similar Issues:

      Description

      We started getting alerted on 500s shortly after installing this plugin, and managed to reproduce a case where loading a config using the plugin causes a traceback and 500.

      To reproduce:

      • install the plugin
      • create a new job using pmd publishing and run it successfully once
      • delete the workspace directory on the agent it last ran on
      • load the config for the job

      This results in an ERROR link under the publish step, which expands to a traceback like

      java.lang.IllegalStateException: basedir [path to workspace] does not exist.
      	at org.apache.tools.ant.DirectoryScanner.scan(DirectoryScanner.java:879)
      	at hudson.FilePath$46.hasMatch(FilePath.java:2487)
      	at hudson.FilePath$46.invoke(FilePath.java:2371)
      	at hudson.FilePath$46.invoke(FilePath.java:2361)
      	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2732)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:153)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:50)
      	at hudson.remoting.Request$2.run(Request.java:336)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      	at ......remote call to [Runner] (Native Method)
      	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
      	at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
      	at hudson.remoting.Channel.call(Channel.java:830)
      	at hudson.FilePath.act(FilePath.java:986)
      	at hudson.FilePath.act(FilePath.java:975)
      	at hudson.FilePath.validateAntFileMask(FilePath.java:2361)
      	at hudson.FilePath.validateAntFileMask(FilePath.java:2338)
      	at hudson.plugins.analysis.core.PluginDescriptor.doCheckPattern(PluginDescriptor.java:207)
      	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:599)
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)
      	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:129)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
      

      I would have expected this to prevent whatever kind of previewing the job is doing, but not cause a 500.

      To work around this we just turned off post-build workspace cleanup.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          analysis-core.iml
          src/main/java/hudson/plugins/analysis/core/PluginDescriptor.java
          http://jenkins-ci.org/commit/analysis-core-plugin/0bd875a5f769c2172d482562719897d9c64abc29
          Log:
          [FIXED JENKINS-46965] Do not validate workspace if it does not exist.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: analysis-core.iml src/main/java/hudson/plugins/analysis/core/PluginDescriptor.java http://jenkins-ci.org/commit/analysis-core-plugin/0bd875a5f769c2172d482562719897d9c64abc29 Log: [FIXED JENKINS-46965] Do not validate workspace if it does not exist.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/warnings/ParserConfiguration.java
          http://jenkins-ci.org/commit/warnings-plugin/f5c478b67c4ce66066d9d80c32278323af87d904
          Log:
          [FIXED JENKINS-46965] Do not validate workspace if it does not exist.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/warnings/ParserConfiguration.java http://jenkins-ci.org/commit/warnings-plugin/f5c478b67c4ce66066d9d80c32278323af87d904 Log: [FIXED JENKINS-46965] Do not validate workspace if it does not exist.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          analysis-core
          warnings
          http://jenkins-ci.org/commit/analysis-suite-plugin/28e44f0943c6ed4cc6974a8b9ae8d0ec9f5ceac2
          Log:
          [FIXED JENKINS-46965] Do not validate workspace if it does not exist.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: analysis-core warnings http://jenkins-ci.org/commit/analysis-suite-plugin/28e44f0943c6ed4cc6974a8b9ae8d0ec9f5ceac2 Log: [FIXED JENKINS-46965] Do not validate workspace if it does not exist.
          Hide
          simonmweber Simon Weber added a comment -

          Thanks for the fix! Are you planning to cut a release including this?

          Show
          simonmweber Simon Weber added a comment - Thanks for the fix! Are you planning to cut a release including this?
          Hide
          drulli Ulli Hafner added a comment -

          After all the pom PRs are integrated and tested, this will take some more time...

          Show
          drulli Ulli Hafner added a comment - After all the pom PRs are integrated and tested, this will take some more time...

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              simonmweber Simon Weber
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: