我正在使用Jenkins和参数化触发插件来远程触发作业。控制台输出的构建触发器失败,如下所示
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:
来自浏览器的网址“http://x.x.x.x:8080/job/jobname/build?token=buildcommand&build&delay=0
”的构建能够远程触发构建。
我只看到两个URL之间的区别是一个使用'build'而另一个有'buildWithParameters'。
请你帮我解决一下。
答案 0 :(得分:3)
我的远程jenkins使用由主构建传递的凭据时遇到了同样的问题。 要修复它,我必须在目标 Jenkins上禁用CSRF保护:
无需重启Jenkins,只需再次尝试主作业。
警告:显然你的Jenkins服务器没有CSRF保护......但无论如何它可能安全地落后于公司防火墙,对吗?