Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46286

logs contain ClassCastException at PeriodicFolderTrigger

    Details

    • Similar Issues:

      Description

      I get a constant stream of these errors in my Jenkins Log. It's strange because looking at the code it shouldn't be trying to cast to ComputedFolder.

       

       

       

      Aug 18, 2017 12:19:00 AM WARNING hudson.triggers.Trigger checkTriggers
      com.cloudbees.hudson.plugins.folder.computed.PeriodicFolderTrigger.run() failed for org.jenkinsci.plugins.workflow.job.WorkflowJob@4c24ef47[xxxx/xxxx/xxxx]
      java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to com.cloudbees.hudson.plugins.folder.computed.ComputedFolder
      	at com.cloudbees.hudson.plugins.folder.computed.PeriodicFolderTrigger.run(PeriodicFolderTrigger.java:189)
      	at hudson.triggers.Trigger.checkTriggers(Trigger.java:278)
      	at hudson.triggers.Trigger$Cron.doRun(Trigger.java:226)
      	at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51)
      	at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
      	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)

       

        Attachments

          Issue Links

            Activity

            lukelast Luke Last created issue -
            Hide
            jglick Jesse Glick added a comment -

            Somehow you associated a PeriodicFolderTrigger with a WorkflowJob, a type to which it is inapplicable. A user error though it ought to have been caught earlier. Unclear how to reproduce from scratch and thus fix.

            Show
            jglick Jesse Glick added a comment - Somehow you associated a PeriodicFolderTrigger with a WorkflowJob , a type to which it is inapplicable. A user error though it ought to have been caught earlier. Unclear how to reproduce from scratch and thus fix.
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Component/s workflow-job-plugin [ 21716 ]
            Hide
            lukelast Luke Last added a comment -

            Could it be the [Ownership Plugin|https://wiki.jenkins.io/display/JENKINS/Ownership+Plugin]? If not how can I find out what is causing it? I tried disabling the Gitlab Hook Plugin but that didn't help.

            Show
            lukelast Luke Last added a comment - Could it be the [Ownership Plugin| https://wiki.jenkins.io/display/JENKINS/Ownership+Plugin ]? If not how can I find out what is causing it? I tried disabling the Gitlab Hook Plugin but that didn't help.
            Hide
            lukelast Luke Last added a comment -

            I might have figured it out. I think it's the following pipeline property causing warnings for multibranch projects. Still testing though.

            properties([..., pipelineTriggers([[$class: 'PeriodicFolderTrigger', interval: '30m']]), ... ])

            Show
            lukelast Luke Last added a comment - I might have figured it out. I think it's the following pipeline property causing warnings for multibranch projects. Still testing though. properties([..., pipelineTriggers([ [$class: 'PeriodicFolderTrigger', interval: '30m'] ]), ... ])
            Hide
            jglick Jesse Glick added a comment -

            Definitely a user error (this trigger is inapplicable to jobs—it is for computed folders!), though to prevent you from making such a mistake PipelineTriggersJobProperty ought to at some point verify isApplicable(owner).

            Show
            jglick Jesse Glick added a comment - Definitely a user error (this trigger is inapplicable to jobs—it is for computed folders!), though to prevent you from making such a mistake PipelineTriggersJobProperty ought to at some point verify  isApplicable(owner) .
            jglick Jesse Glick made changes -
            Component/s cloudbees-folder-plugin [ 18137 ]
            Labels robustness
            Hide
            jglick Jesse Glick added a comment -

            Possibly you were misled by JENKINS-40332.

            Show
            jglick Jesse Glick added a comment - Possibly you were misled by  JENKINS-40332 .
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-40332 [ JENKINS-40332 ]
            Hide
            lukelast Luke Last added a comment - - edited

            Yes that's true. And I confirmed that removing the pipelineTriggers() did fix the log warnings.

            What about the people that would like to share properties() between multibranch and singlebranch jobs? Can Jenkins just ignore the pipelineTriggers() config instead if erroring?

            Show
            lukelast Luke Last added a comment - - edited Yes that's true. And I confirmed that removing the pipelineTriggers() did fix the log warnings. What about the people that would like to share properties() between multibranch and singlebranch jobs? Can Jenkins just ignore the pipelineTriggers() config instead if erroring?
            Hide
            jglick Jesse Glick added a comment -

            Luke Last no, I think you are still confused. PeriodicFolderTrigger is for the branch folder, not the branch job. Thus it should never appear in any job properties.

            Show
            jglick Jesse Glick added a comment - Luke Last no, I think you are still confused. PeriodicFolderTrigger is for the branch folder , not the branch job . Thus it should never appear in any job properties.
            Hide
            lukelast Luke Last added a comment -

            Ah don't worry about it.

            Show
            lukelast Luke Last added a comment - Ah don't worry about it.
            lukelast Luke Last made changes -
            Status Open [ 1 ] Closed [ 6 ]
            Resolution Won't Do [ 10001 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                lukelast Luke Last
              • Votes:
                2 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: