Jenkins Post 测试过程中遇到下面两问题,记录一下解决方案。

1.HTTP Status 403 - Access to the requested resource has been denied.

2.jenkins 出现“Error 403 No valid crumb was included in the request ”

一、HTTP Status 403 - Access to the requested resource has been denied.

这个是权限问题,解决的办法是:

在tomcat-users.xml 文件里加上你用户名,密码:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
   <role rolename="tomcat"/>
   <role rolename="role1"/>
   <role rolename="manager"/>
   <role rolename="admin"/>
   <user username="admin" password="admin" roles="admin,manager"/>

   <user username="tomcat" password="tomcat" roles="tomcat"/>
   <user username="role1" password="tomcat" roles="role1"/>
   <user username="both" password="tomcat" roles="tomcat,role1"/> 
</tomcat-users>

如果加完后还是报错,请查看错误信息是否包含:”Error 403 No valid crumb was included in the request“

二、jenkins-”Error 403 No valid crumb was included in the request“

在jenkins 的Configure Global Security下 , 取消“防止跨站点请求伪造(Prevent Cross Site Request Forgery exploits)”的勾选。(如下图)

本文参考:https://blog.csdn.net/alterxu/article/details/39209029

https://blog.csdn.net/wanglin_lin/article/details/73849146

谢谢分享!

 

 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐