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

logs contain ClassCastException at PeriodicFolderTrigger

    XMLWordPrintable

Details

    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 added a comment -

            Ah don't worry about it.

            lukelast Luke Last added a comment - Ah don't worry about it.
            jglick 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.

            jglick 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.
            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?

            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?
            jglick Jesse Glick added a comment -

            Possibly you were misled by JENKINS-40332.

            jglick Jesse Glick added a comment - Possibly you were misled by  JENKINS-40332 .
            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 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) .
            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']]), ... ])

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

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

            People

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

              Dates

                Created:
                Updated:
                Resolved: