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

Replay link does not show up if Jenkinsfile had a syntax error

    Details

    • Similar Issues:

      Description

      Steps to reproduce

      • Create a Pipeline with a Jenkinsfile
      • Introduce a Groovy syntax error, like omitting a trailing parenthesis on a method call
      • Execute

      What ends up happening is that an exception is shown, e.g.:

      Checking out Revision f29c250737c3db53f709977224c4547a43ed4886 (refs/remotes/origin/master)
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: 7: expecting ')', found ']' @ line 7, column 17.
                         ])
      

      But the sidebar includes no Replay link to attempt to fix the change, instead you need to commit a change to make the Jenkinsfile correct Groovy syntax.

      Expected

      • Replay is shown no matter how fscked my Jenkinsfile is so I can correct it

      This issue also occurs if you use Replay and introduce a Groovy syntax error as well. Also, I believe this is related to JENKINS-34555

        Attachments

          Issue Links

            Activity

            Hide
            orrc Christopher Orr added a comment -

            Probably not surprising, but thought I'd note: the same occurs if you make a syntax error with a purely Declarative Pipeline.

            Show
            orrc Christopher Orr added a comment - Probably not surprising, but thought I'd note: the same occurs if you make a syntax error with a purely Declarative Pipeline.
            Hide
            svanoort Sam Van Oort added a comment -

            R. Tyler Croy Christopher Orr Can you check if the error occurs with workflow-cps 2.50 and workflow-cps 2.21? I just released a set of fixes that I think address this.

            Show
            svanoort Sam Van Oort added a comment - R. Tyler Croy Christopher Orr Can you check if the error occurs with workflow-cps 2.50 and workflow-cps 2.21? I just released a set of fixes that I think address this.
            Hide
            ercanales Enrique Canales added a comment -

            I had tested this with workflow-cps 2.54 and workflow-job 2.21 and it looks like the Replay link shows up, but the ` Main Script` portion does not when there was a syntax error.

            Show
            ercanales Enrique Canales added a comment - I had tested this with workflow-cps 2.54 and workflow-job 2.21 and it looks like the Replay link shows up, but the ` Main Script` portion does not when there was a syntax error.
            Hide
            dnusbaum Devin Nusbaum added a comment -

            It looks like the main script portion does not show up because ReplayAction#isReplayableSandboxTest returns false because loading the execution fails with the following:

            Aug 23, 2018 2:16:33 PM org.jenkinsci.plugins.workflow.cps.replay.ReplayAction getExecutionBlocking
            WARNING: Error fetching execution for replay
            java.io.IOException: Syntax #1 did not yet start
            	at org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.get(WorkflowRun.java:1125)
            	at org.jenkinsci.plugins.workflow.cps.replay.ReplayAction.getExecutionBlocking(ReplayAction.java:126)
            	at org.jenkinsci.plugins.workflow.cps.replay.ReplayAction.isReplayableSandboxTest(ReplayAction.java:166)
                    ... the rest of the stack is not relevant (tested via script console)
            
            Show
            dnusbaum Devin Nusbaum added a comment - It looks like the main script portion does not show up because ReplayAction#isReplayableSandboxTest returns false because loading the execution fails with the following: Aug 23, 2018 2:16:33 PM org.jenkinsci.plugins.workflow.cps.replay.ReplayAction getExecutionBlocking WARNING: Error fetching execution for replay java.io.IOException: Syntax #1 did not yet start at org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.get(WorkflowRun.java:1125) at org.jenkinsci.plugins.workflow.cps.replay.ReplayAction.getExecutionBlocking(ReplayAction.java:126) at org.jenkinsci.plugins.workflow.cps.replay.ReplayAction.isReplayableSandboxTest(ReplayAction.java:166) ... the rest of the stack is not relevant (tested via script console)
            Hide
            kwic Marcin Kwiecien added a comment -

            It would be awesome if this was fixed... Because it's a major pain. If you don't copy your Jenkinsfile before hitting on the "Run" button and the build fails due to Groovy syntax error then all your changes to the Jenkinsfile you just did via the Replay button are gone.

            Show
            kwic Marcin Kwiecien added a comment - It would be awesome if this was fixed... Because it's a major pain. If you don't copy your Jenkinsfile before hitting on the "Run" button and the build fails due to Groovy syntax error then all your changes to the Jenkinsfile you just did via the Replay button are gone.

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                rtyler R. Tyler Croy
              • Votes:
                7 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated: