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

Jenkins parameterized remote trigger plugin shows null pointer exception

      I have a jenkins job that triggers a job on a remote server(another jenkins instance), but the job fails with this error on the console

       

      Remote Jenkins server returned empty response or invalid JSON - but we can still proceed with the remote build.
       Triggering this remote job: <job-name>
       Not checking if the remote job <job-name> is building.
       Remote Jenkins server returned empty response or invalid JSON - but we can still proceed with the remote build.
       ERROR: Remote build failed for the following reason, but the build will continue:
       ERROR
       : Got a blank response from Remote Jenkins Server [
       http://jenkins-instance.org.com
       ], cannot continue.
       ERROR
       : Build step failed with exception
       java.lang.NullPointerException 
       Build step 'Trigger a remote parameterized job' marked build as failure
       [BFA] Scanning build for known causes...
       [BFA] No failure causes found
       [BFA] Done. 0s
       Finished: FAILURE

          [JENKINS-53813] Jenkins parameterized remote trigger plugin shows null pointer exception

          Update: updating the parameterized remote trigger plugin fixed the issue, but there is a different error now
           
           fail to accquire lock because of timeout, skip locking...
          Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: https://jenkins.org.com/job/job_name/api/json, parameters:
          Retry attempt #1 out of 5
          Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: https://jenkins.org.com/job/job_name/api/json, parameters, parameters:
          Retry attempt #2 out of 5
          Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: https://jenkins.org.com/job/job_name/api/json, parameters, parameters:
          Retry attempt #3 out of 5
          Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: https://jenkins.org.com/job/job_name/api/json, parameters, parameters:
          Retry attempt #4 out of 5
          Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: https://jenkins.org.com/job/job_name/api/json, parameters, parameters:
          Retry attempt #5 out of 5
          FATAL: Max number of connection retries have been exeeded.
          org.jenkinsci.plugins.ParameterizedRemoteTrigger.exceptions.ExceedRetryLimitException: Max number of connection retries have been exeeded.
          at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.sendHTTPCall(HttpHelper.java:526)
          at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.sendHTTPCall(HttpHelper.java:521)
          at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.sendHTTPCall(HttpHelper.java:521)

          Priyanka Panda added a comment - Update: updating the parameterized remote trigger plugin fixed the issue, but there is a different error now    fail to accquire lock because of timeout, skip locking... Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: https://jenkins.org.com/job/job_name/api/json , parameters: Retry attempt #1 out of 5 Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: https://jenkins.org.com/job/job_name/api/json , parameters, parameters: Retry attempt #2 out of 5 Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: https://jenkins.org.com/job/job_name/api/json , parameters, parameters: Retry attempt #3 out of 5 Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: https://jenkins.org.com/job/job_name/api/json , parameters, parameters: Retry attempt #4 out of 5 Connection to remote server failed , waiting for to retry - 10 seconds until next attempt. URL: https://jenkins.org.com/job/job_name/api/json , parameters, parameters: Retry attempt #5 out of 5 FATAL: Max number of connection retries have been exeeded. org.jenkinsci.plugins.ParameterizedRemoteTrigger.exceptions.ExceedRetryLimitException: Max number of connection retries have been exeeded. at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.sendHTTPCall(HttpHelper.java:526) at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.sendHTTPCall(HttpHelper.java:521) at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.sendHTTPCall(HttpHelper.java:521)

          Please also provide your remote server config and job config. 

          KaiHsiang Chang added a comment - Please also provide your remote server config and job config. 

          Done.

          Also in the remote server config it shows, "

          Address looks good, but a connection could not be stablished."

          But i can access the same URL through my browser

           

          Priyanka Panda added a comment - Done. Also in the remote server config it shows, " Address looks good, but a connection could not be stablished." But i can access the same URL through my browser  

          How about curl the link form your host which runs Jenkins server? 

           

          KaiHsiang Chang added a comment - How about curl the link form your host which runs Jenkins server?   

          Priyanka Panda added a comment - - edited

          curl from my host server connects me to the remote server without any error for https://jenkins-instance.org.com link

          on the other hand http throws this error

          <html>
          <head><title>301 Moved Permanently</title></head>
          <body bgcolor="white">
          <center><h1>301 Moved Permanently</h1></center>
          <hr><center>nginx/1.12.2</center>
          </body>
          </html>

          Priyanka Panda added a comment - - edited curl from my host server connects me to the remote server without any error for https://jenkins-instance.org.com link on the other hand http throws this error <html> <head><title>301 Moved Permanently</title></head> <body bgcolor="white"> <center><h1>301 Moved Permanently</h1></center> <hr><center>nginx/1.12.2</center> </body> </html>

          something wrong with your proxy sever setting IMO, 

          generally speaking, curl a Jenkins main page should return 200 or maybe either 403 or 401 if any security settings were configured,  even with a proxy server.

          for example,

          [xxx@xxx logs]$curl -I http://myjks/01/
          HTTP/1.1 200 OK
          Date: Fri, 28 Sep 2018 05:42:58 GMT
          X-Content-Type-Options: nosniff
          Set-Cookie: ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE=;Path=/hcswcis01;Expires=Thu, 01-Jan-1970 00:00:00 GMT;Max-Age=0;HttpOnly
          Expires: Thu, 01 Jan 1970 00:00:00 GMT
          Cache-Control: no-cache,no-store,must-revalidate
          X-Hudson-Theme: default
          Referrer-Policy: same-origin
          Content-Type: text/html;charset=utf-8
          Set-Cookie: JSESSIONID.e5d5b7ea=node03kmibbixqi02uz1r64zya6ij94.node0;Path=/hcswcis01;HttpOnly
          X-Hudson: 1.395
          X-Jenkins: 2.138.1
          X-Jenkins-Session: cf840d79
          X-Hudson-CLI-Port: 32001
          X-Jenkins-CLI-Port: 32001
          X-Jenkins-CLI2-Port: 32001
          X-Frame-Options: sameorigin
          X-Instance-Identity: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiMbiAi3UyrabxZdP/7qzD9bg7bb8ti72ME7F/5Xw41yEw186+f7uXB8mF80WXY+9NodgZd6jkTw2nKjiDM/qArOOVnYoEDYFqworqIHEhX7UAA6BKydlAl33Z9FF6WLx2O6mtXTXxfwF/M3/mDa9bgKfrL6rINXpuDyDw5kzj3owF+epNEQyrNDGF8ait36Re+rN6Wae1qWS8cyWZstYfdkar2dP9m5X/HhA9oprnuz1q69QZQGRpaHvu6P6+5AjsNSFJVC9djfEFSOMrgqkAOwFYCUewyCEuFUsN1fWW0azS6QfFH/TsngwgnLbFLaj+NfzU8n7OT2M6ip8+X/sZwIDAQAB
          Content-Length: 26762
          Server: Jetty(9.4.z-SNAPSHOT)

           

          I don't think this is a bug. 

           

           

          KaiHsiang Chang added a comment - something wrong with your proxy sever setting IMO,  generally speaking, curl a Jenkins main page should return 200 or maybe either 403 or 401 if any security settings were configured,  even with a proxy server. for example, [xxx@xxx logs] $curl -I http://myjks/01/ HTTP/1.1 200 OK Date: Fri, 28 Sep 2018 05:42:58 GMT X-Content-Type-Options: nosniff Set-Cookie: ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE=;Path=/hcswcis01;Expires=Thu, 01-Jan-1970 00:00:00 GMT;Max-Age=0;HttpOnly Expires: Thu, 01 Jan 1970 00:00:00 GMT Cache-Control: no-cache,no-store,must-revalidate X-Hudson-Theme: default Referrer-Policy: same-origin Content-Type: text/html;charset=utf-8 Set-Cookie: JSESSIONID.e5d5b7ea=node03kmibbixqi02uz1r64zya6ij94.node0;Path=/hcswcis01;HttpOnly X-Hudson: 1.395 X-Jenkins: 2.138.1 X-Jenkins-Session: cf840d79 X-Hudson-CLI-Port: 32001 X-Jenkins-CLI-Port: 32001 X-Jenkins-CLI2-Port: 32001 X-Frame-Options: sameorigin X-Instance-Identity: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiMbiAi3UyrabxZdP/7qzD9bg7bb8ti72ME7F/5Xw41yEw186+f7uXB8mF80WXY+9NodgZd6jkTw2nKjiDM/qArOOVnYoEDYFqworqIHEhX7UAA6BKydlAl33Z9FF6WLx2O6mtXTXxfwF/M3/mDa9bgKfrL6rINXpuDyDw5kzj3owF+epNEQyrNDGF8ait36Re+rN6Wae1qWS8cyWZstYfdkar2dP9m5X/HhA9oprnuz1q69QZQGRpaHvu6P6+5AjsNSFJVC9djfEFSOMrgqkAOwFYCUewyCEuFUsN1fWW0azS6QfFH/TsngwgnLbFLaj+NfzU8n7OT2M6ip8+X/sZwIDAQAB Content-Length: 26762 Server: Jetty(9.4.z-SNAPSHOT)   I don't think this is a bug.     

          the remote server URL that i have in my jenkins configuration gives this o/p

          -bash-3.2$ curl -I -k "https://jenkins_instance.org.com"
          HTTP/1.1 200 OK
          Date: Fri, 28 Sep 2018 06:28:28 GMT
          Content-Type: text/html;charset=utf-8
          Connection: keep-alive
          X-Content-Type-Options: nosniff

           

          but on the configuration page, it throws the error that i have mentioned above.

          Address looks good, but a connection could not be stablished."

           

           

           

          Priyanka Panda added a comment - the remote server URL that i have in my jenkins configuration gives this o/p -bash-3.2$ curl -I -k "https://jenkins_instance.org.com" HTTP/1.1 200 OK Date: Fri, 28 Sep 2018 06:28:28 GMT Content-Type: text/html;charset=utf-8 Connection: keep-alive X-Content-Type-Options: nosniff   but on the configuration page, it throws the error that i have mentioned above. Address looks good, but a connection could not be stablished."      

          I don't think I can reproduce your environmental issues...  even though I really want to help you.

          KaiHsiang Chang added a comment - I don't think I can reproduce your environmental issues...  even though I really want to help you.

          cashlalala

           

          i have the same issue

           

          2019-08-29 13:34:48.988+0000 [id=1459566]       WARNING o.j.p.P.utils.HttpHelper#sendHTTPCall: Server returned HTTP response code: 5
          00 for URL: https://jenkins.c.eu-de-1.cloud/job/MLF-Deployment/job/deploy.from.branch//buildWithParameters?delay=0 -
          [HTTP/1.1 500 Server Error]
          java.io.IOException: Server returned HTTP response code: 500 for URL: https://mjenkins.c.eu-de-1.cloud/job/MLF-Deploym
          ent/job/deploy.from.branch//buildWithParameters?delay=0
                  at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
                  at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
                  at sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(HttpURLConnection.java:3080)
                  at sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderFields(HttpsURLConnectionImpl.java:297)
                  at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.sendHTTPCall(HttpHelper.java:490)
          Caused: java.io.IOException: Server returned HTTP response code: 500 for URL: https://jenkins.c.eu-de-1.cloud/job/MLF-Deployment/job/deploy.from.branch//buildWithParameters?delay=0
                  at sun.reflect.GeneratedConstructorAccessor3544.newInstance(Unknown Source)
                  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
                  at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1950)
                  at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1945)
                  at java.security.AccessController.doPrivileged(Native Method)
                  at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1944)
                  at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1514)
                  at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
                  at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
                  at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.readInputStream(HttpHelper.java:195)
                  at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.sendHTTPCall(HttpHelper.java:507)
                  at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.tryCall(HttpHelper.java:596)
                  at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.tryPost(HttpHelper.java:611)
                  at org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.performTriggerAndGetQueueId(RemoteBuildConfiguration.java:658)
                  at org.jenkinsci.plugins.ParameterizedRemoteTrigger.pipeline.RemoteBuildPipelineStep$Execution.run(RemoteBuildPipelineStep.java:273)
                  at org.jenkinsci.plugins.ParameterizedRemoteTrigger.pipeline.RemoteBuildPipelineStep$Execution.run(RemoteBuildPipelineStep.java:249)
                  at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
                  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                  at java.lang.Thread.run(Thread.java:748) 
          
          

           

                              steps {
                                  script {
          triggerRemoteJob abortTriggeredJob: true, auth: TokenAuth(apiToken: '****', userName: 'admin'), enhancedLogging: true, job: 'https://jenkins.c.eu-de-1.cloud/job/MLF-Deployment/job/deploy.from.branch', maxConn: 1, parameters: '''GIT_REF=${params.stagingGitRef}
          environment=${env.terraformEnvironment}
          deployment=devbdp_deployment
          taintServiceKeys=false
          modelDeployment=false
          runTests=${env.integrationTestsOnCF}
          timeout_integration=${env.integrationTestsTimeout}
          applyTerraform=${env.DeployToCF}''', pollInterval: 60, shouldNotFailBuild: true, useCrumbCache: true, useJobInfoCache: true
                                  }
                              } 

           

          [Pipeline] triggerRemoteJob
          15:44:37  ################################################################################################################
          15:44:37    Parameterized Remote Trigger Configuration:
          15:44:37      - job:                     https://jenkins.c.eu-de-1.cloud/job/MLF-Deployment/job/deploy.from.branch 
          15:44:37      - auth:                    'Token Authentication' as user 'admin'
          15:44:37      - parameters:              [GIT_REF=${params.stagingGitRef}, environment=${env.terraformEnvironment}, deployment=devbdp_deployment, taintServiceKeys=false, modelDeployment=false, runTests=${env.integrationTestsOnCF}, timeout_integration=${env.integrationTestsTimeout}, applyTerraform=${env.DeployToCF}]
          15:44:37      - blockBuildUntilComplete: true
          15:44:37      - connectionRetryLimit:    5
          15:44:37      - trustAllCertificates:    false
          15:44:37  ################################################################################################################
          [Pipeline] sh
          15:44:37  Connection to remote server failed [500], waiting to retry - 60 seconds until next attempt. URL: https://jenkins.c.eu-de-1.cloud/job/MLF-Deployment/job/deploy.from.branch/api/json, parameters: 
          [Pipeline] sh 

           

          i tried nearly everything but nothing worked out for me. I followed the documentation here https://github.com/jenkinsci/parameterized-remote-trigger-plugin/blob/master/README.md

          Tobias Honacker added a comment - cashlalala   i have the same issue   2019-08-29 13:34:48.988+0000 [id=1459566] WARNING o.j.p.P.utils.HttpHelper#sendHTTPCall: Server returned HTTP response code: 5 00 for URL: https: //jenkins.c.eu-de-1.cloud/job/MLF-Deployment/job/deploy.from.branch//buildWithParameters?delay=0 - [HTTP/1.1 500 Server Error] java.io.IOException: Server returned HTTP response code: 500 for URL: https: //mjenkins.c.eu-de-1.cloud/job/MLF-Deploym ent/job/deploy.from.branch //buildWithParameters?delay=0 at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) at sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(HttpURLConnection.java:3080) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderFields(HttpsURLConnectionImpl.java:297) at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.sendHTTPCall(HttpHelper.java:490) Caused: java.io.IOException: Server returned HTTP response code: 500 for URL: https: //jenkins.c.eu-de-1.cloud/job/MLF-Deployment/job/deploy.from.branch//buildWithParameters?delay=0 at sun.reflect.GeneratedConstructorAccessor3544.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1950) at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1945) at java.security.AccessController.doPrivileged(Native Method) at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1944) at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1514) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268) at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.readInputStream(HttpHelper.java:195) at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.sendHTTPCall(HttpHelper.java:507) at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.tryCall(HttpHelper.java:596) at org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.HttpHelper.tryPost(HttpHelper.java:611) at org.jenkinsci.plugins.ParameterizedRemoteTrigger.RemoteBuildConfiguration.performTriggerAndGetQueueId(RemoteBuildConfiguration.java:658) at org.jenkinsci.plugins.ParameterizedRemoteTrigger.pipeline.RemoteBuildPipelineStep$Execution.run(RemoteBuildPipelineStep.java:273) at org.jenkinsci.plugins.ParameterizedRemoteTrigger.pipeline.RemoteBuildPipelineStep$Execution.run(RemoteBuildPipelineStep.java:249) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang. Thread .run( Thread .java:748)   steps { script { triggerRemoteJob abortTriggeredJob: true , auth: TokenAuth(apiToken: '****' , userName: 'admin' ), enhancedLogging: true , job: 'https: //jenkins.c.eu-de-1.cloud/job/MLF-Deployment/job/deploy.from.branch' , maxConn: 1, parameters: '''GIT_REF=${params.stagingGitRef} environment=${env.terraformEnvironment} deployment=devbdp_deployment taintServiceKeys= false modelDeployment= false runTests=${env.integrationTestsOnCF} timeout_integration=${env.integrationTestsTimeout} applyTerraform=${env.DeployToCF}''', pollInterval: 60, shouldNotFailBuild: true , useCrumbCache: true , useJobInfoCache: true } }   [Pipeline] triggerRemoteJob 15:44:37 ################################################################################################################ 15:44:37 Parameterized Remote Trigger Configuration: 15:44:37 - job: https: //jenkins.c.eu-de-1.cloud/job/MLF-Deployment/job/deploy.from.branch 15:44:37 - auth: 'Token Authentication' as user 'admin' 15:44:37 - parameters: [GIT_REF=${params.stagingGitRef}, environment=${env.terraformEnvironment}, deployment=devbdp_deployment, taintServiceKeys= false , modelDeployment= false , runTests=${env.integrationTestsOnCF}, timeout_integration=${env.integrationTestsTimeout}, applyTerraform=${env.DeployToCF}] 15:44:37 - blockBuildUntilComplete: true 15:44:37 - connectionRetryLimit: 5 15:44:37 - trustAllCertificates: false 15:44:37 ################################################################################################################ [Pipeline] sh 15:44:37 Connection to remote server failed [500], waiting to retry - 60 seconds until next attempt. URL: https: //jenkins.c.eu-de-1.cloud/job/MLF-Deployment/job/deploy.from.branch/api/json, parameters: [Pipeline] sh   i tried nearly everything but nothing worked out for me. I followed the documentation here  https://github.com/jenkinsci/parameterized-remote-trigger-plugin/blob/master/README.md

            cashlalala KaiHsiang Chang
            priyankapanda348 Priyanka Panda
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: