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

Cannot abort input step anymore in Console Output

      With a recent upgrade of plugins I can no longer abort Pipelines waiting on an input step.

      See the attached screenshot, but basically hitting the Abort link hits a 404 endpoint.

      The screenshot was after a resumed Pipeline, but I can also reproduce this with a simple input step, e.g.:

      node {
        stage('Build') { sh 'echo "Hi"' }
        stage('Deploy') {
          input message: 'Deploy?', ok: 'Ship It!'
        }
      }
      

        1. about.md
          18 kB
        2. console-output.har
          448 kB
        3. console-output-network.png
          console-output-network.png
          185 kB
        4. Selection_043.png
          Selection_043.png
          56 kB

          [JENKINS-41015] Cannot abort input step anymore in Console Output

          Carlos Rodríguez López added a comment - - edited

          Similar Behaviour observed but getting a 405 (not 404), see section Result > JS Debug Console

          Environment 

          See attached about.md

          Jenkinsfile

           

          stage('Test') {
           node { echo "hi"}
           try {
              timeout(time:2, unit:'MINUTES') {
                 input message: "Ready to publish?", ok: 'Publish'
             } 
           } finally {
             node { echo "bye"}
           }
          }

          Result

          Input options via Console Output does not work

          JS Debug Console

          VM5689:1 OPTIONS http://127.0.0.1:8080/job/test1-Scripted_bug/7/input/D8cfa70e6608717c08486ae3035ac018/proceedEmpty net::ERR_ABORTED
          (anonymous) @ VM5689:1
          request @ prototype.js:1585
          initialize @ prototype.js:1550
          (anonymous) @ prototype.js:452
          klass @ prototype.js:101
          onclick @ console:1
          console:1 Failed to load http://127.0.0.1:8080/job/test1-Scripted_bug/7/input/D8cfa70e6608717c08486ae3035ac018/proceedEmpty: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 405.

          JS Debug  Network

          Addtional notes

          • Using other methods like Input menu (`<JENKINS_URL>/<PIPELINE_JOB>/<BUILD_NUMBER>/input/`) or Pipeline Stage View works
          • HAR.file attached

           

           

           

          Carlos Rodríguez López added a comment - - edited Similar Behaviour observed but getting a 405 (not 404), see section Result > JS Debug Console Environment  See attached about.md Jenkinsfile   stage( 'Test' ) { node { echo "hi" } try { timeout(time:2, unit: 'MINUTES' ) { input message: "Ready to publish?" , ok: 'Publish' } } finally { node { echo "bye" } } } Result Input options via Console Output does not work JS Debug Console VM5689:1 OPTIONS http: //127.0.0.1:8080/job/test1-Scripted_bug/7/input/D8cfa70e6608717c08486ae3035ac018/proceedEmpty net::ERR_ABORTED (anonymous) @ VM5689:1 request @ prototype.js:1585 initialize @ prototype.js:1550 (anonymous) @ prototype.js:452 klass @ prototype.js:101 onclick @ console:1 console:1 Failed to load http: //127.0.0.1:8080/job/test1-Scripted_bug/7/input/D8cfa70e6608717c08486ae3035ac018/proceedEmpty: Response to preflight request doesn 't pass access control check: No ' Access-Control-Allow-Origin ' header is present on the requested resource. Origin ' http://localhost:8080' is therefore not allowed access. The response had HTTP status code 405. JS Debug  Network Addtional notes Using other methods like Input menu (`<JENKINS_URL>/<PIPELINE_JOB>/<BUILD_NUMBER>/input/`) or Pipeline Stage View works HAR.file attached      

          Andrew Bayer added a comment -

          Seems to be working for me with pipeline-input-step 2.8 and core 2.89.3.

          Andrew Bayer added a comment - Seems to be working for me with pipeline-input-step 2.8 and core 2.89.3.

          Ganesh Murthy added a comment -

          I am able to reproduce this issue with pipeline-input-step 2.10 and pipeline 2.6.

          Ganesh Murthy added a comment - I am able to reproduce this issue with pipeline-input-step 2.10 and pipeline 2.6.

          Seph Soliman added a comment - - edited

          The issue is still present in Jenkins 2.359 with Pipeline: Input Step, Version 449.v77f0e8b_845c4 installed.

          The issue is that question marks are not encoded, which is unfortunate given the likelihood that they'll be used during an input (ie. a question is being asked to the user). The questionmark is sent as-is, ie:

          ...42/input/Deploy%20now?/abort

          Which causes the URL to be invalid/stop after "now?" so the important "/abort" part is ignored, hence no action.
          It should have been:

          ...42/input/Deploy%20now%3F/abort

          Which will correctly abort.

          Ganesh and Tyler: The solution is to avoid using question marks in your input questions. No joke.

          (This may be the same as JENKINS-34862 - but an actual bug, not a config issue)

          Seph Soliman added a comment - - edited The issue is still present in Jenkins 2.359 with Pipeline: Input Step, Version 449.v77f0e8b_845c4 installed. The issue is that question marks are not encoded, which is unfortunate given the likelihood that they'll be used during an input (ie. a question is being asked to the user). The questionmark is sent as-is, ie: ...42/input/Deploy%20now ? /abort Which causes the URL to be invalid/stop after "now?" so the important "/abort" part is ignored, hence no action. It should have been: ...42/input/Deploy%20now %3F /abort Which will correctly abort. Ganesh and Tyler: The solution is to avoid using question marks in your input questions. No joke. (This may be the same as  JENKINS-34862  - but an actual bug, not a config issue)

          Seph Soliman added a comment -

          Seph Soliman added a comment - Added PR to fix it: https://github.com/jenkinsci/pipeline-input-step-plugin/pull/112  

          James Nord added a comment - - edited

          Fwiw I think the correct workaround is to add an id to the input step usage so that it does not use the one generated from the message.

           

          Eg

           

          input id: 'publish', message: "Ready to publish?", ok: 'Publish'

           

           

          James Nord added a comment - - edited Fwiw I think the correct workaround is to add an id to the input step usage so that it does not use the one generated from the message.   Eg   input id: 'publish', message: "Ready to publish?", ok: 'Publish'    

          Daniel Beck added a comment -

          In my limited testing, this only happens when the id of the input contains a ? , and it it being aborted from Pipeline Stage View, rather than the build log. I have not tested Blue Ocean. Does that match other commenters' experience?

          Daniel Beck added a comment - In my limited testing, this only happens when the id of the input contains a ? , and it it being aborted from Pipeline Stage View , rather than the build log. I have not tested Blue Ocean. Does that match other commenters' experience?

          James Nord added a comment -

          I think I have an idea what may be happening here.

          James Nord added a comment - I think I have an idea what may be happening here.

            cloudbees CloudBees Inc.
            rtyler R. Tyler Croy
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: