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

buildWithParameters with POST request and empty parameters will run build indefinitely

    XMLWordPrintable

Details

    Description

      Hi,

      I noticed odd behavior. When you trigger parameterized builds via url using POST request, but no variables are set in UI, Jenkins will run build indefinitely, eventually killing it.

      Here are steps to reproduce:

      1. Enable invoking builds via url (check option "Trigger builds remotely (e.g., from scripts)" on).
      2. Enable parameterized builds (check option "This project is parameterized" on).
      3. Click "Add Parameter", choose String, but do not enter any value. Save settings.
      4. Invoke that url with POST request and random parameter, like down below.
      5. UI (maybe even build) will continue to run for long time, even if normal build is couple of seconds.

      No plugin is used for this, just stock Jenkins.

      Command to reproduce step 4.:

      curl -X POST http://jenkins-url/buildWithParameters?THIS_PARAMETER_IS_NOT_SET_IN_UI=1

      Attachments

        Activity

          danielbeck Daniel Beck added a comment -

          I am unable to reproduce the reported behavior on a newly set up Jenkins instance.

          As 2.222.x requires a crumb issuer unless jumping through hoops, I went to the URL and clicked "Retry using POST" instead of using curl.

          The only curious behavior I saw was that this URL does not override the quiet period, so if that's configured to be very long, the build will wait in the queue for a long time.

          At the moment the build isn't behaving as you expect it to, obtain a thread dump: https://wiki.jenkins.io/display/JENKINS/Obtaining+a+thread+dump

          This can help understand what's going on. As is, this report doesn't have enough information to investigate further.

          danielbeck Daniel Beck added a comment - I am unable to reproduce the reported behavior on a newly set up Jenkins instance. As 2.222.x requires a crumb issuer unless jumping through hoops, I went to the URL and clicked "Retry using POST" instead of using curl . The only curious behavior I saw was that this URL does not override the quiet period, so if that's configured to be very long, the build will wait in the queue for a long time. At the moment the build isn't behaving as you expect it to, obtain a thread dump: https://wiki.jenkins.io/display/JENKINS/Obtaining+a+thread+dump This can help understand what's going on. As is, this report doesn't have enough information to investigate further.

          People

            Unassigned Unassigned
            sanel Sanel Zukan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: