Jenkins -问题:队列$MaintainTask失败

soat7uwm  于 2022-11-21  发布在  Jenkins
关注(0)|答案(2)|浏览(257)

我有一个问题:(挂起-等待下一个可用的执行者)
控制台日志:

Timer task hudson.model.Queue$MaintainTask@fb3e676 failed
java.lang.ClassCastException: class java.lang.Integer cannot be cast to class hudson.slaves.NodeProperty (java.lang.Integer is in module java.base of loader 'bootstrap'; hudson.slaves.NodeProperty is in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @7364985f)
at hudson.model.Node.canTake(Node.java:409)
at hudson.model.Queue$JobOffer.getCauseOfBlockage(Queue.java:276)
at hudson.model.Queue.maintain(Queue.java:1633)
at hudson.model.Queue$MaintainTask.doRun(Queue.java:2904)
at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:91)
at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
zbwhf8kr

zbwhf8kr1#

这看起来与Jenkins错误有关:FATAL: java.lang.Integer cannot be cast to hudson.slaves.NodeProperty .您最近是否升级了Jenkins?

  • 转到Jenkins安装的根文件夹。
  • config.xml中查找<globalNodeProperties>
  • 如果它看起来像这样,它可能没有正确升级:
<globalNodeProperties>
  <hudson.slaves.EnvironmentVariablesNodeProperty/>
  <int>2</int>
  <string></string>
  <string></string>
  ...
</globalNodeProperties>
  • XML格式已更改,它应该如下所示(请注意,int不再是globalNodeProperty,也就是您得到的异常:
<globalNodeProperties>
    <hudson.slaves.EnvironmentVariablesNodeProperty>
      <envVars serialization="custom">
        <unserializable-parents/>
        <tree-map>
          <default>
            <comparator class="hudson.util.CaseInsensitiveComparator" reference="../../../../../../views/listView/jobNames/comparator"/>
          </default>
          <int>2</int>
          <string></string>
          <string></string>
          ...
        </tree-map>
      </envVars>
    </hudson.slaves.EnvironmentVariablesNodeProperty>
  </globalNodeProperties>
eh57zj3b

eh57zj3b2#

我最后通过删除ruby-runtime插件解决了这个问题。
进入JENKINS_HOME/插件和sudo rm -rf ruby-runtime*

相关问题