gpt4 book ai didi

java - Jenkins 运行被匿名 : The user id should be always non-null thanks to DefaultUserCanonicalIdResolver 中止

转载 作者:太空宇宙 更新时间:2023-11-04 11:25:45 25 4
gpt4 key购买 nike

我在不知情的情况下意外修改了安全设置,因此我们不得不删除整个成员访问列表并重新启动。现在有一个匿名用户(这是新的 - 我们曾经有一个“管理员”用户)。 Jenkins 中的匿名用户似乎正在中止作业并显示此错误:

FATAL: The user id should be always non-null thanks to DefaultUserCanonicalIdResolver
java.lang.IllegalStateException: The user id should be always non-null thanks to DefaultUserCanonicalIdResolver
at hudson.model.User.get(User.java:401)
at hudson.model.User.get(User.java:362)
at hudson.model.User.get(User.java:481)
at jenkins.model.CauseOfInterruption$UserInterruption.getUser(CauseOfInterruption.java:86)
at jenkins.model.CauseOfInterruption$UserInterruption.print(CauseOfInterruption.java:95)
at hudson.model.Executor.recordCauseOfInterruption(Executor.java:276)
at hudson.model.Run.execute(Run.java:1755)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
ERROR: Post-build steps failed
java.lang.NullPointerException
at hudson.model.JobProperty.getDescriptor(JobProperty.java:105)
at hudson.model.JobProperty.getDescriptor(JobProperty.java:79)
at hudson.model.Descriptor.toMap(Descriptor.java:973)
at hudson.model.Job.getProperties(Job.java:558)
at hudson.model.Build$BuildExecution.cleanUp(Build.java:196)
at hudson.model.Run.execute(Run.java:1785)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)

最佳答案

您是否使用 Puppet 等配置管理工具来管理 Jenkins 服务器?我们发现我们的 Puppet Jenkins 模块之一喜欢使用 CLI 远程处理和管理员用户来运行 Jenkins 管理命令。当我们的用户列表发生变化并且管理员用户消失时,由于匿名身份验证,这些命令仍然会成功,但是当 Jenkins 被要求使用不存在的用户进行身份验证时,它会 panic 。

为了让事情变得更有趣,Puppet 作为一项服务运行,计划每 30 分钟运行一次,因此我们在日志中一遍又一遍地收到此错误。

这里有几个选项:

  • 如果您必须拥有它,请重新添加“admin”用户。
  • (低租金解决方案)不要将配置管理工具作为 Jenkins 盒子上的一项服务运行,而是使用一次性命令来启动它。这不会消除导致此堆栈跟踪的根本问题(当没有此类用户时尝试以“管理员”身份进行身份验证),但它可能有助于在诊断故障时使日志更安静。
  • 更改您的配置管理脚本,以其他方式配置 Jenkins,从而避免用户身份验证。

关于java - Jenkins 运行被匿名 : The user id should be always non-null thanks to DefaultUserCanonicalIdResolver 中止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44391368/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com