Help

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

Cron job completes Instantly on production without throwing errors – works correctly on dev

Avatar
Discard
2 Answers
0
Avatar
odoo
Best Answer

The solution was to simply uninstall the module and install it again, it now works as expected. 

Avatar
Discard
0
Avatar
odoo
Best Answer

Hi,


On development, the cron job runs fine and takes about 20 minutes, but on production it finishes instantly without doing any work and the expected log message never appears. The cron used to run but stopped after changes were made to the odoo.conf file. Reverting the configuration didn’t fix the problem, and no errors show up in the logs or the UI.


The most likely causes are that the cron record is no longer correctly linked to the model, the model is not imported or loaded properly, the cron is running under a user with insufficient permissions, the cron registry cache has not refreshed, or the cron record itself has become corrupted.


To debug, you should check the scheduled action in Settings → Technical → Automation → Scheduled Actions to confirm the model and code are correct. You can also test in Odoo Shell whether the model orgamax_sync exists and whether calling sync_customers() directly works. If it does, the issue lies in the cron link; if not, the model may not be loaded. Changing the cron user, forcing a module reload with -u, or deleting and recreating the cron are recommended next steps.


In summary, the issue comes down to the cron record not being correctly tied to the model or method in production. Recreating or updating the scheduled action so it points properly to orgamax_sync.sync_customers should resolve the problem.


Hope it helps

Avatar
Discard