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

Force syncing a workspace that does not exist on the filesystem causes a FileNotFoundException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      Jenkins: 1.596.2
      p4-plugin: 1.2.1
    • Similar Issues:

      Description

      When using the force sync option, a FileNotFound exception occurs if the workspace directory does not already exist on the executor. The forceDelete portion should silently ignore this error.

      org.jenkinsci.plugins.workflow.cps.steps.ParallelStepException: Parallel step product1 failed
      at org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler$Callback.checkAllDone(ParallelStep.java:153)
      at org.jenkinsci.plugins.workflow.cps.steps.ParallelStep$ResultHandler$Callback.onFailure(ParallelStep.java:119)
      at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$FailureAdapter.receive(CpsBodyExecution.java:294)
      at com.cloudbees.groovy.cps.impl.ThrowBlock$1.receive(ThrowBlock.java:68)
      at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
      at com.cloudbees.groovy.cps.Next.step(Next.java:58)
      at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:145)
      at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:268)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:71)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:177)
      at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:175)
      at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:111)
      at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: hudson.AbortException: Unable to update workspace: java.io.FileNotFoundException: File does not exist: /home/jenkins/workspace/
      at org.jenkinsci.plugins.p4.tasks.CheckoutTask.invoke(CheckoutTask.java:110)
      at org.jenkinsci.plugins.p4.tasks.CheckoutTask.invoke(CheckoutTask.java:22)
      at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2677)
      at hudson.remoting.UserRequest.perform(UserRequest.java:121)
      at hudson.remoting.UserRequest.perform(UserRequest.java:49)
      at hudson.remoting.Request$2.run(Request.java:324)
      at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
      at ......remote call to rpocase-ubuntu(Native Method)
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1356)
      at hudson.remoting.UserResponse.retrieve(UserRequest.java:221)
      at hudson.remoting.Channel.call(Channel.java:752)
      at hudson.FilePath.act(FilePath.java:970)
      at hudson.FilePath.act(FilePath.java:959)
      at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:311)
      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:106)
      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:70)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:34)
      at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:136)
      at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:100)
      at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
      at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:15)
      at WorkflowScript.sync_template(WorkflowScript:24)
      at WorkflowScript.run(WorkflowScript:13)
      at Unknown.Unknown(Unknown)
      at cps.transform(Native Method)
      at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:69)
      at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:106)
      at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:79)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
      at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
      at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.dispatch(CollectionLiteralBlock.java:55)
      at com.cloudbees.groovy.cps.impl.CollectionLiteralBlock$ContinuationImpl.item(CollectionLiteralBlock.java:45)
      at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
      ... 17 more

        Attachments

          Activity

          Hide
          rpocase Robby Pocase added a comment - - edited

          Resolved in pull request: https://github.com/jenkinsci/p4-plugin/pull/11

          Not yet merged into master

          Show
          rpocase Robby Pocase added a comment - - edited Resolved in pull request: https://github.com/jenkinsci/p4-plugin/pull/11 Not yet merged into master
          Hide
          rpocase Robby Pocase added a comment -

          Resolved in: https://github.com/jenkinsci/p4-plugin/pull/11. Just needs to be merged

          Show
          rpocase Robby Pocase added a comment - Resolved in: https://github.com/jenkinsci/p4-plugin/pull/11 . Just needs to be merged
          Hide
          p4paul Paul Allen added a comment -

          Sorry for the delay I have been out on holiday.

          At first glance there seems to be a few bits of noise and other non specific changes. To help me review the change faster could you please summarise the change or help reduce the noise. For example, there were a few method name changes / import formatting and other refactoring. If it helps I use Eclipse with the default java formatting.

          Thanks,
          Paul

          Show
          p4paul Paul Allen added a comment - Sorry for the delay I have been out on holiday. At first glance there seems to be a few bits of noise and other non specific changes. To help me review the change faster could you please summarise the change or help reduce the noise. For example, there were a few method name changes / import formatting and other refactoring. If it helps I use Eclipse with the default java formatting. Thanks, Paul
          Hide
          rpocase Robby Pocase added a comment - - edited

          Sure thing. The main change that needs to be viewed is a new function "silentlyForceDelete". This deletes the supplied workspace and ignores any FileNotFoundExceptions. All other changes in ClientHelper.java was general refactoring to improve readability. There was an extra commit that fixes some deprecation warnings (this wasn't intended to go in the pull request, but should be safe to pull in). Just let me know if you need any more details.

          Edit: Note - adding this comment to github so its traceable from the pull request

          Show
          rpocase Robby Pocase added a comment - - edited Sure thing. The main change that needs to be viewed is a new function "silentlyForceDelete". This deletes the supplied workspace and ignores any FileNotFoundExceptions. All other changes in ClientHelper.java was general refactoring to improve readability. There was an extra commit that fixes some deprecation warnings (this wasn't intended to go in the pull request, but should be safe to pull in). Just let me know if you need any more details. Edit: Note - adding this comment to github so its traceable from the pull request
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Paul Allen
          Path:
          src/main/java/org/jenkinsci/plugins/p4/client/ClientHelper.java
          src/main/java/org/jenkinsci/plugins/p4/credentials/P4Credentials.java
          src/main/java/org/jenkinsci/plugins/p4/workspace/Workspace.java
          http://jenkins-ci.org/commit/p4-plugin/939279eb79f7f48a8a7dbb70f6b9d5288d2d86ff
          Log:
          Merge pull request #11 from rpocase/master

          JENKINS-28213 Force syncing a workspace that does not exist on the filesystem causes a FileNotFoundException

          Compare: https://github.com/jenkinsci/p4-plugin/compare/f830dd453a2e...939279eb79f7

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Paul Allen Path: src/main/java/org/jenkinsci/plugins/p4/client/ClientHelper.java src/main/java/org/jenkinsci/plugins/p4/credentials/P4Credentials.java src/main/java/org/jenkinsci/plugins/p4/workspace/Workspace.java http://jenkins-ci.org/commit/p4-plugin/939279eb79f7f48a8a7dbb70f6b9d5288d2d86ff Log: Merge pull request #11 from rpocase/master JENKINS-28213 Force syncing a workspace that does not exist on the filesystem causes a FileNotFoundException Compare: https://github.com/jenkinsci/p4-plugin/compare/f830dd453a2e...939279eb79f7
          Hide
          p4paul Paul Allen added a comment -

          Resolved to Closed

          Show
          p4paul Paul Allen added a comment - Resolved to Closed

            People

            • Assignee:
              rpocase Robby Pocase
              Reporter:
              rpocase Robby Pocase
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: