Horizon: [QUESTION] failed jobs handling requirements

Created on 26 Nov 2017  路  1Comment  路  Source: laravel/horizon

I am using Laravel Horizon and when a job has failed i get this error in application log :

[2017-11-26 03:01:37] staging.ERROR: App\Jobs\FooBarJob has failed: App\Jobs\FooBarJob has been attempted too many times or run too long. The job may have previously timed out. [...]

which is expected, but then i get also the following error message :

[2017-11-26 03:01:37] staging.ERROR: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'foobar.failed_jobs' doesn't exist (SQL: insert into `failed_jobs` (`connection`, `queue`, `payload`, `exception`, `failed_at`) values (redis, default, [...]

My question is : do i need to create the table using the php artisan queue:failed-table command or i missed something to configure in Horizon ?

I ask this, because from Horizon dashboard, i am able to successfully retry the failed job. (without the failed_jobs table created).

Most helpful comment

You don't need to, but it is highly recommended. If you where to terminate horizon or restart the server, the failed job would be dropped from memory and you wouldn't be able to access them anymore.

But with the failed_jobs-table to you are (among other things) able to run php artisan queue:retry to retry the failed jobs from the database.

>All comments

You don't need to, but it is highly recommended. If you where to terminate horizon or restart the server, the failed job would be dropped from memory and you wouldn't be able to access them anymore.

But with the failed_jobs-table to you are (among other things) able to run php artisan queue:retry to retry the failed jobs from the database.

Was this page helpful?
0 / 5 - 0 ratings