Nightly cron possibly skipped when an auto-update runs at 03:00
-
Hi,
I ran into a problem with the Firefly III package that I think can affect anyone using recurring transactions, so I'm sharing what I found.
What happened
Firefly showed one morning the "cron job hasn't run in 36 hours" warning, and that day's recurring transactions were missing. The app log shows why:
2026-10-05T03:00:01Z taskworker: Starting task ... (app update, package was v3.13.3) 2026-10-05T03:00:46Z apptask: deleteContainer: deleting app containers (app, scheduler) 2026-10-05T03:00:48Z services: setupAddons: setting up addon scheduler with options {"update_feeds":{"schedule":"0 3 * * *", ...}}The package runs
firefly-iii:cronat0 3 * * *. The auto-update started in the same minute and recreated the scheduler container, so the 03:00 run never happened. There is no==> cronline for that night. The night before, the cron ran normally at 03:00:22.Why this matters: Firefly does not catch up
CreateRecurringTransactions::handleOccurrence()only creates transactions whose date equals the cron's date (if ($date->ne($this->date)) { return null; }). A missed day is not caught up by the next nightly run.RecurringCronjob::fire()skips the run if the last run was less than 12 hours ago ($diff <= 43_200). So if you notice the problem in the afternoon and run the cron by hand, the next nightly run at 03:00 skips recurring transactions as well.
I only noticed because of the 36-hour warning. That warning is only visible from about 15:00 until the next night's run, so a missed run is easy to overlook.
Workaround
- Set Cloudron's auto-update time to anything other than 03:00 (System time zone is UTC here; I use 01:00).
- To catch up a missed day (owner account only, because
--forcerequires the owner role):sudo -u www-data -E php /app/code/artisan firefly-iii:cron --force --create-recurring --date=YYYY-MM-DD
Suggestions for the package
- Run the cron at a time that doesn't overlap with Cloudron's update windows, or
- after an update or restart, run the cron once if the last run is more than 24 hours old.
A minor one: the Cloudron health check hits
/healthevery 10 seconds without theX-Remote-Userheader, and Firefly logslocal.ERROR: No user in header "X-Remote-User"each time. That's about 8,600 error lines per day, which buries real errors in the log.Setup: Firefly III 6.7.7, 4 user accounts (only one in active use), proxy auth via Cloudron.
Thanks!
-
Hello @nottheend
after an update or restart, run the cron once if the last run is more than 24 hours old
I think this is the better way to approach this issue.
Changing the CRON to something else can still hit other people since it is variable8,600 error lines per day, which buries real errors in the log
Will have to understand first how it is expected so no log entry is generated.
-
-
Hello @nottheend
This depends on the user running Cloudron since it can be configured to what ever the user wants.
But the default is0 1,3,5,23 * * *, daily at 23:00, 01:00, 03:00 and 05:00.
So yes it could hit the default of 03:00 but only if an app update for the app is applied at this time. -
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login