java.lang.ClassCastException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • We noticed problems with using label expression as "Node". In our case we used value "build&&machine (group of machine_1,...)". Once the build started, Jenkins started to loose the slave executors. They failed with: {code} SEVERE: Timer task hudson.model.Queue$MaintainTask@15db104e failed java.lang.ClassCastException: hudson.model.labels.LabelExpression$And cannot be cast to hudson.model.labels.LabelAtom at jenkins.model.Jenkins.getLabelAtom(Jenkins.java:1571) at hudson.model.labels.LabelAtom.get(LabelAtom.java:224) at hudson.model.labels.LabelExpressionParser.term6(LabelExpressionParser.java:208) at hudson.model.labels.LabelExpressionParser.term5(LabelExpressionParser.java:164) at hudson.model.labels.LabelExpressionParser.term4(LabelExpressionParser.java:136) at hudson.model.labels.LabelExpressionParser.term3(LabelExpressionParser.java:113) at hudson.model.labels.LabelExpressionParser.term2(LabelExpressionParser.java:83) at hudson.model.labels.LabelExpressionParser.term1(LabelExpressionParser.java:60) at hudson.model.labels.LabelExpressionParser.expr(LabelExpressionParser.java:50) at hudson.model.Label.parseExpression(Label.java:509) at jenkins.model.Jenkins.getLabel(Jenkins.java:1553) at hudson.model.AbstractProject.getAssignedLabel(AbstractProject.java:356) at hudson.model.queue.MappingWorksheet$WorkChunk.getAssignedLabel(MappingWorksheet.java:202) at hudson.model.queue.MappingWorksheet$WorkChunk.<init>(MappingWorksheet.java:185) at hudson.model.queue.MappingWorksheet$WorkChunk.<init>(MappingWorksheet.java:157) at hudson.model.queue.MappingWorksheet.<init>(MappingWorksheet.java:375) at hudson.model.queue.MappingWorksheet.<init>(MappingWorksheet.java:303) at hudson.model.Queue.maintain(Queue.java:1033) at hudson.model.Queue$MaintainTask.doRun(Queue.java:1759) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) Mar 26, 2013 1:12:52 PM hudson.triggers.SafeTimerTask run {code} I checked that running the following groovy script from console fails to our matrix project with the "matrix tie parent" plugin config above: {code} import jenkins.model.*; for(item in Jenkins.instance.items) { println("JOB: '" + item.name + "'"); if (item.getAssignedLabel() != null) { println("LABEL: '" + item.getAssignedLabel() + "'"); } } {code} The outcome is that all executors die (https://wiki.jenkins-ci.org/display/JENKINS/Dead+Executor) and we cannot restart those threads through the UI. Only after I changed the "Node" to "master" I was able to restart the executors. So this really kills the whole Jenkins instance.
    via by Mikko Tapaninen,
  • We noticed problems with using label expression as "Node". In our case we used value "build&&machine (group of machine_1,...)". Once the build started, Jenkins started to loose the slave executors. They failed with: {code} SEVERE: Timer task hudson.model.Queue$MaintainTask@15db104e failed java.lang.ClassCastException: hudson.model.labels.LabelExpression$And cannot be cast to hudson.model.labels.LabelAtom at jenkins.model.Jenkins.getLabelAtom(Jenkins.java:1571) at hudson.model.labels.LabelAtom.get(LabelAtom.java:224) at hudson.model.labels.LabelExpressionParser.term6(LabelExpressionParser.java:208) at hudson.model.labels.LabelExpressionParser.term5(LabelExpressionParser.java:164) at hudson.model.labels.LabelExpressionParser.term4(LabelExpressionParser.java:136) at hudson.model.labels.LabelExpressionParser.term3(LabelExpressionParser.java:113) at hudson.model.labels.LabelExpressionParser.term2(LabelExpressionParser.java:83) at hudson.model.labels.LabelExpressionParser.term1(LabelExpressionParser.java:60) at hudson.model.labels.LabelExpressionParser.expr(LabelExpressionParser.java:50) at hudson.model.Label.parseExpression(Label.java:509) at jenkins.model.Jenkins.getLabel(Jenkins.java:1553) at hudson.model.AbstractProject.getAssignedLabel(AbstractProject.java:356) at hudson.model.queue.MappingWorksheet$WorkChunk.getAssignedLabel(MappingWorksheet.java:202) at hudson.model.queue.MappingWorksheet$WorkChunk.<init>(MappingWorksheet.java:185) at hudson.model.queue.MappingWorksheet$WorkChunk.<init>(MappingWorksheet.java:157) at hudson.model.queue.MappingWorksheet.<init>(MappingWorksheet.java:375) at hudson.model.queue.MappingWorksheet.<init>(MappingWorksheet.java:303) at hudson.model.Queue.maintain(Queue.java:1033) at hudson.model.Queue$MaintainTask.doRun(Queue.java:1759) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) Mar 26, 2013 1:12:52 PM hudson.triggers.SafeTimerTask run {code} I checked that running the following groovy script from console fails to our matrix project with the "matrix tie parent" plugin config above: {code} import jenkins.model.*; for(item in Jenkins.instance.items) { println("JOB: '" + item.name + "'"); if (item.getAssignedLabel() != null) { println("LABEL: '" + item.getAssignedLabel() + "'"); } } {code} The outcome is that all executors die (https://wiki.jenkins-ci.org/display/JENKINS/Dead+Executor) and we cannot restart those threads through the UI. Only after I changed the "Node" to "master" I was able to restart the executors. So this really kills the whole Jenkins instance.
    via by Mikko Tapaninen,
    • java.lang.ClassCastException: hudson.model.labels.LabelExpression$And cannot be cast to hudson.model.labels.LabelAtom at jenkins.model.Jenkins.getLabelAtom(Jenkins.java:1571) at hudson.model.labels.LabelAtom.get(LabelAtom.java:224) at hudson.model.labels.LabelExpressionParser.term6(LabelExpressionParser.java:208) at hudson.model.labels.LabelExpressionParser.term5(LabelExpressionParser.java:164) at hudson.model.labels.LabelExpressionParser.term4(LabelExpressionParser.java:136) at hudson.model.labels.LabelExpressionParser.term3(LabelExpressionParser.java:113) at hudson.model.labels.LabelExpressionParser.term2(LabelExpressionParser.java:83) at hudson.model.labels.LabelExpressionParser.term1(LabelExpressionParser.java:60) at hudson.model.labels.LabelExpressionParser.expr(LabelExpressionParser.java:50) at hudson.model.Label.parseExpression(Label.java:509) at jenkins.model.Jenkins.getLabel(Jenkins.java:1553) at hudson.model.AbstractProject.getAssignedLabel(AbstractProject.java:356) at hudson.model.queue.MappingWorksheet$WorkChunk.getAssignedLabel(MappingWorksheet.java:202) at hudson.model.queue.MappingWorksheet$WorkChunk.<init>(MappingWorksheet.java:185) at hudson.model.queue.MappingWorksheet$WorkChunk.<init>(MappingWorksheet.java:157) at hudson.model.queue.MappingWorksheet.<init>(MappingWorksheet.java:375) at hudson.model.queue.MappingWorksheet.<init>(MappingWorksheet.java:303) at hudson.model.Queue.maintain(Queue.java:1033) at hudson.model.Queue$MaintainTask.doRun(Queue.java:1759) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:54) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462)
    No Bugmate found.