Horizon random jobs failing with no visible errors
So I have an issue with my queue on Laravel Forge using Redis. Random jobs seem to fail for absoutely no reason. There is no error listed in horizon and I am at a total loss as to how to even begin to debug it. No errors in laravel.log either however the job is definitely not being run.
I have a Daemon looking at php artisan horizon in the correct directory.
I terminate horizon on deploy.
I do have a failed jobs table which is not being entered into.
Any help appreciated, happy to give more info as required.
It's because of the try catch that you don't get a job in your dashboard or in the failed_jobs table. You're catching now all exceptions and therefore it never gets in the error handling method of Laravel.
It's better if you only catch specific exception you throw yourself or you know could go wrong. All other exceptions should be handled by Laravel to get it marked as failed!
You can also rethrow the same exception so Laravel will handle it as well and you can perform your own thing for it ;) If you now remove the try catch you can do whatever you do now in the catch in the failed method ;)