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

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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • pmd-plugin
    • None
    • pmd-plugin 3.46

      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.

          [JENKINS-46965] 500 when loading config containing publish pmd step if workspace was deleted

          Ulli Hafner added a comment -

          Can you please show the whole exception stack trace?

          Ulli Hafner added a comment - Can you please show the whole exception stack trace?

          Simon Weber added a comment - - edited

          Sure, here you go: https://gist.github.com/simon-weber/fecb15c3d24a48a52dc33cb5958a9c71. Text in square brackets were edited to remove some venmo-specific things. I also included both the requests (made from javascript) that generate the 500s.

          Simon Weber added a comment - - edited Sure, here you go: https://gist.github.com/simon-weber/fecb15c3d24a48a52dc33cb5958a9c71 . Text in square brackets were edited to remove some venmo-specific things. I also included both the requests (made from javascript) that generate the 500s.

          Ulli Hafner added a comment -

          Hmm, I get a 404 for your link. What about pasting the stacktrace in a Jira comment (or as attachment).

          Ulli Hafner added a comment - Hmm, I get a 404 for your link. What about pasting the stacktrace in a Jira comment (or as attachment).

          Simon Weber added a comment -

          Ah, it was just jira being wonky and including the end of sentence period in the url. I edited the link; give it another shot.

          Simon Weber added a comment - Ah, it was just jira being wonky and including the end of sentence period in the url. I edited the link; give it another shot.

          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.

          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.

          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.

          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.

          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.

          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.

          Simon Weber added a comment -

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

          Simon Weber added a comment - Thanks for the fix! Are you planning to cut a release including this?

          Ulli Hafner added a comment -

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

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

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

              Created:
              Updated:
              Resolved: