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

java.lang.NullPointerException > hudson.plugins.perforce.PerforceSCM.parseProjectPath(PerforceSCM.java:1340)

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      This happened when I tried to use clientspec *not manged by hudson*.
      In the job configuration: the workspace is `ang_ps_hudson_test`

      Started by user xxx
      Building remotely on ccc.example.com
      Using remote perforce client: ang_ps_hudson_test-2009646975
      [ang_ps_hudson_test] $ p4 workspace -o ang_ps_hudson_test-2009646975
      [ang_ps_hudson_test] $ p4 login -p
      [ang_ps_hudson_test] $ p4 -P 8D910F44B59A47C1C38C001A2DCCB7A2 workspace -o ang_ps_hudson_test-2009646975
      FATAL: null
      java.lang.NullPointerException
      at hudson.plugins.perforce.PerforceSCM.parseProjectPath(PerforceSCM.java:1340)
      at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1002)
      at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:504)
      at hudson.model.AbstractProject.checkout(AbstractProject.java:1082)
      at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
      at hudson.model.Run.run(Run.java:1273)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:137)

        Attachments

          Activity

          Hide
          rpetti Rob Petti added a comment -

          What version of the plugin are you running? That line doesn't correspond to anything that could throw an NPE in the latest version (in fact, it's a comment).

          Change your Client name format for slaves to ${basename}, or create a new client 'ang_ps_hudson_test-2009646975' for that specific slave, and the problem will go away.

          Show
          rpetti Rob Petti added a comment - What version of the plugin are you running? That line doesn't correspond to anything that could throw an NPE in the latest version (in fact, it's a comment). Change your Client name format for slaves to ${basename}, or create a new client 'ang_ps_hudson_test-2009646975' for that specific slave, and the problem will go away.
          Hide
          ssbarnea Sorin Sbarnea added a comment -

          This happened today with uptodate hudson and plugins. In fact the workaround I did was to switch to a clientspec managed by hudson.

          But if I disable this and select and existing clientspec I'm afraid that I will reproduce it.

          Anyway, if you are sure that this doesn't make sense with current code, please close the bug. I will know if it will reproduce later.

          Show
          ssbarnea Sorin Sbarnea added a comment - This happened today with uptodate hudson and plugins. In fact the workaround I did was to switch to a clientspec managed by hudson. But if I disable this and select and existing clientspec I'm afraid that I will reproduce it. Anyway, if you are sure that this doesn't make sense with current code, please close the bug. I will know if it will reproduce later.
          Hide
          rpetti Rob Petti added a comment -

          Did you simply try changing your client name format for slaves to ${basename} instead of ${basename}-${hash}? Or did you try to create the workspace that's being referenced in the log? If hudson is not set to manage the workspace, it will NOT create ANY client workspaces. All of them need to be created manually.

          Show
          rpetti Rob Petti added a comment - Did you simply try changing your client name format for slaves to ${basename} instead of ${basename}-${hash}? Or did you try to create the workspace that's being referenced in the log? If hudson is not set to manage the workspace, it will NOT create ANY client workspaces. All of them need to be created manually.
          Hide
          rpetti Rob Petti added a comment -

          Closing as not a defect, because this is a configuration issue.

          Show
          rpetti Rob Petti added a comment - Closing as not a defect, because this is a configuration issue.
          Hide
          ssbarnea Sorin Sbarnea added a comment -

          Sorry for reopening this but an exception reaching the user is always a bug.

          In this case the resolution would be to give a proper error message to the user, explaining him the issue and what options he has. I observed this kind or messages in hudson in other places, in some cases even with URLs in them.

          This did not happen to me personally but I fully understand the frustration of a first time user when he see a stack trace.

          Show
          ssbarnea Sorin Sbarnea added a comment - Sorry for reopening this but an exception reaching the user is always a bug. In this case the resolution would be to give a proper error message to the user, explaining him the issue and what options he has. I observed this kind or messages in hudson in other places, in some cases even with URLs in them. This did not happen to me personally but I fully understand the frustration of a first time user when he see a stack trace.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : rpetti
          Path:
          trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java
          http://jenkins-ci.org/commit/35246
          Log:
          [FIXED JENKINS-7555] added better error handling when the user fails to create the client workspace in the case where hudson is not set to handle them

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : rpetti Path: trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java http://jenkins-ci.org/commit/35246 Log: [FIXED JENKINS-7555] added better error handling when the user fails to create the client workspace in the case where hudson is not set to handle them

            People

            • Assignee:
              rpetti Rob Petti
              Reporter:
              ssbarnea Sorin Sbarnea
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: