How sending works
- Cron runs
php artisan schedule:runevery minute. The first scheduled task stamps a heartbeat so MagicPost can tell the cron job is alive. - Every minute
publishing:dispatchclaims the posts that are due and puts them on the queue. It hands out at most the number set in Hand out at most (25 a minute by default), minus whatever is already waiting. - Something has to work the queue. Under Posts are sent by → The scheduler, two scheduler tasks (
publishing:work) do it for up to Each pass sends for seconds each minute. Under A queue worker, you keepqueue:workrunning yourself. - Every five minutes
publishing:recoverfrees posts whose sending stopped half way.
Start with System health
Go to Admin → Publishing → Settings. The System health card at the top lists every check and its state. Select Check again after a change. The title tells you how bad it is: “Ready to publish”, “N things to look at”, or “N problems stop posts from going out”.Cron problems
The Cron job line says the scheduler has never run
The Cron job line says the scheduler has never run
1
Copy the command
In Admin → Publishing → Settings → Sending, find Cron job. Select Copy. The command looks like
cd /path/to/site && /path/to/php artisan schedule:run >> /dev/null 2>&1, with the real paths for your server. Copy the crontab line gives the same command with the five time fields in front.2
Add it to your host
In your hosting control panel open Cron Jobs, choose Once Per Minute and paste the command. On a VPS, add the crontab line with
crontab -e.3
Wait one minute
Select Check again. The tag next to Cron job changes from Has not run yet to Last ran with a time.
It ran before but stopped, or the time is more than a few minutes old
It ran before but stopped, or the time is more than a few minutes old
- Wrong PHP. The command must use a PHP 8.3 or newer command-line binary. A cron job that calls an older PHP fails without a visible error. Ask your host for the path of the PHP 8.3 command-line program and put it in the command.
- Output hidden. The command ends with
>> /dev/null 2>&1, which throws errors away. Runcd /path/to/site && php artisan schedule:runby hand over SSH, or remove the redirect for a day, to see the error. - Slow interval. Some hosts allow cron only every 5 minutes. MagicPost still works, but posts can go out up to 5 minutes late, and the Cron job line counts anything older than 5 minutes as stale.
- Cron changed or removed. The host or a migration may have reset the crontab. Open the cron screen and check the entry is still there.
php artisan schedule:list to confirm the scheduler sees its tasks. The list includes publishing:heartbeat, publishing:dispatch, publishing:recover and the publishing:work lanes.Posts that were due while cron was stopped
Posts that were due while cron was stopped
They are not skipped. When the scheduler runs again, every due post on a healthy channel is sent, in batches of Hand out at most posts a minute, with each owner taking a turn. If you do not want an old post to go out late, open it and use Pause or Remove before you fix cron.
Queue messages
The Queue line shows one of these. Where a number or name appears, MagicPost fills in the real value.Run a queue worker instead
A worker suits a VPS where you can keep a process running.1
Switch the mode
In Admin → Publishing → Settings → Sending, under Posts are sent by, choose A queue worker and select Save settings. The scheduler then stops working the queue itself.
2
Keep the worker running
Copy the command shown under Keep this running. It is
php artisan queue:work --queue=publishing,default,media. Run it from the application folder under Supervisor or systemd so it restarts if it stops.3
Keep the cron job
The cron job is still required. It decides what is due and hands it to the worker.
php artisan queue:restart so it loads the new files.
Post status problems
A post stays Scheduled after its time
A post stays Scheduled after its time
Work down this list:
- System health shows a red Cron job or Queue line. Fix those first.
- The post is Paused or Awaiting approval. Neither goes out until it is resumed or approved.
- The channel is paused, needs reconnecting, or its network is switched off. The post page shows the reason and a Resume channel or Reconnect button. See Channel connection problems.
- The network asked MagicPost to slow down. The post page says “asked us to pause” and for how long. It goes out after that.
- Many posts were due at once. Each minute only Hand out at most posts are claimed, so the rest follow over the next minutes.
A post stays Publishing
A post stays Publishing
Large videos take time, and the post page says “This is taking longer than usual. It carries on in the background, so you can leave this page.” That is normal.If it stays in this state past Pick up a stalled send after (15 minutes by default), the sending process died. The recovery task, which runs every five minutes, then does one of these:
- Marks the post published if the network already has it.
- Asks the network whether an unanswered attempt went through, and if it cannot tell, shows Unconfirmed.
- Puts it back in the queue, if it has attempts left.
- Fails it with “Publishing was interrupted and did not finish.”
A post says it was held and then was not sent
A post says it was held and then was not sent
A post whose channel is paused, expired or switched off waits for the time set in Wait for a channel for up to (24 hours by default). The post page shows “Held until … After that it is not sent.” After that time the channel’s part is closed with one of these messages:
- “This was not sent, because … was paused for more than 24 hours.” Skipped.
- “This was not sent, because … was not reconnected within 24 hours.” Failed.
- “This was not sent, because … kept … on pause for more than 24 hours.” Failed.
- “This was not sent, because publishing to … was unavailable for more than 24 hours.” Failed.
Videos stay in processing in the media library
Videos stay in processing in the media library
Video analysis is a background job on the
media queue. It waits for the same scheduler or worker as publishing. Fix the cron job and the queue first, then see Video processing.Run the passes by hand
If you have SSH, you can run the scheduler’s tasks yourself to see what they report. They act on real posts, exactly as the scheduler would.publishing:dispatch prints a line such as “Queued 3, held 1, skipped 0, failed 0.” where held counts due posts that cannot go out yet. publishing:recover prints “Released 0, recovered 0, unconfirmed 0, failed 0.” with the counts of what it settled.
