java.lang.InterruptedException: P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification. Embedded special characters (*, %%, #, @) not allowed in 'C:\Program Files (x86)\Jenkins\jobs\<redacted>\workspace@script'.

Jenkins JIRA | A C | 2 years ago
  1. 0

    CpsScmFlowDefinition.create() is hard coded to append the "@script" suffix onto workspace directories (line 94 of CpsScmFlowDefinition.java). This suffix string should at least respect the hudson.slaves.WorkspaceList separator character, or provide some other way to change this suffix string, as the @ symbol is often treated as a special character by various tools. Currently, it is entirely impossible to use the workflow plugin with Perforce due to this bug, as @ is an illegal character in Perforce paths. Trying to run a hello world script using "Groovy CPS DSL from SCM" results in: ERROR: failed to start build java.lang.InterruptedException: P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification. Embedded special characters (*, %%, #, @) not allowed in 'C:\Program Files (x86)\Jenkins\jobs\<redacted>\workspace@script'. at org.jenkinsci.plugins.p4.tasks.AbstractTask.setWorkspace(AbstractTask.java:63) at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:277) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:106) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:57) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:181) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:374)

    Jenkins JIRA | 2 years ago | A C
    java.lang.InterruptedException: P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification. Embedded special characters (*, %%, #, @) not allowed in 'C:\Program Files (x86)\Jenkins\jobs\<redacted>\workspace@script'.
  2. 0

    CpsScmFlowDefinition.create() is hard coded to append the "@script" suffix onto workspace directories (line 94 of CpsScmFlowDefinition.java). This suffix string should at least respect the hudson.slaves.WorkspaceList separator character, or provide some other way to change this suffix string, as the @ symbol is often treated as a special character by various tools. Currently, it is entirely impossible to use the workflow plugin with Perforce due to this bug, as @ is an illegal character in Perforce paths. Trying to run a hello world script using "Groovy CPS DSL from SCM" results in: ERROR: failed to start build java.lang.InterruptedException: P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification. Embedded special characters (*, %%, #, @) not allowed in 'C:\Program Files (x86)\Jenkins\jobs\<redacted>\workspace@script'. at org.jenkinsci.plugins.p4.tasks.AbstractTask.setWorkspace(AbstractTask.java:63) at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:277) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:106) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108) at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:57) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:181) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:374)

    Jenkins JIRA | 2 years ago | A C
    java.lang.InterruptedException: P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification. Embedded special characters (*, %%, #, @) not allowed in 'C:\Program Files (x86)\Jenkins\jobs\<redacted>\workspace@script'.
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    I was attempting to publish assets as a post build action in one of my jobs and didn't realise the perforce server that it would publish to wasn't online. The error I got was not helpful, but a Null Pointer instead: {code:java} ERROR: Publisher 'Perforce: Publish assets' aborted due to exception: java.lang.InterruptedException: P4: Unable to setup workspace: java.lang.NullPointerException at org.jenkinsci.plugins.p4.tasks.AbstractTask.setWorkspace(AbstractTask.java:63) at org.jenkinsci.plugins.p4.asset.AssetNotifier.perform(AssetNotifier.java:87) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671) at hudson.model.Run.execute(Run.java:1769) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:374) {code} I'm assuming there was a proper error message at some point about not being able to connect to the perforce server but that was lost by a Null Pointer which sent me on a wild goose chase for a while until I realised what was really going on. Looking at the code in AbstractTask.java I'm assuming {{ClientHelper p4 = getConnection();}} doesn't error if it can't get a connection, it just returns null and the code below doesn't check for that first? The catch block does nothing to show the full stack of Exception e, so it's hard to say for sure where the Null Pointer comes from, but that's my guess anyway. Ideally it would throw a {{RuntimeException(err, e);}} instead of the {{InterruptedException(err);}}?

    Jenkins JIRA | 2 years ago | Nick Palmer
    java.lang.InterruptedException: P4: Unable to setup workspace: java.lang.NullPointerException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.InterruptedException

      P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification. Embedded special characters (*, %%, #, @) not allowed in 'C:\Program Files (x86)\Jenkins\jobs\<redacted>\workspace@script'.

      at org.jenkinsci.plugins.p4.tasks.AbstractTask.setWorkspace()
    2. org.jenkinsci.plugins
      WorkflowRun.run
      1. org.jenkinsci.plugins.p4.tasks.AbstractTask.setWorkspace(AbstractTask.java:63)
      2. org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:277)
      3. org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:106)
      4. org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108)
      5. org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:57)
      6. org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:181)
      6 frames
    3. Hudson
      Executor.run
      1. hudson.model.ResourceController.execute(ResourceController.java:98)
      2. hudson.model.Executor.run(Executor.java:374)
      2 frames