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

Parameterized Remote Trigger does not use URL for Build Token Root Plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins ver 2.126 (local) and 2.118 (remote)
      Parameterized Remote Trigger Plugin ver 3.0.0
      Build Token Root Plugin ver 1.4

      I have configured a Remote Host as shown in the following screenshot. Notably, I have checked the box to use the 'build token root' support. I expect no authentication is necessary for this, per the description of the Build Token Root Plugin.

      However, when I try to run a remote job from a pipeline using this:

      triggerRemoteJob job: 'fake-qg1', parameters: 'someParam=hi world', remoteJenkinsName: 'Remote Test Jenkins', token: 'sometokenyoullneverguess'
      

      It does not use the build token root endpoint, and therefore it fails due to authentication issues.

      [Pipeline] triggerRemoteJob
      ################################################################################################################
        Parameterized Remote Trigger Configuration:
          - job:                     fake-qg1 
          - remoteJenkinsName:       Remote Test Jenkins
          - auth:                    'No Authentication'
          - parameters:              [someParam=hi world]
          - blockBuildUntilComplete: true
          - connectionRetryLimit:    5
      ################################################################################################################
      ERROR: Remote build failed with 'ForbiddenException' for the following reason: 'Server returned 403 - Forbidden. User does not have enough permissions for this request: http://***redacted***/jenkins/job/fake-qg1/api/json'.
      

      If I use an API Token, then it, of course works. But I want to use the 'Build Token Root Plugin' method of triggering the job. The correct URL (I believe something like /jenkins/buildByToken/buildWithParameters? job=NAME&token=SECRET) needs to be used instead of the regular job API which requires an authenticated user.

      I have confirmed that the build token root URL is available on the remote Jenkins, but it appears the Parameterized Remote Trigger Plugin is not even trying to use it, despite having checked the "Enable 'build token root' support" checkbox in the Remote Host configuration.

            cashlalala KaiHsiang Chang
            tommyludwig Tommy Ludwig
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: