Reputation: 1195
I am using Jenkins along with Parameterized Trigger Plugin for triggering a job remotely. The build trigger is failed with console output as below
Server returned HTTP response code: 403 for URL: http://x.x.x.x:8080/job/jobname/buildWithParameters?token=buildcommand&build&delay=0
Connection to remote server failed, waiting for to retry - 10 seconds until next attempt.
Retry attempt #1 out of 5
Server returned HTTP response code: 403 for URL: http://x.x.x.x:8080/job/jobname/buildWithParameters?token=buildcommand&build&delay=0
Connection to remote server failed, waiting for to retry - 10 seconds until next attempt.
ERROR: Remote build failed for the following reason:
The build with URL 'http://x.x.x.x:8080/job/jobname/build?token=buildcommand&build&delay=0
' from a browser is able to trigger the build remotely.
I only see the difference between two URL is one uses 'build' and other has 'buildWithParameters'.
Could you please help me to resolve the same.
Upvotes: 4
Views: 7727
Reputation: 35893
Had the same issue where my remote jenkins was using credentials that were passed in by the master build. To fix it I had to disable CSRF protection on the target Jenkins:
No need to restart Jenkins, just try the master job again.
Caveat: Obviously your Jenkins server is without CSRF protection... but it's probably safely behind a corporate firewall anyway, right?
Upvotes: 5