Recently after moving our queue driver to ‘redis’ we are facing more issue with some jobs/event listeners in the ‘default’ queue getting failed. At this time of failing, its also not getting inserted into the failed_jobs table. We are using a MariaDB database.
The reason for failure of these jobs are
IlluminateDatabaseEloquentModelNotFoundException
No query results for model [AppModel].
Strange thing is that, its happening randomly and when it starts to happen many jobs in the same queue worker ( default ) are also failing. I can also see that during the course of failure of jobs, there are also some jobs which are success in the same queue.
We can rule out the possibility of non existence of the model in the DB. I am sure that model exists in the database when the event happens.
After logging in Bugsnag we could see that issue happens when the payload is being unserialized and tries to resolve the model. At that time some how model is not getting back, which ends in throwing the exception.
Any help on this topic would be very much appreciated.