Horizon: Unable to requeue failed Redis job

Created on 8 May 2019  路  5Comments  路  Source: laravel/horizon

  • Horizon Version: 3.1.2
  • Laravel Version: 5.8.16
  • PHP Version: 7.2.18
  • Redis Driver & Version: predis/phpredis 1.1.1
  • Database Driver & Version: redis 5.0.4

Description:

I have about 3,000 failed jobs on a queue (timed out). Trying to retry one or all with the artisan queue commands produces an error about an unspecified class.

And of course same error in the log (leading to an internal server error and failed XHR in the browser) when using Retry button in the UI.

(Note I _was_ able to retry them by uninstalling Horizon.)

Steps To Reproduce:

$ php artisan queue:retry all

   ReflectionException  : Class  does not exist

  at /Users/wt/Sites/adthing/vendor/laravel/horizon/src/Tags.php:107
    103|     {
    104|         $models = [];
    105| 
    106|         foreach ($targets as $target) {
  > 107|             $models[] = collect((new ReflectionClass($target))->getProperties())->map(function ($property) use ($target) {
    108|                 $property->setAccessible(true);
    109| 
    110|                 $value = $property->getValue($target);
    111| 

  Exception trace:

  1   ReflectionClass::__construct("")
      /Users/wt/Sites/adthing/vendor/laravel/horizon/src/Tags.php:107

  2   Laravel\Horizon\Tags::modelsFor()
      /Users/wt/Sites/adthing/vendor/laravel/horizon/src/Tags.php:28

Adding debug statements, I've traced this all the way back to RedisQueue.php, specifically the statement in PushRaw() (line 59)

$payload = (new JobPayload($payload))->prepare($this->lastPushed)->value;

Here's the payload of a job:

string(529) "{"timeout":null,"id":"30Yy3tru7Qf2mseYwY7ZE0jmgz2y26Qt","data":{"command":"O:33:\"App\\Jobs\\FacebookDeliveryEstimate\":8:{s:12:\"\u0000*\u0000target_id\";i:21;s:6:\"\u0000*\u0000job\";N;s:10:\"connection\";N;s:5:\"queue\";N;s:15:\"chainConnection\";N;s:10:\"chainQueue\";N;s:5:\"delay\";N;s:7:\"chained\";a:0:{}}","commandName":"App\\Jobs\\FacebookDeliveryEstimate"},"displayName":"App\\Jobs\\FacebookDeliveryEstimate","timeoutAt":null,"job":"Illuminate\\Queue\\CallQueuedHandler@call","maxTries":null,"delay":null,"attempts":0}"

$this->lastPushed is NULL at this point.

Any suggestions?

Most helpful comment

Exact Similar issue on Laravel 7.15 and php7.4, horizon 4.3 & couldn't find solution on any support channels. !

All 5 comments

Hi there,

Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

Thanks!

I have the exact same problem, so this is definitely not "a question which can be asked on a support channel", rather a bug.

@ahtinurme can you first try a support channel from above? If you can actually identify this as a bug we'll take a look.

Exact Similar issue on Laravel 7.15 and php7.4, horizon 4.3 & couldn't find solution on any support channels. !

Same issue. Cannot reproduce locally - it happens only in production server. If I rollback to queue:worker, there is no problems. Only happens when Horizon handles jobs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marianvlad picture marianvlad  路  5Comments

crash13override picture crash13override  路  5Comments

okaufmann picture okaufmann  路  3Comments

meathanjay picture meathanjay  路  3Comments

mahdiahmadi73 picture mahdiahmadi73  路  3Comments