jenkins新版本+gitlab配置自动化部署报错Hook executed successfully but returned HTTP 403,没有CSRF选项
jenkins新版本没有配置CSRF禁用的选项。
·
问题:
配置jenkins+gitlab自动化部署报错:
错误内容:
Hook executed successfully but returned HTTP 403 <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/> <title>Error 403 No valid crumb was included in the request</title> </head> <body><h2>HTTP ERROR 403 No valid crumb was included in the request</h2> <table> <tr><th>URI:</th><td>/job/demo-jenkins/build</td></tr> <tr><th>STATUS:</th><td>403</td></tr> <tr><th>MESSAGE:</th><td>No valid crumb was included in the request</td></tr> <tr><th>SERVLET:</th><td>Stapler</td></tr> </table> <hr/><a href="https://eclipse.org/jetty">Powered by Jetty:// 10.0.12</a><hr/> </body> </html>
解决方案
jenkins新版本没有配置CSRF禁用的选项。可以在jenkins命令行接口执行下面大代码:
hudson.security.csrf.GlobalCrumbIssuerConfiguration.DISABLE_CSRF_PROTECTION=true
运行结果
最终效果
更多推荐
已为社区贡献1条内容
所有评论(0)