DevOps | GitLab Webhook插件测试触发Jenkins自动构建报错 Hook executed successfully but returned HTTP 403

                      --昨夜西风凋碧树,独上高楼,望尽天涯路

问题:

当配置好Webhook url时候执行push test的时候报错:

Hook executed successfully but returned HTTP 403 Error 403 No valid crumb was included in the request

HTTP ERROR 403

Problem accessing /job/eureka-service/build. Reason:

 No valid crumb was included in the request


Powered by Jetty:// 9.4.z-SNAPSHOT

DevOps | GitLab Webhook插件测试触发Jenkins自动构建报错 Hook executed successfully but returned HTTP 403_第1张图片

原因:

由于Jenkins的安全策略配置了CSRF跨站点保护。

解决方案:

进入Jenkins,系统管理-->全局安全配置,勾选匿名用户具有可读权限和去掉CSRF防止跨站点请求伪造:

DevOps | GitLab Webhook插件测试触发Jenkins自动构建报错 Hook executed successfully but returned HTTP 403_第2张图片

再次测试,成功触发:

DevOps | GitLab Webhook插件测试触发Jenkins自动构建报错 Hook executed successfully but returned HTTP 403_第3张图片

 

你可能感兴趣的:(Jenkins,自动化,CICD,Git,GitLab,运维,云技术,CI/CD,持续集成/持续交付)