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

can not rebuild a failed pipeline if you have RUN_SCRIPTS permission

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • workflow-cps-plugin
    • None

      I have a parameterized pipeline (regular non multi branch) that was configured to fetch the pipeline from source.

      I am a full admin on the instance

      The pipeline was configured to checkout the source from a fork of an repo (and that fork was filed as a PR).

      The builds where working fine, until the PR was merged.

      Once the PR was merged a build failed with

      ERROR: Unable to find pipelines/usage-in-plugins/Jenkinsfile from git https://github.com/xxx/yyy
      Finished: FAILURE
      

      I then changed the job config to obtain the pipeline definition from the correct source.

      as the failed build had large amounts of parameters I then wanted to "re-run" the pipeline (basically use the same parameters as in that build).

      However as I had Overal/Administer"} and {{RUN_SCRIPTS only a "replay" link was visible.

      on clicking the replay link I was taken to a confirmation page that informed me the build would be a rebuild not a replay as I was lacking permissions (this is the first issue - I do have the correct permissions)

      However on clicking the "Run" link (which should according to the descrioption be a rebuild not a replay, Jenkins serves me the OOPS page.

      In the logs I can see errors like

      2021-11-23 13:36:37.185+0000 [id=1123479]	WARNING	o.j.p.w.cps.replay.ReplayAction#getExecutionBlocking: Error fetching execution for replay
      java.io.IOException: usage-in-plugins #14 did not yet start
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.get(WorkflowRun.java:967)
      	at org.jenkinsci.plugins.workflow.cps.replay.ReplayAction.getExecutionBlocking(ReplayAction.java:127)
      	at org.jenkinsci.plugins.workflow.cps.replay.ReplayAction.isReplayableSandboxTest(ReplayAction.java:167)
      	at sun.reflect.GeneratedMethodAccessor7063.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      

      and eventually

      2021-11-23 13:37:04.219+0000 [id=1124316]	WARNING	h.i.i.InstallUncaughtExceptionHandler#handleException: Caught unhandled exception with ID 8ad3e274-6126-4420-a3ce-62ec3273b640
      java.io.IOException: usage-in-plugins is not buildable
      	at org.jenkinsci.plugins.workflow.cps.replay.ReplayAction.doRebuild(ReplayAction.java:228)
      	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:393)
      

      the build is infact buildable - if you click build on the project it will build (as the pipeline location was fixed above)

      As a user I expect to be able to use rebuild to use the same job parameters, but not source to rebuild a job.

            Unassigned Unassigned
            teilo James Nord
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: