Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

petervandijck's avatar

Struggling with Queues on Forge

I am setting up a queue in Forge, and am struggling. Is one of these steps wrong? Am I making this too complicated?

  1. It works locally.

  2. Scheduled Job. I set up a scheduled job:

php /home/forge/laravelrosenfeld.getsimplyput.ai/artisan schedule:run

In Kernel.php, I have this code:

$schedule->job(new PodcastGetRSS)->everyFiveMinutes(); // Get the Podcast RSS feed

I would expect to see it running this job when I click Show Output, but it says "INFO No scheduled commands are ready to run. "

  1. Worker. I have a Worker set up, connection = 'database'. Logs say "No Log content available.".

  2. ENV. In my .env script, I have

QUEUE_CONNECTION=database
  1. Deploy. In my deploy script, I added queue:restart as follows:
if [ -f artisan ]; then
$FORGE_PHP artisan migrate --force
fi
$FORGE_PHP artisan queue:restart
npm install
npm run build

Is this even necessary??

This queue does not run very often, and is not heavily used. Whatever setup that would be simple is ok for me. (It doesn't have to use the database connection, that just seemed easiest).

Have I set something up wrong? Is there a simpler setup I should try?

0 likes
2 replies
LaryAI's avatar
Level 58

It seems like you have the basic setup correct, but there are a few things we can check and clarify to ensure your queue is working properly on Forge.

  1. Ensure your cron job is set up correctly on Forge. Forge should automatically set up the schedule:run command to run every minute, but it's worth checking that the cron job is indeed set up and running. You can check this in the Forge dashboard under the "Scheduler" section.

  2. Check your scheduled task definition. Make sure that the PodcastGetRSS job is being dispatched correctly. Your Kernel.php looks correct, but ensure that the job itself doesn't have any issues that could prevent it from being dispatched.

  3. Verify that your queue worker is running. In Forge, under the "Queue" section, make sure that your worker is running and that it's set to listen to the correct queue connection and queue name (if you're using named queues).

  4. Check your .env file and cache. Make sure that your .env file on the server actually has the QUEUE_CONNECTION=database line and that the configuration is not being cached with an old value. You can clear the configuration cache by running php artisan config:clear.

  5. Monitor your queue jobs table. Since you're using the database queue connection, check the jobs table in your database to see if jobs are being inserted when the scheduled task runs.

  6. Check for failed jobs. Also, check the failed_jobs table to see if any jobs have failed to run. This can give you insight into any issues that might be occurring.

  7. Regarding the deployment script. The queue:restart command is necessary when you deploy new code that could affect how your jobs run. It gracefully restarts all of the queue workers so that they will start using the new code. However, if you're not changing code related to your jobs, it's not strictly necessary to run it every time.

Here's a simplified checklist:

  • Verify cron job for schedule:run is set up in Forge.
  • Ensure PodcastGetRSS job dispatches correctly.
  • Confirm the queue worker is running and configured correctly in Forge.
  • Check .env file and clear config cache if necessary.
  • Monitor jobs and failed_jobs tables in the database.
  • Use queue:restart in deployment when job-related code changes.

If after checking all these points you're still facing issues, you might want to look into the logs for any errors or stack traces that can provide more information about what's going wrong. You can check the Laravel logs typically found in storage/logs/ or any other logging services you might have configured.

Ssionn's avatar

Like the bot is saying above, you want to make a cronjob for this, this can be found in the server tab, not the your application tab

Please or to participate in this conversation.