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

logs contain ClassCastException at PeriodicFolderTrigger

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • workflow-job-plugin
    • Linux, Jenkins ver. 2.60.3, Folders 6.1.2

      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)

       

          [JENKINS-46286] logs contain ClassCastException at PeriodicFolderTrigger

          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.

          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.

          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.

          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.

          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']]), ... ])

          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'] ]), ... ])

          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).

          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) .

          Jesse Glick added a comment -

          Possibly you were misled by JENKINS-40332.

          Jesse Glick added a comment - Possibly you were misled by  JENKINS-40332 .

          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?

          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?

          Jesse Glick added a comment -

          lukelast 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.

          Jesse Glick added a comment - lukelast 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.

          Luke Last added a comment -

          Ah don't worry about it.

          Luke Last added a comment - Ah don't worry about it.

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

              Created:
              Updated:
              Resolved: