How can I troubleshoot why my queue of tasks in stuck in Craft 3? I have a series of tasks lined up in the queue to run but they are just marking one as in progress and then sitting there and not executing.

I have tried updating the DB table "queue" by doing the following:

1) Changing the failed field to 1 and dateFailed to NOW() thus marking the task as failed then clicking the retry option. This just puts the task back into the same routine.

2) Changing both dateReserved and timeUpdated to NULL thus resetting the task and it go back into pending but this also doesn't help. 

I'm trying to debug the cause of this but getting lost in the code as it seems the QueueController is setting everything as it should be but then either not getting a response and updating the progress or it's failing silently somewhere along the way.

I have attached my queue logs below for reference but I can't see anything unless I am missing something glaringly obvious!?

I asked on the #craft3 Slack channel and got some help but nothing worked. Hopefully, we can find a solution on here and share with others.

CP Screenshot

Database Screenshot

Queue.log
I typically just truncate (delete all of the rows) the queue table if something goes wrong with a task.

Then I delete all of the files in storage/logs/ and I try to reproduce the problem. If it still happens, then I look in queue.log and web.log to see what the issue is.

Usually searching on [error] finds what I'm looking for pretty easily. Occasionally I have to browse through the file to find the actual problem, but that's why I delete the log files before I do it, so there isn't as much to wade through.

Relevant articles I wrote since this answer:


Robust queue job handling in Craft CMS
Zen and the Art of Craft CMS Log File Reading