Incorrectly serialized queue items - Call to a member function run() on bool in CRM_Queue_Runner->runNext()
When running the CiviCRM Scheduled Jobs, we would sometimes see this error:
Error: Call to a member function run() on bool in CRM_Queue_Runner->runNext() (line 202 of civicrm-core/CRM/Queue/Runner.php).
This seems to happen because the Queue Runner cannot unserialize the queue item. I tried debugging the item and see the error, but couldn't find something obvious. I read in various sources that if we serialize an object, we should base64 encode it. However, it would be to the Queue Runner to do that (not civirules), or civirules should avoid adding objects to the queue.
Sorry I have not been able to debug this into something more easy to reproduce. So far I added more debug statements and will see if we can find a more clear pattern. Right not it was rather randomly hanging out mailings because scheduled jobs couldn't run.