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

NPE in parseProjectPath when attempting to create Perforce workspace without a mapping

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: perforce-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.609.2 perforce-plugin ver. 1.3.35
    • Similar Issues:

      Description

      Before upgrading from 1.3.33 to 1.3.35 Jenkins was able to create a Perforce workspace when it didn't already exist, however after upgrading to 1.3.35 I get the following NPE:

      My Perforce configuration has a username listed, but the password is blank, and not necessary.

      Building in workspace /path/to/workspace
      Using master perforce client: workspace_name
      [ltconeng] $ /corp/tools/perforce/2011.1/cli/p4 workspace -o workspace_name
      Changing P4 Client Root to: /path/to/workspace
      Caught exception in perforce-plugin. nulljava.lang.NullPointerException
      	at hudson.plugins.perforce.PerforceSCM.parseProjectPath(PerforceSCM.java:2502)
      	at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1710)
      	at hudson.plugins.perforce.PerforceSCM.getPerforceWorkspace(PerforceSCM.java:1602)
      	at hudson.plugins.perforce.PerforceSCM.checkout(PerforceSCM.java:907)
      	at hudson.model.AbstractProject.checkout(AbstractProject.java:1274)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609)
      	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531)
      	at hudson.model.Run.execute(Run.java:1738)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:381)
      ERROR: Caught exception in perfoce-plugin. null
      

        Attachments

          Activity

          Hide
          rpetti Rob Petti added a comment -

          How does your script configure the viewspec? Unless it's actually changing the job configuration in Jenkins, what you are proposing won't work.

          Show
          rpetti Rob Petti added a comment - How does your script configure the viewspec? Unless it's actually changing the job configuration in Jenkins, what you are proposing won't work.
          Hide
          jwagner Justin Wagner added a comment - - edited

          I have "Let Jenkins Create Workspace" enabled, but "Let Jenkins Manage Workspace View" disabled.

          Our script is updating the viewspec through directly executing the p4 command line calls to update the viewspec on the Perforce server.

          We've been using the plugin for some time now, and I was always manually creating the workspaces in Perforce to get things started. I just recently enabled "Let Jenkins Create Workspace" to not have to do that part by hand, but I still wanted to be able to manage the viewspec from our script, so I left the "Let Jenkins Manage Workspace View" configuration disabled.

          I know that the underlying "p4 client" command to create a workspace depends on a view spec, so I see the problem here.

          I am planning to work around this, by having the initial value of the viewspec be some simple valid viewspec that will work initially, but immediately be over written when our script edits the workspace.

          Show
          jwagner Justin Wagner added a comment - - edited I have "Let Jenkins Create Workspace" enabled, but "Let Jenkins Manage Workspace View" disabled. Our script is updating the viewspec through directly executing the p4 command line calls to update the viewspec on the Perforce server. We've been using the plugin for some time now, and I was always manually creating the workspaces in Perforce to get things started. I just recently enabled "Let Jenkins Create Workspace" to not have to do that part by hand, but I still wanted to be able to manage the viewspec from our script, so I left the "Let Jenkins Manage Workspace View" configuration disabled. I know that the underlying "p4 client" command to create a workspace depends on a view spec, so I see the problem here. I am planning to work around this, by having the initial value of the viewspec be some simple valid viewspec that will work initially, but immediately be over written when our script edits the workspace.
          Hide
          jwagner Justin Wagner added a comment -

          If there is anything that could be improved here, it would be to notify the user with a better error message that they need to set a valid viewspec.

          Show
          jwagner Justin Wagner added a comment - If there is anything that could be improved here, it would be to notify the user with a better error message that they need to set a valid viewspec.
          Hide
          rpetti Rob Petti added a comment -

          How about something like the following?

          //depot/pathtononexistentlocation/... //workspace/...
          

          It's a valid mapping, but shouldn't sync anything down.

          Show
          rpetti Rob Petti added a comment - How about something like the following? //depot/pathtononexistentlocation/... //workspace/... It's a valid mapping, but shouldn't sync anything down.
          Hide
          jwagner Justin Wagner added a comment -

          Perfect, thanks.

          Show
          jwagner Justin Wagner added a comment - Perfect, thanks.

            People

            • Assignee:
              Unassigned
              Reporter:
              jwagner Justin Wagner
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: