mongodb / laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)
https://www.mongodb.com/compatibility/mongodb-laravel-integration
MIT License
6.96k stars 1.42k forks source link

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

Open v4mp1re opened 3 weeks ago

v4mp1re commented 3 weeks ago

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