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

NullPointerException on User.get when executing shell sudo service tomcat stop in post step

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • postbuildscript-plugin
    • None
    • See attached

      While executing shell post-step, I am attempting to do a "sudo service tomcat stop", the jenkins server crashes completely and the build fails with exception below:

      [workspace] $ /bin/sh -xe /tmp/hudson1433417204994586409.sh
      + sudo service tomcat stop
      Stopping Tomcat JVM: Build was aborted
      FATAL: null
      java.lang.NullPointerException
      at hudson.model.User.get(User.java:322)
      at hudson.model.User.get(User.java:300)
      at hudson.model.User.get(User.java:365)
      at jenkins.model.CauseOfInterruption$UserInterruption.getUser(CauseOfInterruption.java:82)
      at jenkins.model.CauseOfInterruption$UserInterruption.print(CauseOfInterruption.java:91)
      at hudson.model.Executor.recordCauseOfInterruption(Executor.java:189)
      at hudson.model.Run.execute(Run.java:1695)
      at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:509)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:231)

      On my ci box tomcat is running as a service as the tomcat user. Running "sudo service tomcat start/stop" works fine from the command prompt. I need to issue the same commands from within jenkins build.

      This is a new install of v1.544, I'm running on 64-bit Amazon Linux (Centos/RedHat) with plenty of memory and storage. Jenkins is configured as a service and started stopped in the same way "sudo service jenkins start". There are no other stack traces or errors that I can identify in the jenkins log in /etc/sysconfig or in /var/log/messages.

            dheid Daniel Heid
            samoussa_usa Vard Lott
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: