Skip to main content


Addon cron hooks not working - how to debug?


About a month ago cron jobs from my custom addons mysteriously stopped working. (It says a lot that I only just noticed!) Functions added with the "cron" hook are never being run.

I'm trying to debug how these hooks are supposed to be called, and getting nowhere. I'm starting to wonder if they even get called at all? It's really hard to figure out the code path. Every time I find a function with "cron" in the name, it has a comment claiming that it runs cron jobs, but in fact it adds a row to a database or forks a subprocess or executes a new process or something.

Can someone point me to the place in the code where addon cron jobs are supposed to be directly run?

@Friendica Developers

Friendica Developers reshared this.

in reply to Matthew Exon

OK, I answered my own question and found my bug. The answer as where cron jobs are run from is Worker\ForkHook\ForkHook::execute(). And an uncaught exception in there will prevent any other cron jobs running. In my case the uncaught exception came from Photo::Store, when given this photo: https://images.sbs.com.au/85/20/3010422f452a827683f4f6a2e654/20230223001766790659-original.jpg?imwidth=1280.

Friendica Developers reshared this.

⇧