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

ComputedFolder shows BuildAuthorizationToken configuration but does not actually support it

      Trying to use the "Trigger builds remotely (e.g., from scripts)" Build Trigger from a multibranch pipeline project doesn't seem to work.

      If I check off the box and type in a token and click save, the job saves successfully but it does not write an authToken element to the job config and the item is unchecked in the configuration when I reload the page. Even manually setting an authToken and POSTing the config doesn't work. While the element is there in the config, I'm not able to kick a job off with the token.

      I can post some screenshots and config snippets if that will be helpful, but this seems to be reproducible easily enough that it might be overkill.

      I've been able to reproduce this with a fresh Jenkins 2.x install as well.

      Repro case

      Given: A Jenkins 1.651.2 instance with some kind of security enabled (e.g. anonymous users cannot build jobs). And the pipeline plugins installed.

      1. Create a freestyle or single pipeline job.
      2. Under "Build Triggers," select "Trigger builds remotely (e.g., from scripts)"
      3. Enter "hello" in the "Authentication Token" field
      4. Save the job.
      5. POST to jobUrl/build?token=hello (e.g. curl -XPOST http://172.17.0.2:8080/job/freestyle/build?token=hello)
      6. Observe the job is triggered.
      7. Create a multibranch pipeline job.
      8. Add an authentication token as above.
      9. Save the job.
      10. POST to jobUrl/build?token=hello (e.g. curl -XPOST http://172.17.0.2:8080/job/multibranch/build?token=hello)
      11. Observe you receive an "Authentication required" error.
      12. Go back to the job configuration and observe the Build Trigger isn't enabled.

          [JENKINS-35310] ComputedFolder shows BuildAuthorizationToken configuration but does not actually support it

          Norm MacLennan created issue -
          Manuel Recena Soto made changes -
          Assignee Original: Manuel Recena Soto [ recena ] New: Jesse Glick [ jglick ]

          Jesse Glick added a comment -

          Add an authentication token as above. Save the job.

          Can you be more specific? This is currently impossible: there is no “trigger builds remotely” option on the multibranch folder; and the branch projects are read-only so they have no Save button.

          As noted in JENKINS-30519, it could be made possible somehow.

          Jesse Glick added a comment - Add an authentication token as above. Save the job. Can you be more specific? This is currently impossible: there is no “trigger builds remotely” option on the multibranch folder; and the branch projects are read-only so they have no Save button. As noted in JENKINS-30519 , it could be made possible somehow.
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-30519 [ JENKINS-30519 ]
          Norm MacLennan made changes -
          Attachment New: config-screen.png [ 32915 ]

          Hi jglick,

          I do see the option in my multibranch folder (or maybe we're talking about different things).

          I'm doing this in a docker container, so I don't (or shouldn't) have any other plugins or weird configuration messing things up.

          I ran: docker run -it --rm jenkins:2.3. Then I went through the set-up flow, installed recommended plugins, and created an admin user. I clicked "New Item" and chose to make a MutliBranch Pipeline. The config screen looks like the below. If I fill in that box and click save, the setting doesn't get put into the job config.

          This happens for regular (non-multibranch) pipeline projects as well. The same thing also happens in latest jenkins 1.x image, but it is a lengthier repro case.

          Norm MacLennan added a comment - Hi jglick , I do see the option in my multibranch folder (or maybe we're talking about different things). I'm doing this in a docker container, so I don't (or shouldn't) have any other plugins or weird configuration messing things up. I ran: docker run -it --rm jenkins:2.3 . Then I went through the set-up flow, installed recommended plugins, and created an admin user. I clicked "New Item" and chose to make a MutliBranch Pipeline. The config screen looks like the below. If I fill in that box and click save, the setting doesn't get put into the job config. This happens for regular (non-multibranch) pipeline projects as well. The same thing also happens in latest jenkins 1.x image, but it is a lengthier repro case.

          I am seeing the same issue with multi-branch pipeline

          The "Trigger builds remotely" will not save the Authentication token. You can enter it - but it never gets saved

          Warren Strange added a comment - I am seeing the same issue with multi-branch pipeline The "Trigger builds remotely" will not save the Authentication token. You can enter it - but it never gets saved

          Ben Hawkins added a comment -

          I am also experiencing this issue.

          Ben Hawkins added a comment - I am also experiencing this issue.

          Lars Povlsen added a comment - - edited

          Jesse, I'm also seeing this. I think the confusion is between the top-level project "Configure" and the branch object "View Configuration".

          Btw, if anyone has a workaround for this I'ld be happy to hear about it. (I'm using periodic build atm, which just doesn't scale well....).

          I'm on 2.7 for the record.

          Lars Povlsen added a comment - - edited Jesse, I'm also seeing this. I think the confusion is between the top-level project "Configure" and the branch object "View Configuration". Btw, if anyone has a workaround for this I'ld be happy to hear about it. (I'm using periodic build atm, which just doesn't scale well....). I'm on 2.7 for the record.

          Axel Kämpfe added a comment -

          Hey, i can confirm this also on the latest versions of Jenkins (2.8) and with up-to-date plugins list.

          i have created a fresh multibranch-pipeline (MBP) project where i want to call depending, also MBP projects to be build after each other.
          unfortunately, in the "main" project config ( not in the branch specific ) it is not possible to save the option "Trigger builds remotely"

          Axel Kämpfe added a comment - Hey, i can confirm this also on the latest versions of Jenkins (2.8) and with up-to-date plugins list. i have created a fresh multibranch-pipeline (MBP) project where i want to call depending, also MBP projects to be build after each other. unfortunately, in the "main" project config ( not in the branch specific ) it is not possible to save the option "Trigger builds remotely"

            jglick Jesse Glick
            nmaclennan Norm MacLennan
            Votes:
            19 Vote for this issue
            Watchers:
            38 Start watching this issue

              Created:
              Updated:
              Resolved: