Siirry sisältöön
Odoo Menu
  • Kirjaudu sisään
  • Kokeile ilmaiseksi
  • Sovellukset
    Talous
    • Kirjanpito
    • Laskutus
    • Kulut
    • Datataulukot (BI)
    • Asiakirjat
    • Allekirjoita
    Myynti
    • CRM
    • Myynti
    • Kassajärjestelmä myymälään
    • Kassajärjestelmä ravintolaan
    • Tilaukset
    • Vuokraus
    Verkkosivut
    • Verkkosivun Rakennustyökalu
    • Verkkokauppa
    • Blogi
    • Foorumi
    • Livechat
    • Verkko-oppiminen
    Toimitusketju
    • Varastointi
    • Tuotanto
    • Tuotteen elinkaaren hallinta (PLM)
    • Ostot
    • Huolto
    • Laatu
    Henkilöstöhallinto
    • Työntekijät
    • Rekrytointi
    • Vapaat
    • Arvioinnit
    • Suositukset
    • Kuljetuskalusto
    Markkinointi
    • Somemarkkinointi
    • Sähköpostimarkkinointi
    • Tekstiviestimarkkinointi
    • Tapahtumat
    • Markkinoinnin automaatio
    • Kyselyt
    Palvelut
    • Projekti
    • Työaikakirjaukset
    • Kenttähuolto
    • Asiakaspalvelu
    • Suunnittelu
    • Ajanvaraukset
    Tuottavuus
    • Viestintä
    • Hyväksynnät
    • IoT
    • IP-puhe
    • Tietokirjasto
    • WhatsApp
    Kolmannen osapuolen sovellukset Odoo-Studio Odoo-Pilvialusta
  • Toimialat
    Vähittäiskauppa
    • Kirjakauppa
    • Vaatekauppa
    • Huonekaluliike
    • Ruokakauppa
    • Laitteistokauppa
    • Lelukauppa
    Ruoka & Majoitus
    • Baari ja Pubi
    • Ravintola
    • Pikaruoka
    • Majatalo
    • Juomien jakelija
    • Hotelli
    Kiinteistöt
    • Kiinteistönvälitystoimisto
    • Arkkitehtitoimisto
    • Rakentaminen
    • Kiinteistönhallinta
    • Puutarhanhoito
    • Kiinteistön omistajien yhdistys
    Konsultointi
    • Tilitoimisto
    • Odoo-kumppani
    • Markkinointitoimisto
    • Lakitoimisto
    • Osaajahankinta
    • Tilintarkastus & sertifiointi
    Tuotanto
    • Tekstiili
    • Metalli
    • Huonekalut
    • Ruoka
    • Panimo
    • Yrityslahjat
    Terveys & Liikunta
    • Urheiluseura
    • Silmälasiliike
    • Kuntokeskus
    • Hyvinvointialan ammattilaiset
    • Apteekki
    • Kampaamo
    Kaupat
    • Yleismies
    • IT-laitteisto & Tuki
    • Aurinkoenergiajärjestelmät
    • Suutari
    • Siivoustarvikkeet
    • LVI-palvelut
    Muut
    • Voittoa tavoittelematon järjestö
    • Ympäristötoimisto
    • Mainostaulujen vuokraus  
    • Valokuvaus
    • Leasing-pyörät
    • Ohjelmistojen jälleenmyyjä
    Selaa kaikkia toimialoja
  • Yhteisö
    Opi
    • Tutoriaalit
    • Dokumentaatio
    • Todistukset
    • Koulutus
    • Blogi
    • Podcast
    Kannusta kouluttautumaan
    • Koulutusohjelmat
    • Scale Up! Liiketoimintapeli
    • Vieraile Odoolla
    Hanki ohjelmisto
    • Lataa
    • Vertaile versioita
    • Julkaisut
    Tee yhteistyötä
    • Github
    • Foorumi
    • Tapahtumat
    • Käännökset
    • Ryhdy kumppaniksi
    • Kumppanipalvelut
    • Rekisteröi tilitoimistosi
    Hanki palveluja
    • Löydä kumppani
    • Löydä kirjanpitäjä
    • Varaa asiantuntijatapaaminen
    • Implementaatiopalvelut
    • Asiakasreferenssit
    • Tuki
    • Versionkorotukset
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Varaa demo
  • Hinnoittelu
  • Asiakaspalvelu

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Kirjanpito
  • Varastointi
  • PoS
  • Projekti
  • MRP
All apps
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Kaikki kirjoitukset Ihmiset Merkit
Tunnisteet (Näytä kaikki)
odoo accounting v14 pos v15
Tietoa tästä foorumista
Apua

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

Tilaa

Saat ilmoituksen, kun tähän viestiin ilmaantuu aktiviteettia

Tämä kysymys on merkitty
developmentconfigurationfunctiondebug
2 Vastaukset
1118 Näkymät
Avatar
stefan

Hello,

I am facing the following issue:

I have a cron job that runs perfectly on our development instance. On dev, it takes around 20 minutes to complete. However, when I start it manually on our production instance, it completes instantly without actually performing any work.

Here are the logs from the production instance when I trigger the job manually:

2025-09-12 15:06:37,827 1044751 INFO webx odoo.addons.base.models.ir_cron: Manually starting job `OrgaMax Sync`.
2025-09-12 15:06:37,829 1044751 INFO webx odoo.addons.base.models.ir_cron: Job `OrgaMax Sync` done.

Notice that there are no errors in the logs or in the UI.

Cron job XML definition:

<odoo>
    <record id="orgamax_sync" model="ir.cron">
        <field name="name">OrgaMax Sync</field>
        <field name="active" eval="True"/>
        <field name="state">code</field>
        <field name="model_id" ref="model_orgamax_sync"/>
        <field name="code">model.sync_customers()</field>
        <field name="interval_number">1</field>
        <field name="interval_type">days</field>
        <field name="user_id" ref="base.user_root"/>
        <field name="priority">1</field>
    </record>
</odoo>

Model snippet:

import fdb
import logging
import time
from odoo import models, api

_logger = logging.getLogger(__name__)

class OrgaMaxSync(models.Model):
    _name = "orgamax_sync"
    _description = "Sync customers from OrgaMax to Odoo"

    @api.model
    def sync_customers(self):
        _logger.info("STARTING JOB")
        start = time.time()
        ...

The rest of the sync_customers code is not very relevant since, as you can see, the log message "STARTING JOB" is never printed on production.
But there is error handling in the form of Try Except blocks which also log any erros using _logger.error

Module structure:

__manifest__.py
{
    "name": "OrgaMaxSync",
    "data": [
        "data/ir_cron_data.xml"
    ]
}

__init__.py
from . import models

models/__init__.py
from . import OrgaMaxSync

The even stranger part is that this cron used to run on production but would eventually timeout. To fix that, I increased the CPU time in odoo.conf to 30 minutes. After that, the cron started behaving this way. I reverted the odoo.conf settings back to the previous state, but the cron job still finishes instantly.

I also tried setting the next execution time in the UI to 5 minutes in the future, but it still does not execute automatically. The cron is enabled (active=True).

I am on Odoo 17.

Has anyone experienced this before or have any idea why the cron would immediately finish without logging anything?

0
Avatar
Hylkää
Avatar
stefan
Tekijä Paras vastaus

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

1
Avatar
Hylkää
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Paras vastaus

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

0
Avatar
Hylkää
Nautitko keskustelusta? Älä vain lue, vaan osallistu!

Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!

Rekisteröidy
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
[Aide] Modules custom non détectés ou non exécutés sur Odoo 18 (Windows)
development configuration debug
Avatar
Avatar
1
lokak. 25
653
My Custom Module don't show in apps list after update.
development configuration debug
Avatar
Avatar
Avatar
2
elok. 25
1282
Creating a field in res.user is throwing internal server error
development configuration debug
Avatar
Avatar
Avatar
2
kesäk. 25
1499
technical problems
configuration function debug
Avatar
Avatar
1
maalisk. 25
1766
Updating acc_holder_name via external function
javascript development configuration accounting function debug
Avatar
0
syysk. 25
672
Yhteisö
  • Tutoriaalit
  • Dokumentaatio
  • Foorumi
Avoin lähdekoodi
  • Lataa
  • Github
  • Runbot
  • Käännökset
Palvelut
  • Odoo.sh hosting
  • Tuki
  • Versionkorotus
  • Räätälöidyt kehitykset
  • Koulutus
  • Löydä kirjanpitäjä
  • Löydä kumppani
  • Ryhdy kumppaniksi
Meistä
  • Yrityksemme
  • Tavaramerkki
  • Ota yhteyttä
  • Työpaikat
  • Tapahtumat
  • Podcast
  • Blogi
  • Asiakkaat
  • Oikeudellinen ilmoitus • Yksityisyys
  • Tietoturva
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo on kokoelma avoimen lähdekoodin yrityssovelluksia, jotka kattavat kaikki yrityksesi tarpeet: asiakkuudenhallinta eli CRM, verkkokauppa, kirjanpito, varastointi, kassajärjestelmä, projektinhallinta, jne.

Odoon uniikki arvolupaus on olla samanaikaisesti erittäin helppokäyttöinen ja täysin integroitu.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now