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

Parameterized Remote Trigger Plugin is not triggering job in remote jenkins

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • None
    • Parameterized Remote Trigger Plugin version - 3.0.3
      My Jenkins version - 2.121.2
      Remote Jenkins version - 2.73.3

      While triggering remote jenkins job from my local jenkins it was working with the version 2.2.2. But since few weeks it was not triggering, so we have updated the Parameterized Remote Trigger Plugin version from 2.2.2 to 3.0.3. But still the remote jenkins job and was showing the below issue:

      Run condition [Execute Windows Batch commands] enabling perform for step [BuilderChain]
      ERROR: Build step failed with exception
      java.lang.NullPointerException
      at org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.evaluateEffectiveRemoteHost(RemoteBuildConfiguration.java:385)
      at org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.perform(RemoteBuildConfiguration.java:533)
      at org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.perform(RemoteBuildConfiguration.java:514)
      at org.jenkinsci.plugins.conditionalbuildstep.BuilderChain.perform(BuilderChain.java:71)
      at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110)
      at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154)
      at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105)
      at org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder.perform(ConditionalBuilder.java:134)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
      at hudson.model.Build$BuildExecution.build(Build.java:206)
      at hudson.model.Build$BuildExecution.doRun(Build.java:163)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      at hudson.model.Run.execute(Run.java:1798)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:97)
      at hudson.model.Executor.run(Executor.java:429)
      Build step 'Conditional steps (multiple)' marked build as failure

      In the remote jenkins i have given a folder path, in that particular folder it has around 5 jobs and I wanted to trigger all of them. But it triggers 1st job alone and fails with the above issue.

       

          [JENKINS-52810] Parameterized Remote Trigger Plugin is not triggering job in remote jenkins

          KaiHsiang Chang added a comment - - edited

          Some configurations were misled before v2.x.x, the URL of remote server configuration should be the root URL of remote jenkins, or the build number can't be fetched correctly. 

          If you have trouble when upgrading, try to fix the configuration in your test environment or you can choose to stay in the old version if no new features are required.

          KaiHsiang Chang added a comment - - edited Some configurations were misled before v2.x.x, the URL of remote server configuration should be the root URL of remote jenkins, or the build number can't be fetched correctly.  If you have trouble when upgrading, try to fix the configuration in your test environment or you can choose to stay in the old version if no new features are required.

          Dinesh added a comment - - edited

          cashlalala, Still I have validated the configurations comparing with yours, and now the build is not failing. Now I am facing issue as below, and the build is not ending and still it tried to run the 1st build job in the folder again and again, and it is not trying to execute the 2nd and next build jobs in the folder:

          Can you please try to trigger more than 1 job in a particular folder and update whether it is triggering all of them.

           

          ################################################################################################################
          Parameterized Remote Trigger Configuration:

          • job: <path_name>/<folder_name>/<FirstJobName>
          • remoteJenkinsName: Jenkins Server
          • parameters: [Version1=test22, Version2=test21]
          • blockBuildUntilComplete: false
          • connectionRetryLimit: 5
            ################################################################################################################
            fail to accquire lock because of timeout, skip locking...
            Triggering parameterized remote job 'http://<Jenkins:8080>/job/<FirstJobName>'
            Using globally defined 'Credentials Authentication' as user 'username' (Credentials ID 'my credentials id')
            Triggering remote job now.
            fail to accquire lock because of timeout, skip locking...
            CSRF protection is disabled on the remote server.
            fail to accquire lock because of timeout, skip locking...
            The remote job is blocked. Build #58 is already in progress (ETA:34 min).
            Remote job queue number: 101142
            Waiting for remote build to be executed...
            Waiting for 10 seconds until next poll.
            fail to accquire lock because of timeout, skip locking...
            The remote job is blocked. Build #58 is already in progress (ETA:33 min).
            Waiting for 10 seconds until next poll.
            fail to accquire lock because of timeout, skip locking...
            The remote job is blocked. Build #58 is already in progress (ETA:33 min).
            Waiting for 10 seconds until next poll.
            fail to accquire lock because of timeout, skip locking...
            The remote job is blocked. Build #58 is already in progress (ETA:33 min).
            Waiting for 10 seconds until next poll.
            fail to accquire lock because of timeout, skip locking...
            The remote job is blocked. Build #58 is already in progress (ETA:32 min).
            Waiting for 10 seconds until next poll.
            fail to accquire lock because of timeout, skip locking...
            The remote job is blocked. Build #58 is already in progress (ETA:32 min).
            Waiting for 10 seconds until next poll.
            fail to accquire lock because of timeout, skip locking...
            The remote job is blocked. Build #58 is already in progress (ETA:32 min).
            Waiting for 10 seconds until next poll.
            fail to accquire lock because of timeout, skip locking...
            The remote job is blocked. Build #58 is already in progress (ETA:31 min).
            Waiting for 10 seconds until next poll.
            fail to accquire lock because of timeout, skip locking...

          Dinesh added a comment - - edited cashlalala , Still I have validated the configurations comparing with yours, and now the build is not failing. Now I am facing issue as below, and the build is not ending and still it tried to run the 1st build job in the folder again and again, and it is not trying to execute the 2nd and next build jobs in the folder: Can you please try to trigger more than 1 job in a particular folder and update whether it is triggering all of them.   ################################################################################################################ Parameterized Remote Trigger Configuration: job: <path_name>/<folder_name>/<FirstJobName> remoteJenkinsName: Jenkins Server parameters: [Version1=test22, Version2=test21] blockBuildUntilComplete: false connectionRetryLimit: 5 ################################################################################################################ fail to accquire lock because of timeout, skip locking... Triggering parameterized remote job 'http://<Jenkins:8080>/job/<FirstJobName>' Using globally defined 'Credentials Authentication' as user 'username' (Credentials ID 'my credentials id') Triggering remote job now. fail to accquire lock because of timeout, skip locking... CSRF protection is disabled on the remote server. fail to accquire lock because of timeout, skip locking... The remote job is blocked. Build #58 is already in progress (ETA:34 min). Remote job queue number: 101142 Waiting for remote build to be executed... Waiting for 10 seconds until next poll. fail to accquire lock because of timeout, skip locking... The remote job is blocked. Build #58 is already in progress (ETA:33 min). Waiting for 10 seconds until next poll. fail to accquire lock because of timeout, skip locking... The remote job is blocked. Build #58 is already in progress (ETA:33 min). Waiting for 10 seconds until next poll. fail to accquire lock because of timeout, skip locking... The remote job is blocked. Build #58 is already in progress (ETA:33 min). Waiting for 10 seconds until next poll. fail to accquire lock because of timeout, skip locking... The remote job is blocked. Build #58 is already in progress (ETA:32 min). Waiting for 10 seconds until next poll. fail to accquire lock because of timeout, skip locking... The remote job is blocked. Build #58 is already in progress (ETA:32 min). Waiting for 10 seconds until next poll. fail to accquire lock because of timeout, skip locking... The remote job is blocked. Build #58 is already in progress (ETA:32 min). Waiting for 10 seconds until next poll. fail to accquire lock because of timeout, skip locking... The remote job is blocked. Build #58 is already in progress (ETA:31 min). Waiting for 10 seconds until next poll. fail to accquire lock because of timeout, skip locking...

          Dinesh added a comment -

          The issue got resolved when the parameter "Block until the remote triggered projects finish their builds" is set to false (Uncheck the check box). The build is green now. Thank you for the support provided cashlalala.

          Dinesh added a comment - The issue got resolved when the parameter "Block until the remote triggered projects finish their builds" is set to false (Uncheck the check box). The build is green now. Thank you for the support provided cashlalala .

          Although I'm not a supporter, still glad to hear you solved it. 

          Give a like on github if you don't mind, and you can also try to file some PRs about the configuration experience if you have free time.

          KaiHsiang Chang added a comment - Although I'm not a supporter, still glad to hear you solved it.  Give a like on github if you don't mind, and you can also try to file some PRs about the configuration experience if you have free time.

          Robert Hencke added a comment -

          This is a bug not around the URL being null, but around the hostLocks and hostPermits fields being null when deserializing older configurations.

          I have submitted a pull request to fix here:

          https://github.com/jenkinsci/parameterized-remote-trigger-plugin/pull/47

          Robert Hencke added a comment - This is a bug not around the URL being null, but around the hostLocks and hostPermits fields being null when deserializing older configurations. I have submitted a pull request to fix here: https://github.com/jenkinsci/parameterized-remote-trigger-plugin/pull/47

          PR 47 resolved 

          KaiHsiang Chang added a comment - PR 47  resolved 

          Rick Liu added a comment - - edited

          Job Jenkins server:
          Jenkins core. v.2.121.3
          Parameterized Remote Trigger Plugin v.3.0.6

          Remote Jenkins server:
          Jenkins core. v.2.121.3

          I still see this error from the job console:

          [Pipeline] triggerRemoteJob
          ################################################################################################################
          Parameterized Remote Trigger Configuration:

          Pipeline code:
          triggerRemoteJob auth: CredentialsAuth(credentials: 'xxxxxxxxxxxxx'),
          blockBuildUntilComplete: false,
          job: 'https://jenkins-robot.corp.fortinet.com/job/FortiOS_Automated_Test_6.0/job/FOS_Distributed_Smoke_Test',
          parameters: """BUILD=${build}\nLABEL=ECO_${ECO_ID}\nENV=SMOKE_PRODUCTION""", pollInterval: 300

          Rick Liu added a comment - - edited Job Jenkins server: Jenkins core. v.2.121.3 Parameterized Remote Trigger Plugin v.3.0.6 Remote Jenkins server: Jenkins core. v.2.121.3 I still see this error from the job console: [Pipeline] triggerRemoteJob ################################################################################################################ Parameterized Remote Trigger Configuration: job: https://jenkins-robot.corp.fortinet.com/job/FortiOS_Automated_Test_6.0/job/FOS_Distributed_Smoke_Test auth: 'Credentials Authentication' as user 'xxxxxx' (Credentials ID 'xxxxxxxxxxxxx') parameters: [BUILD=5098, LABEL=ECO_130206, ENV=SMOKE_PRODUCTION] blockBuildUntilComplete: false connectionRetryLimit: 5 ################################################################################################################ fail to accquire lock because of timeout, skip locking... Triggering parameterized remote job 'https://jenkins-robot.corp.fortinet.com/job/FortiOS_Automated_Test_6.0/job/FOS_Distributed_Smoke_Test' Using job-level defined 'Credentials Authentication' as user 'xxxxxx' (Credentials ID 'xxxxxxxxxxxxx') Triggering remote job now. fail to accquire lock because of timeout, skip locking... CSRF protection is disabled on the remote server. fail to accquire lock because of timeout, skip locking... Connection to remote server failed [404] , waiting for to retry - 300 seconds until next attempt. URL: https://jenkins-robot.corp.fortinet.com/queue/item/114603/api/json/ , parameters: Retry attempt #1 out of 5 Connection to remote server failed [404] , waiting for to retry - 300 seconds until next attempt. URL: https://jenkins-robot.corp.fortinet.com/queue/item/114603/api/json/ , parameters: Retry attempt #2 out of 5 Connection to remote server failed [404] , waiting for to retry - 300 seconds until next attempt. URL: https://jenkins-robot.corp.fortinet.com/queue/item/114603/api/json/ , parameters: Retry attempt #3 out of 5 Connection to remote server failed [404] , waiting for to retry - 300 seconds until next attempt. URL: https://jenkins-robot.corp.fortinet.com/queue/item/114603/api/json/ , parameters: Retry attempt #4 out of 5 Connection to remote server failed [404] , waiting for to retry - 300 seconds until next attempt. URL: https://jenkins-robot.corp.fortinet.com/queue/item/114603/api/json/ , parameters: Retry attempt #5 out of 5 ERROR: Remote build failed with 'ExceedRetryLimitException' for the following reason: 'Max number of connection retries have been exeeded.'. Pipeline code: triggerRemoteJob auth: CredentialsAuth(credentials: 'xxxxxxxxxxxxx'), blockBuildUntilComplete: false, job: 'https://jenkins-robot.corp.fortinet.com/job/FortiOS_Automated_Test_6.0/job/FOS_Distributed_Smoke_Test', parameters: """BUILD=${build}\nLABEL=ECO_${ECO_ID}\nENV=SMOKE_PRODUCTION""", pollInterval: 300

          Rick Liu added a comment -

          I'm sorry.
          I was trying to re-open the issue,
          but clicked the wrong butto to resolve the issue.

          Could anyone help me to revert my action?

          Rick Liu added a comment - I'm sorry. I was trying to re-open the issue, but clicked the wrong butto to resolve the issue. Could anyone help me to revert my action?

          totoroliu - I've run into this issue recently and it seems to occur when I up the polling time from 30 seconds to 300. If I use 30, it works again.

          Philip Johnson added a comment - totoroliu - I've run into this issue recently and it seems to occur when I up the polling time from 30 seconds to 300. If I use 30, it works again.

          Ivan added a comment -

          Hi all, 

          before I open new one i want to try it here. Have similar problem where i following the documentation [here|https://www.jenkins.io/doc/pipeline/steps/Parameterized-Remote-Trigger/.] 

          I'm getting this error/warming message and 403 error when i use "remoteJenkinsURL" instead of "remoteJenkinsName"

          [Pipeline] triggerRemoteJob 11:37:15 WARNING: Unknown parameter(s) found for class type 'org.jenkinsci.plugins.ParameterizedRemoteTrigger.pipeline.RemoteBuildPipelineStep': auth2
          

          **Here is the conf im using it

          stage ("SOME PLUGIN") {
                  steps {
                      script {
                          //Trigger remote job
                          def handle = triggerRemoteJob(
                              // remoteJenkinsName: "JenkinsB",
                              remoteJenkinsUrl: 'https://something.com/jenkins/something', 
                              job: 'taskdir/task01',
                              auth2: TokenAuth(userName: 'user', apiToken: 'token'),
                              trustAllCertificates: true,
                              overrideTrustAllCertificates: true,
                              parameters: "project_name=TEST\nSTACK_NAME=${STACK_NAME}"
                              )            }
                  }
              }   
          
          

          And the error is :

          Connection to remote server failed [403], waiting to retry - 10 seconds until next attempt. URL:
          https://something.com/jenkins/something/job/taskdir/job/task01/api/json, parameters:
          

           

          Ivan added a comment - Hi all,  before I open new one i want to try it here. Have similar problem where i following the documentation [here| https://www.jenkins.io/doc/pipeline/steps/Parameterized-Remote-Trigger/ .]  I'm getting this error/warming message and 403 error when i use "remoteJenkinsURL" instead of "remoteJenkinsName" [Pipeline] triggerRemoteJob 11:37:15 WARNING: Unknown parameter(s) found for class type 'org.jenkinsci.plugins.ParameterizedRemoteTrigger.pipeline.RemoteBuildPipelineStep' : auth2 **Here is the conf im using it stage ( "SOME PLUGIN" ) { steps { script { //Trigger remote job def handle = triggerRemoteJob( // remoteJenkinsName: "JenkinsB" , remoteJenkinsUrl: 'https: //something.com/jenkins/something' , job: 'taskdir/task01' , auth2: TokenAuth(userName: 'user' , apiToken: 'token' ), trustAllCertificates: true , overrideTrustAllCertificates: true , parameters: "project_name=TEST\nSTACK_NAME=${STACK_NAME}" ) } } } And the error is : Connection to remote server failed [403], waiting to retry - 10 seconds until next attempt. URL: https: //something.com/jenkins/something/job/taskdir/job/task01/api/json, parameters:  

            cashlalala KaiHsiang Chang
            dineshkumar_n Dinesh
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: