解决访问本地jenkins报错:No valid crumb was included in request for /jenkins/createItem by admin. Returning 4

Posted xiamaojjie

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决访问本地jenkins报错:No valid crumb was included in request for /jenkins/createItem by admin. Returning 4相关的知识,希望对你有一定的参考价值。

今天在通过Jenkins接口创建项目的时候,返回报错HTTP403,刚开始还以为自己参数传输错误,检查了好几遍也没找出啥问题。后面一看控制台才发现这个错误,No valid crumb was included in request for /jenkins/createItem by admin. Returning 403。

 

技术图片

错误原因:jenkins在http请求头部中放置了一个名为.crumb的token。在使用了反向代理,并且在jenkins设置中勾选了“防止跨站点请求伪造(Prevent Cross Site Request Forgery exploits)”之后此token会被转发服务器apache/nginx认为是不合法头部而去掉。导致跳转失败。

解决办法:在Jenkins设置===》配置全局安全性里面,取消勾选防止跨站点请求伪造。就可以正常提交了。

如图:

技术图片

以上是关于解决访问本地jenkins报错:No valid crumb was included in request for /jenkins/createItem by admin. Returning 4的主要内容,如果未能解决你的问题,请参考以下文章

validators配置要点及No result defined for action报错解决方案

Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle(

Jenkins出现No valid crumb was included in the reques

Jenkins打包报错:(No such file or directory) and 'parent.relativePath' points at no local POM

tomcat启动报错,using password :NO

git推送报错: No path specified. See 'man git-pull' for valid url syntax或does not appear to be a