Java 编辑基于矩阵的安全性后无法启动 jenkins
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20214852/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
unable to start jenkins after editing matrix based security
提问by Karthikeyan
I deployed latest jenkins war in tomcatrunning on my W$7 machine.During my first log in i configured something in matrix based security as explained here.After adding a user in the matrix, ia m unable to load the jenkins. The following error stack is shown. For complete stack trace please visit here..
我在 7 美元的机器上在 tomcatrunning 中部署了最新的 jenkins war。在我第一次登录时,我在基于矩阵的安全性中配置了一些内容,如这里所述。在矩阵中添加用户后,我无法加载 jenkins。显示了以下错误堆栈。有关完整的堆栈跟踪,请访问此处。.
Now, When i go to the login page, i could see the login form. Do we have any default login to proceed ?
现在,当我进入登录页面时,我可以看到登录表单。我们是否有任何默认登录名可以继续?
Note: as described in that article i don't see create an account tab in the login page. Hence i am unable to proceed.
注意:如该文章所述,我没有在登录页面中看到创建帐户选项卡。因此我无法继续。
Stack trace :
堆栈跟踪 :
hudson.security.AccessDeniedException2: anonymous is missing the Overall/Read permission
at hudson.security.ACL.checkPermission(ACL.java:54)
at hudson.model.Node.checkPermission(Node.java:418)
at jenkins.model.Jenkins.getTarget(Jenkins.java:3680)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:612)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:799)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:587)
at org.kohsuke.stapler.Stapler.service(Stapler.java:218)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:96)
Edit:
编辑:
I have also, redeployed the war.The issue was still there.
我也重新部署了战争。问题仍然存在。
So then, i have downloaded the fresh war file from the JenKins site and deployed in the tomcat of xampp. When ever, i navigate to the jenkins app , the Java SE crashes.
那么,我已经从 JenKins 站点下载了新的战争文件并部署在 xampp 的 tomcat 中。每当我导航到 jenkins 应用程序时,Java SE 就会崩溃。
采纳答案by Peter Schuetze
It looks like you locked yourself out. Here are the lock picker instructions:
看起来你把自己锁在外面了。以下是开锁器说明:
Securing Jenkins
...
Disabling Security
One may accidentally set up security realm / authorization in such a way that you may no longer able to reconfigure Jenkins.
When this happens, you can fix this by the following steps:
- Stop Jenkins (the easiest way to do this is to stopthe servlet container.)
- Go to
$JENKINS_HOME
in the file system and findconfig.xml
file.- Open this file in the editor.
- Look for the
<useSecurity>true</useSecurity>
element in this file.- Replace
true
withfalse
- Remove the elements
authorizationStrategy
andsecurityRealm
- Start Jenkins
- When Jenkins comes back, it will be in an unsecured mode where everyone gets full access to the system.
If this is still not working, trying renaming or deleting
config.xml
.
保护詹金斯
...
禁用安全
人们可能会意外地以这样一种方式设置安全领域/授权,您可能无法再重新配置 Jenkins。
发生这种情况时,您可以通过以下步骤解决此问题:
- 停止 Jenkins(最简单的方法是停止 servlet 容器。)
- 转到
$JENKINS_HOME
文件系统并找到config.xml
文件。- 在编辑器中打开此文件。
<useSecurity>true</useSecurity>
在此文件中查找元素。- 替换
true
为false
- 删除元素
authorizationStrategy
和securityRealm
- 启动詹金斯
- 当 Jenkins 回来时,它将处于不安全模式,每个人都可以完全访问系统。
如果这仍然不起作用,请尝试重命名或删除
config.xml
.
回答by Vikas Kulshrestha
Fixed by two simple steps:
通过两个简单的步骤修复:
- Go to Jenkin Home
- rename config.xml
- 前往詹金主页
- 重命名config.xml
Try launch the Jenkin
尝试启动 Jenkins
回答by Sunshine
I followed the steps in below source.But still faced the same issue. https://wiki.jenkins-ci.org/display/JENKINS/Disable+security
我按照以下源代码中的步骤操作。但仍然面临同样的问题。 https://wiki.jenkins-ci.org/display/JENKINS/Disable+security
Finally, I tried to unistall and install the jenkins in another directory which help me to start working.
最后,我尝试将 jenkins 卸载并安装在另一个目录中,这有助于我开始工作。
Hope it will help some one.
希望它会帮助某人。
回答by ARUN007
you can do one thing
你可以做一件事
stop the jenkins (using tomcat)
停止詹金斯(使用 tomcat)
go to config.xml present in JENKINS folder.
Look for the <useSecurity>true</useSecurity>
element in this file.
Replace truewith false.
Remove the elements authorizationStrategy and securityRealm
Start Jenkins
When Jenkins comes back, it's in the unsecured mode where everyone gets full access to the system
转到 JENKINS 文件夹中的 config.xml。在此文件中
查找<useSecurity>true</useSecurity>
元素。用false
替换true。
删除元素授权策略和安全领域
启动 Jenkins
当 Jenkins 回来时,它处于不安全模式,每个人都可以完全访问系统
回答by RustyCar
All the above answers are wonderful, but nobody mentions the elephant - which is HOW does one get matrix security to work? I went round and round with this until I happened upon what I think is the answer.
以上所有答案都很棒,但没有人提到大象——这是如何让矩阵安全性工作的?我绕来绕去,直到我发现了我认为的答案。
Here's what I did:
这是我所做的:
- Disable security, as above
- Go in to the 'configure global security' page
- Select matrix security, and immediately enable all for anonymous
- Add your users and set their permissions, making sure there is at least one administrator (I assume with all permissions).
- Save, and make sure you are now logged in as an administrator.
- Go back and turn off all but view permissions on anonymous (or whatever your 'anonymous access rules' are).
- Save.
- 禁用安全,如上
- 进入“配置全局安全性”页面
- 选择矩阵安全,立即启用所有匿名
- 添加您的用户并设置他们的权限,确保至少有一个管理员(我假设拥有所有权限)。
- 保存,并确保您现在以管理员身份登录。
- 返回并关闭除匿名之外的所有查看权限(或任何您的“匿名访问规则”)。
- 节省。
Done.
完毕。
I believe the trick for getting past the 'Anonymous must have ' error is to be sure you are logged in BEFOREturning off anonymous admin privs.
我相信克服“匿名必须有”错误的诀窍是确保您在关闭匿名管理员权限之前登录。