Hook executed successfully but returned HTTP 403<html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Error 403 No valid crumb was included in the request</title> </head> <body><h2>HTTP ERROR 403</h2> <p>Problem accessing /job/eureka-service/build. Reason: <pre> No valid crumb was included in the request</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/> </body> </html
原因:由于Jenkins的安全策略配置了CSRF跨站点保护。
进入Jenkins,系统管理-->全局安全配置,勾选匿名用户具有可读权限和去掉CSRF防止跨站点请求伪造:
授权策略->任何用户可以做任何事(没有任何限制)
还需修改:
系统管理->系统设置->Gitlab
Enable authentication for '/project' end-point
GitLab connections 去掉勾选