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

Queue retry gets failed : Unable to find failed job with ID [] #3000

Open
v4mp1re opened this issue Jun 10, 2024 · 2 comments
Open

Queue retry gets failed : Unable to find failed job with ID [] #3000

v4mp1re opened this issue Jun 10, 2024 · 2 comments

Comments

@v4mp1re
Copy link

v4mp1re commented Jun 10, 2024

  • Laravel-mongodb Version: 10.0.2
  • PHP Version: 8.2.18
  • Database Driver & Version: 1.18.1

Description:

When queue:retry is run it returns Unable to find failed job with ID [] error for each items in queue.

Steps to reproduce

  1. Configure failed job with mongodb
  2. Fail a job
  3. retry failed job with php artisan queue:retry all

Expected behaviour

Failed jobs should be queued back to jobs table

Actual behaviour

Retrying fails.
in Queue:retry command

$ids = method_exists($failer, 'ids') ? $failer->ids($queue) : collect($failer->all()) ->where('queue', $queue) ->pluck('id') ->toArray();

the failer provider is MongoDB\Laravel\Queue\Failed\MongoFailedJobProvider::class which extends Illuminate\Queue\Failed\DatabaseFailedJobProvider::class .

MongoFailedJobProvider::class does not override DatabaseFailedJobProvider::class's ids() function. The ids function is implemeted based on the myssql which tries to get 'id' of the failed job instead of '_id' in the case of Mongodb

@hans-thomas
Copy link
Contributor

Hi @GromNaN, I worked on this issue for a couple of hours and found out the MongoDBQueueServiceProvider class and other related classes are removed in version 5,x. what's going on? currently, does the laravel-mongodb package support queues?

PS: the documentation needs an update.

@GromNaN
Copy link
Member

GromNaN commented Nov 22, 2024

The queue mechanism is still supported. The custom connector is registered in MongoDBServiceProvider

The custom FailedJobProvider was removed because it was a copy of DatabaseFailedJobProvider with specific transformations id/_id, object/array and Carbon/UTCDateTime that are now done by default by MongoDB Query Builder in version 5.

@v4mp1re doesn't tell in which laravel-mongodb version is the issue. I think it was fixed in version 4.3 by #2838

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

No branches or pull requests

3 participants