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

Packer Plugin Nullpointer Exception and SecurityException: Rejected: net.sf.json.JSONObject

    Details

    • Similar Issues:

      Description

      I'm not sure if this is related to JEP-200, but after Upgrade I receive these Exceptions when using the Packer Plugin:

       

      Feb 23, 2018 12:39:25 PM hudson.model.Run execute
      INFO: packer-centos7 #361 main build action completed: SUCCESS
      Feb 23, 2018 12:39:25 PM biz.neustar.jenkins.plugins.packer.PackerPublisher getRemotePackerExec
      SEVERE: java.lang.NullPointerException
          at biz.neustar.jenkins.plugins.packer.PackerPublisher.getRemotePackerExec(PackerPublisher.java:217)
          at biz.neustar.jenkins.plugins.packer.PackerPublisher.perform(PackerPublisher.java:301)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
          at hudson.model.Build$BuildExecution.post2(Build.java:186)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
          at hudson.model.Run.execute(Run.java:1752)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
      
      Feb 23, 2018 12:39:25 PM biz.neustar.jenkins.plugins.packer.PackerPublisher perform
      SEVERE: java.lang.NullPointerException
          at biz.neustar.jenkins.plugins.packer.PackerPublisher.getName(PackerPublisher.java:84)
          at biz.neustar.jenkins.plugins.packer.PackerPublisher.getRemotePackerExec(PackerPublisher.java:223)
          at biz.neustar.jenkins.plugins.packer.PackerPublisher.perform(PackerPublisher.java:301)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
          at hudson.model.Build$BuildExecution.post2(Build.java:186)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
          at hudson.model.Run.execute(Run.java:1752)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)

      Actually this message doesn't apear anymore:

       

      Feb 23, 2018 12:16:47 PM biz.neustar.jenkins.plugins.packer.PackerPublisher getRemotePackerExec
      SEVERE: java.io.IOException: Remote call on server failed
              at hudson.remoting.Channel.call(Channel.java:958)
              at biz.neustar.jenkins.plugins.packer.PackerInstallation.getExecutable(PackerInstallation.java:138)
              at biz.neustar.jenkins.plugins.packer.PackerPublisher.getRemotePackerExec(PackerPublisher.java:220)
              at biz.neustar.jenkins.plugins.packer.PackerPublisher.perform(PackerPublisher.java:301)
              at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
              at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
              at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
              at hudson.model.Build$BuildExecution.post2(Build.java:186)
              at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
              at hudson.model.Run.execute(Run.java:1752)
              at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
              at hudson.model.ResourceController.execute(ResourceController.java:97)
              at hudson.model.Executor.run(Executor.java:429)
      Caused by: java.lang.Error: Failed to deserialize the Callable object.
              at hudson.remoting.UserRequest.perform(UserRequest.java:194)
              at hudson.remoting.UserRequest.perform(UserRequest.java:53)
              at hudson.remoting.Request$2.run(Request.java:364)
              at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
              Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to server
                      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1737)
                      at hudson.remoting.UserResponse.retrieve(UserRequest.java:313)
                      at hudson.remoting.Channel.call(Channel.java:952)
                      at biz.neustar.jenkins.plugins.packer.PackerInstallation.getExecutable(PackerInstallation.java:138)
                      at biz.neustar.jenkins.plugins.packer.PackerPublisher.getRemotePackerExec(PackerPublisher.java:220)
                      at biz.neustar.jenkins.plugins.packer.PackerPublisher.perform(PackerPublisher.java:301)
                      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
                      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
                      at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
                      at hudson.model.Build$BuildExecution.post2(Build.java:186)
                      at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
                      at hudson.model.Run.execute(Run.java:1752)
                      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
                      at hudson.model.ResourceController.execute(ResourceController.java:97)
                      at hudson.model.Executor.run(Executor.java:429)
      Caused by: java.lang.SecurityException: Rejected: net.sf.json.JSONObject; see https://jenkins.io/redirect/class-filter/
              at hudson.remoting.ClassFilter.check(ClassFilter.java:64)
              at hudson.remoting.MultiClassLoaderSerializer$Input.resolveClass(MultiClassLoaderSerializer.java:124)
              at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)
              at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1521)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1781)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1353)
              at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2018)

      May we fixed this with

       

      -Dhudson.model.ParametersAction.keepUndefinedParameters=true -Dhudson.remoting.ClassFilter=net.sf.json.JSONObject -Dhudson.remoting.Classfilter=jenkins.security.ClassFilterImpl

        Attachments

          Issue Links

            Activity

            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            We are still waiting for the release by Jeffrey Damick. Jenkins 2.107.1 will be released today, and there is a risk that the plugin will be broken after the release

            Show
            oleg_nenashev Oleg Nenashev added a comment - We are still waiting for the release by Jeffrey Damick . Jenkins 2.107.1 will be released today, and there is a risk that the plugin will be broken after the release
            Hide
            jglick Jesse Glick added a comment -

            Released in 1.5.

            Show
            jglick Jesse Glick added a comment - Released in 1.5.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Hendrik Horeis This stacktrace means that your PackerInstallation definition cannot be retrieved for the installation name: https://github.com/jenkinsci/packer-plugin/blob/f8e4347d653001efc85c77e7eec49500710c39e8/src/main/java/biz/neustar/jenkins/plugins/packer/PackerPublisher.java#L217 and https://github.com/jenkinsci/packer-plugin/blob/f8e4347d653001efc85c77e7eec49500710c39e8/src/main/java/biz/neustar/jenkins/plugins/packer/PackerPublisher.java#L197-L205

            The code definitely has a bug in tool handling (no null check). Most likely you have removed the failing Tool loading in "Manage Old Data" so that there is no tool with name defined in the job. Could you please check it?

            Show
            oleg_nenashev Oleg Nenashev added a comment - Hendrik Horeis This stacktrace means that your PackerInstallation definition cannot be retrieved for the installation name: https://github.com/jenkinsci/packer-plugin/blob/f8e4347d653001efc85c77e7eec49500710c39e8/src/main/java/biz/neustar/jenkins/plugins/packer/PackerPublisher.java#L217 and https://github.com/jenkinsci/packer-plugin/blob/f8e4347d653001efc85c77e7eec49500710c39e8/src/main/java/biz/neustar/jenkins/plugins/packer/PackerPublisher.java#L197-L205 The code definitely has a bug in tool handling (no null check). Most likely you have removed the failing Tool loading in "Manage Old Data" so that there is no tool with name defined in the job. Could you please check it?
            Hide
            horacer Hendrik Horeis added a comment -

            Thanks Oleg Nenashev It was my fault... I was using a custom packer binary and was just able to solve it by letting Jenkins install the packer binary

            Show
            horacer Hendrik Horeis added a comment - Thanks  Oleg Nenashev It was my fault... I was using a custom packer binary and was just able to solve it by letting Jenkins install the packer binary
            Hide
            horacer Hendrik Horeis added a comment - - edited

            Oleg Nenashev And you are absolutely right about the failing tool loading part.

            Show
            horacer Hendrik Horeis added a comment - - edited Oleg Nenashev And you are absolutely right about the failing tool loading part.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                becke22 Björn Becker
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: