java.lang.InterruptedException: Locked files? Failed to delete directory 'E:\jslave\workspace\pretested-integration-plugin_integrationtest_master-Windows\mergeCommitContainsOnlyMessagesFromCorrectBranch' for 30 seconds (100 tries)

Jenkins JIRA | Bue Petersen | 2 years ago
  1. 0

    If running the integration-test goal on Windows, the following tests fails: {code} org.jenkinsci.plugins.pretestedintegration.integration.scm.git.AccumulatedCommitMessageIT.mergeCommitContainsOnlyMessagesFromCorrectBranch org.jenkinsci.plugins.pretestedintegration.integration.scm.git.AccumulatedCommitMessageIT.mergeCommitContainsAllMessagesFromTheFeatureBranch org.jenkinsci.plugins.pretestedintegration.integration.scm.git.AccumulatedCommitMessageIT.commitMessageShouldOnlyCollectFromOwnBranch org.jenkinsci.plugins.pretestedintegration.integration.scm.git.AccumulatedCommitMessageIT.mergeCommitContainsAllMessagesFromTheFeatureBranchButNotTheNewestOnMaster org.jenkinsci.plugins.pretestedintegration.integration.scm.git.AccumulatedCommitMessageIT.commitMessageShouldOnCollectFromConnectedBranches {code} The common problem is: {code} Error Message Locked files? Failed to delete directory 'E:\jslave\workspace\pretested-integration-plugin_integrationtest_master-Windows\mergeCommitContainsOnlyMessagesFromCorrectBranch' for 30 seconds (100 tries) Stacktrace java.lang.InterruptedException: Locked files? Failed to delete directory 'E:\jslave\workspace\pretested-integration-plugin_integrationtest_master-Windows\mergeCommitContainsOnlyMessagesFromCorrectBranch' for 30 seconds (100 tries) at org.jenkinsci.plugins.pretestedintegration.integration.scm.git.TestUtilsFactory.destroyDirectory(TestUtilsFactory.java:147) at org.jenkinsci.plugins.pretestedintegration.integration.scm.git.TestUtilsFactory.destroyRepo(TestUtilsFactory.java:190) at org.jenkinsci.plugins.pretestedintegration.integration.scm.git.AccumulatedCommitMessageIT.tearDown(AccumulatedCommitMessageIT.java:112) {code} We would like the tests to run without fails on Windows.

    Jenkins JIRA | 2 years ago | Bue Petersen
    java.lang.InterruptedException: Locked files? Failed to delete directory 'E:\jslave\workspace\pretested-integration-plugin_integrationtest_master-Windows\mergeCommitContainsOnlyMessagesFromCorrectBranch' for 30 seconds (100 tries)
  2. 0

    If running the integration-test goal on Windows, the following tests fails: {code} org.jenkinsci.plugins.pretestedintegration.integration.scm.git.AccumulatedCommitMessageIT.mergeCommitContainsOnlyMessagesFromCorrectBranch org.jenkinsci.plugins.pretestedintegration.integration.scm.git.AccumulatedCommitMessageIT.mergeCommitContainsAllMessagesFromTheFeatureBranch org.jenkinsci.plugins.pretestedintegration.integration.scm.git.AccumulatedCommitMessageIT.commitMessageShouldOnlyCollectFromOwnBranch org.jenkinsci.plugins.pretestedintegration.integration.scm.git.AccumulatedCommitMessageIT.mergeCommitContainsAllMessagesFromTheFeatureBranchButNotTheNewestOnMaster org.jenkinsci.plugins.pretestedintegration.integration.scm.git.AccumulatedCommitMessageIT.commitMessageShouldOnCollectFromConnectedBranches {code} The common problem is: {code} Error Message Locked files? Failed to delete directory 'E:\jslave\workspace\pretested-integration-plugin_integrationtest_master-Windows\mergeCommitContainsOnlyMessagesFromCorrectBranch' for 30 seconds (100 tries) Stacktrace java.lang.InterruptedException: Locked files? Failed to delete directory 'E:\jslave\workspace\pretested-integration-plugin_integrationtest_master-Windows\mergeCommitContainsOnlyMessagesFromCorrectBranch' for 30 seconds (100 tries) at org.jenkinsci.plugins.pretestedintegration.integration.scm.git.TestUtilsFactory.destroyDirectory(TestUtilsFactory.java:147) at org.jenkinsci.plugins.pretestedintegration.integration.scm.git.TestUtilsFactory.destroyRepo(TestUtilsFactory.java:190) at org.jenkinsci.plugins.pretestedintegration.integration.scm.git.AccumulatedCommitMessageIT.tearDown(AccumulatedCommitMessageIT.java:112) {code} We would like the tests to run without fails on Windows.

    Jenkins JIRA | 2 years ago | Bue Petersen
    java.lang.InterruptedException: Locked files? Failed to delete directory 'E:\jslave\workspace\pretested-integration-plugin_integrationtest_master-Windows\mergeCommitContainsOnlyMessagesFromCorrectBranch' for 30 seconds (100 tries)
  3. 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'.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 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
  6. 0

    Experiencing some weird behavior re: tickets and p4 jenkins plugin. BEFORE: {noformat} [~jenkins] root# rm .p4tickets [~jenkins] root# ls -al {noformat} NOW GO TO JENKINS, and test password credential AFTER: {noformat} [~jenkins] root# ls -al total 8 drwxr-xr-x+ 4 jenkins staff 136 Mar 10 15:55 ./ drwxr-xr-x 9 root admin 306 Mar 10 15:31 ../ -r-------- 1 root staff 68 Mar 10 15:55 .p4tickets {noformat} So the act of testing the password credential adds a ticket file. Next, I remove .p4tickets and test my ticketed credential. Does not create {{.p4tickets}} and test succeeds. Now I go to a job that depends on ticketed credential I just tested, and run it. Job fails with: {noformat} SEVERE: P4: Unable to use Workspace: com.perforce.p4java.exception.AccessException: Perforce password (P4PASSWD) invalid or unset. com.perforce.p4java.exception.AccessException: Perforce password (P4PASSWD) invalid or unset. at com.perforce.p4java.impl.mapbased.server.Server.handleErrorStr(Server.java:4987) at com.perforce.p4java.impl.mapbased.server.Server.getClient(Server.java:2433) at org.jenkinsci.plugins.p4.client.ClientHelper.clientLogin(ClientHelper.java:69) at org.jenkinsci.plugins.p4.client.ClientHelper.<init>(ClientHelper.java:63) at org.jenkinsci.plugins.p4.tasks.AbstractTask.getConnection(AbstractTask.java:78) at org.jenkinsci.plugins.p4.tasks.AbstractTask.setWorkspace(AbstractTask.java:50) at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:278) at hudson.model.AbstractProject.checkout(AbstractProject.java:1252) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:615) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:524) at hudson.model.Run.execute(Run.java:1706) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:232) Mar 10, 2015 4:02:07 PM org.jenkinsci.plugins.p4.tasks.AbstractTask setWorkspace SEVERE: P4: Unable to setup workspace: com.perforce.p4java.exception.AccessException: Perforce password (P4PASSWD) invalid or unset. Mar 10, 2015 4:02:07 PM hudson.model.Run execute INFO: p4ws-main_build_linux-x64 #5 aborted java.lang.InterruptedException: P4: Unable to setup workspace: com.perforce.p4java.exception.AccessException: Perforce password (P4PASSWD) invalid or unset. at org.jenkinsci.plugins.p4.tasks.AbstractTask.setWorkspace(AbstractTask.java:63) at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:278) at hudson.model.AbstractProject.checkout(AbstractProject.java:1252) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:615) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:524) at hudson.model.Run.execute(Run.java:1706) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:232) {noformat} Finally, I go back and test the password version, which recreates .p4tickets. Now I use my ticketed credential and it works. Long story short, {{$P4TICKETS}} has to exist before you can use a ticket. That is unexpected and does not conform to normal p4 command-line behavior, e.g: {noformat} $ p4 -p perforce:1666 -P <TICKET-STRING> -u <PERFORCE-USER> login -s User <PERFORCE-USER> ticket expires in 200403 hours 47 minutes. {noformat} This works with or without {{$P4TICKETS}} file, and does not create it.

    Jenkins JIRA | 2 years ago | Russ Tremain
    java.lang.InterruptedException: P4: Unable to setup workspace: com.perforce.p4java.exception.AccessException: Perforce password (P4PASSWD) invalid or unset.

    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

      Locked files? Failed to delete directory 'E:\jslave\workspace\pretested-integration-plugin_integrationtest_master-Windows\mergeCommitContainsOnlyMessagesFromCorrectBranch' for 30 seconds (100 tries)

      at org.jenkinsci.plugins.pretestedintegration.integration.scm.git.TestUtilsFactory.destroyDirectory()
    2. org.jenkinsci.plugins
      AccumulatedCommitMessageIT.tearDown
      1. org.jenkinsci.plugins.pretestedintegration.integration.scm.git.TestUtilsFactory.destroyDirectory(TestUtilsFactory.java:147)
      2. org.jenkinsci.plugins.pretestedintegration.integration.scm.git.TestUtilsFactory.destroyRepo(TestUtilsFactory.java:190)
      3. org.jenkinsci.plugins.pretestedintegration.integration.scm.git.AccumulatedCommitMessageIT.tearDown(AccumulatedCommitMessageIT.java:112)
      3 frames