Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedisQueue $lastPushed is not set #452

Closed
ruolis opened this issue Dec 13, 2018 · 12 comments
Closed

RedisQueue $lastPushed is not set #452

ruolis opened this issue Dec 13, 2018 · 12 comments

Comments

@ruolis
Copy link

ruolis commented Dec 13, 2018

When I clicked the retry button for the failed task, I found that $lastPushed for $queue was not set in RetryFailedJob@handle

@driesvints
Copy link
Member

I'll need more info and/or code to debug this further. Please post relevant code like models, jobs, commands, notifications, events, listeners, controller methods, routes, etc. You may use https://paste.laravel.io to post larger snippets or just reply with shorter code snippets. Thanks!

@ruolis
Copy link
Author

ruolis commented Dec 14, 2018

i use default config
laravel version : 5.5.44
horizon version : dev-master

image
image

@driesvints
Copy link
Member

Heya, unfortunately we don't support this version anymore. Can you please try to upgrade to the latest version and see if your problem persists? If so feel free to reply and we'll try to have a look.

@MaartenStaa
Copy link

MaartenStaa commented Jan 23, 2019

@driesvints I have the same issue. I use php artisan queue:retry <id> to push back a failed job to the queue. RetryCommand calls RedisQueue::pushRaw, which passes $this->lastPushed to JobPayload::prepare, but lastPushed is never initialised.

Stack trace:

ReflectionException: Class  does not exist
#21 vendor/laravel/horizon/src/Tags.php(107): __construct
#20 vendor/laravel/horizon/src/Tags.php(107): modelsFor
#19 vendor/laravel/horizon/src/Tags.php(28): for
#18 vendor/laravel/horizon/src/JobPayload.php(132): determineTags
#17 vendor/laravel/horizon/src/JobPayload.php(91): prepare
*#16 vendor/laravel/horizon/src/RedisQueue.php(59): pushRaw* _This is where the bug is I think_
#15 vendor/laravel/framework/src/Illuminate/Queue/Console/RetryCommand.php(71): retryJob
#14 vendor/laravel/framework/src/Illuminate/Queue/Console/RetryCommand.php(37): handle
#13 vendor/laravel/framework/src/Illuminate/Queue/Console/RetryCommand.php(0): call_user_func_array
#12 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(29): Illuminate\Container\{closure}
#11 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): callBoundMethod
#10 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): call
#9 vendor/laravel/framework/src/Illuminate/Container/Container.php(572): call
#8 vendor/laravel/framework/src/Illuminate/Console/Command.php(183): execute
#7 vendor/symfony/console/Command/Command.php(255): run
#6 vendor/laravel/framework/src/Illuminate/Console/Command.php(170): run
#5 vendor/symfony/console/Application.php(901): doRunCommand
#4 vendor/symfony/console/Application.php(262): doRun
#3 vendor/symfony/console/Application.php(145): run
#2 vendor/laravel/framework/src/Illuminate/Console/Application.php(89): run
#1 vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): handle
#0 artisan(38): null

Versions as per composer.lock:

  • laravel/framework: 5.7.22
  • laravel/horizon: 2.0.2

@driesvints
Copy link
Member

Okay, I'll try to look at this soon. Appreciating any help with this in the meantime.

@driesvints driesvints reopened this Jan 23, 2019
@driesvints
Copy link
Member

I can't reproduce this. Can you setup a test app or post the minimum amount of code which reproduces this?

@driesvints
Copy link
Member

Closing this issue because it's inactive, already solved, old or not relevant anymore. Feel free to reply if you're still experiencing this issue.

@vaniyokk
Copy link

vaniyokk commented Feb 11, 2019

I have a same problem.

I already have failed jobs in my failed_jobs table, and after installing of horizon I can't retry that jobs.

$ sudo -u apache php artisan queue:retry all -vv 
In Tags.php line 107:

[ReflectionException (-1)] 
Class does not exist 


Exception trace:
() at /var/www/vendor/laravel/horizon/src/Tags.php:107
ReflectionClass->__construct() at /var/www/vendor/laravel/horizon/src/Tags.php:107
Laravel\Horizon\Tags::modelsFor() at /var/www/vendor/laravel/horizon/src/Tags.php:28
Laravel\Horizon\Tags::for() at /var/www/vendor/laravel/horizon/src/JobPayload.php:132
Laravel\Horizon\JobPayload->determineTags() at /var/www/vendor/laravel/horizon/src/JobPayload.php:91
Laravel\Horizon\JobPayload->prepare() at /var/www/vendor/laravel/horizon/src/RedisQueue.php:59
Laravel\Horizon\RedisQueue->pushRaw() at /var/www/vendor/laravel/framework/src/Illuminate/Queue/Console/RetryCommand.php:71
Illuminate\Queue\Console\RetryCommand->retryJob() at /var/www/vendor/laravel/framework/src/Illuminate/Queue/Console/RetryCommand.php:37
Illuminate\Queue\Console\RetryCommand->handle() at n/a:n/a
call_user_func_array() at /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87
Illuminate\Container\BoundMethod::callBoundMethod() at /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31
Illuminate\Container\BoundMethod::call() at /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php:572
Illuminate\Container\Container->call() at /var/www/vendor/laravel/framework/src/Illuminate/Console/Command.php:183
Illuminate\Console\Command->execute() at /var/www/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /var/www/vendor/laravel/framework/src/Illuminate/Console/Command.php:170
Illuminate\Console\Command->run() at /var/www/vendor/symfony/console/Application.php:901
Symfony\Component\Console\Application->doRunCommand() at /var/www/vendor/symfony/console/Application.php:262
Symfony\Component\Console\Application->doRun() at /var/www/vendor/symfony/console/Application.php:145
Symfony\Component\Console\Application->run() at /var/www/vendor/laravel/framework/src/Illuminate/Console/Application.php:89
Illuminate\Console\Application->run() at /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:122
Illuminate\Foundation\Console\Kernel->handle() at /var/www/artisan:35

I think that problem is failed jobs has not any information about tags assigned but this is definetely an issue for package users.

@driesvints
Copy link
Member

@vaniyokk Can you setup a test app or post the minimum amount of code which reproduces this?

@vaniyokk
Copy link

vaniyokk commented Feb 11, 2019

@vaniyokk Can you setup a test app or post the minimum amount of code which reproduces this?

I can provide any code you need, or make any debugging actions, but this issue relies on DB data in the failed_jobs table. I have no time for deploying test application with the state needed to reproduce an issue for now.

Have just reverted repository to the state before install of laravel-horizon and queue:retry works perfectly!

@ahtinurme
Copy link

This is really f*** annoying...

@Hawlitschek
Copy link

The error still persists.
In order to reproduce the issue, just add a row into the failed jobs table and run
php artisan queue:retry all

In our case, we populate redis from another application. Therefore last pushed will always be empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants