jenkinsci / poll-mailbox-trigger-plugin

A Jenkins plugin, to poll an email inbox, and trigger jobs based on new emails.
https://plugins.jenkins.io/poll-mailbox-trigger-plugin/
MIT License
40 stars 32 forks source link

ClassCastException while triggering a build #29

Closed patric42 closed 6 years ago

patric42 commented 7 years ago

Instead of triggering the build, the following exception occurs in the jenkins.log:

WARNUNG: org.jenkinsci.plugins.pollmailboxtrigger.PollMailboxTrigger.run() failed for org.jenkinsci.plugins.workflow.job.WorkflowJob@3898e0ce[MyTISM-Core] java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to hudson.model.AbstractProject at org.jenkinsci.lib.xtrigger.AbstractTrigger.run(AbstractTrigger.java:124) at hudson.triggers.Trigger.checkTriggers(Trigger.java:278) at hudson.triggers.Trigger$Cron.doRun(Trigger.java:226) at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50) 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:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748)

Steps to reproduce

How can we reproduce the issue

  1. Create a pipeline
  2. configure build trigger with poll-mailbox-trigger plugin
  3. wait until the trigger occurs

Expected behaviour

Build should have been triggered

Actual behaviour

Above mentioned CCE is thrown and logged in jenkins.log

Server configuration

Operating system: Ubuntu 16.04.2

Jenkins Version: 2.60.1

Plugin Version: 1.025

Mail Server: gmail

Additional Steps/Questions

drehelis commented 7 years ago

Pipeline/workflow job is unsupported. Try Freestyle job which works.

Is it possible to add Pipeline support?

sumitg1 commented 7 years ago

Can we have this feature for the pipeline/workflow.

nickgrealy commented 6 years ago

I've created the following issue, to track adding Jenkins Pipeline support.

If anyone (@autogun / @sumitg1) has any experience of adding pipeline support, please feel free to submit a PR (thanks).