admin管理员组

文章数量:1552442

问题描述:

        Jenkins重启后无法启动提示:Please wait while Jenkins is getting ready to work。。。(Jenkins正在准备工作,请稍后。。。)

问题分析:

        查看日志:

               # docker-compose logs -f --tail=100

jenkins_1  | java.lang.NoSuchMethodError: 'java.lang.String com.thoughtworks.xstream.io.HierarchicalStreamReader.peekNextChild()'
jenkins_1  |    at com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy$ConverterImpl.unmarshal(RoleBasedAuthorizationStrategy.java:579)
jenkins_1  |    at hudson.util.XStream2$AssociatedConverterImpl.unmarshal(XStream2.java:465)
jenkins_1  |    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
jenkins_1  |    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
jenkins_1  |    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
jenkins_1  |    at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:442)
jenkins_1  |    at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:344)
jenkins_1  |    at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:283)
jenkins_1  |    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
jenkins_1  |    at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
jenkins_1  |    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
jenkins_1  |    at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
jenkins_1  |    at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
jenkins_1  |    at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)

        日志分析:        

        该日志中存在多个信息和警告,但其中一个错误是:

jenkins_1  | java.lang.NoSuchMethodError: 'java.lang.String com.thoughtworks.xstream.io.HierarchicalStreamReader.peekNextChild()'
jenkins_1  |    at com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy$ConverterImpl.unmarshal(RoleBasedAuthorizationStrategy.java:579)
jenkins_1  |    at hudson.util.XStream2$AssociatedConverterImpl.unmarshal(XStream2.java:465)
jenkins_1  |    at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)

        该错误可能是由于插件依赖项问题而导致的全局配置加载失败。具体来说,这个错误可能与角色策略授权插件有关。

解决方法:

        要解决这个问题,可以尝试以下步骤:

  1. 检查是否有任何插件依赖项错误。查看Jenkins控制台输出中是否有任何其他错误或警告。

  2. 禁用Jenkins角色策略授权插件role-strategy.jpi。
    2.1 打开Jenkins服务器上的Jenkins Home目录。
    2.2 在Jenkins Home目录中找到plugins目录。
    2.3 在plugins目录中找到role-strategy.jpi文件,并将其重命名为role-strategy.jpi.disabled。

  3. 删除Jenkins配置config.xml内,角色策略授权插件的相关配置。
    3.1 打开 Jenkins 的配置文件 `config.xml`,该文件通常位于 Jenkins 的主目录下。
    3.2 使用文本编辑器搜索 `role-strategy` 或 `com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy`。
    3.3 删除<authorizationStrategy></authorizationStrategy> 内全部内容,以及其他引用 `role-strategy` 的行,保存文件并关闭编辑器。

  4. 重新启动 Jenkins。

        这样做将禁用角色策略授权插件,并允许Jenkins服务器启动。请注意,禁用插件可能会影响Jenkins服务器的某些功能。如果您需要重新启用该插件,请将role-strategy.jpi.disabled文件重命名为role-strategy.jpi,并重新启动Jenkins服务器。

本文标签: 无法启动ciomichelinJenkinsrolestrategy