How can I learn more about why my Laravel Queued Job failed?

前端 未结 4 2079

The Situation

I\'m using Laravel Queues to process large numbers of media files, an individual job is expected to take minutes (lets just say up to an h

相关标签:
4条回答
  • 2021-02-06 00:41

    Worked for me, in vendor/laravel/framework/src/Illuminate/Notifications/SendQueuedNotifications.php Just remove "use Illuminate\Queue\SerializesModels;" Line 6 & modify Line 11 to "use Queueable;"

    0 讨论(0)
  • 2021-02-06 00:51

    as @cdarken pointed out, the exception can be found in your database table failed_jobs column name exception. Thanks @cdarken I wish his answer would be an answer and not a comment.

    0 讨论(0)
  • 2021-02-06 00:59
    • Run these command to create a table failed_jobs in db
    php artisan queue:failed-table
    php artisan migrate
    
    • Run queue worker php artisan queue:work --tries=2

    • Check the exception reason in your database table failed_jobs you've just created.

    0 讨论(0)
  • 2021-02-06 01:04

    In the newer Laravel versions there's an exception column in the failed_jobs table that has all the info you need. Thanks cdarken and Toskan for pointing this out!

    ==== OLD METHOD BELOW

    Here's what I always do, but first - make sure you have a failed-jobs table! It's well documented, look it up :)

    1. Run the php artisan queue:failed command to list all the failed jobs, and pick the one you're after. Write the ID down.

    2. Then, make sure to stop your queue with supervisorctl stop all duplitron-worker:

    3. Lastly, make sure your .env setting for APP_DEBUG = true.

    4. Then run php artisan queue:retry {step_job_1_id}

    5. Now manually runphp artisan queue:listen --timeout=XXX

    If the error is structural (and most are), you should get the failure with debug stack in your log file.

    Good luck with debugging :-)

    0 讨论(0)
提交回复
热议问题