Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Sociale media-marketing
    • E-mailmarketing
    • Sms-marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Exception in cron

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
cronrestorerestoredbcronjobdatabasemigration
2 Antwoorden
3240 Weergaven
Avatar
Carlo

Hello,

after restoring database (with option database was moved) on the same server (just deleted and restored database) I see following error in logs:


2024-10-24 20:25:52,401 6706 DEBUG ? odoo.service.server: cron0 polling for jobs
2024-10-24 20:25:52,405 6706 DEBUG db_name odoo.addons.base.models.ir_cron: job 58 acquired
2024-10-24 20:25:52,409 6706 WARNING db_name odoo.addons.base.models.ir_cron: Exception in cron:
Traceback (most recent call last):
  File "/opt/odoo/odoo16/odoo/odoo/addons/base/models/ir_cron.py", line 319, in _process_job
    interval = _intervalTypes[job['interval_type']](job['interval_number'])
               ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
KeyError: None


How to debug and fix?

Thank you,

Carlo

0
Avatar
Annuleer
Avatar
Sujata
Beste antwoord

Hello Carlo, 


The KeyError: None error in your Odoo logs typically indicates that a cron job (automated background task) has an undefined or incorrect interval type. This can happen if the interval_type field in the ir.cron table is missing, set to None, or incorrectly configured after a database restore.

Here’s how you can debug and fix this issue:

1. Check the ir.cron Table for Missing or Invalid Values

  1. Access the Database:
    • Use a PostgreSQL client (e.g., psql on the command line) to connect to your database.
  2. Run a Query to Check interval_type:
    • Run this SQL query to identify any cron jobs with an invalid interval_type:
      SELECT id, name, interval_type, interval_number FROM ir_cron WHERE interval_type IS NULL OR interval_type NOT IN ('minutes', 'hours', 'days', 'weeks', 'months');
           This will show any records where interval_type is missing or invalid.
  3. Update the Missing Values:
    • If any rows have interval_type set to NULL or contain invalid values, update them with a valid interval_type value (such as 'days' or 'hours').
           Example SQL to update the value:
           UPDATE ir_cron SET interval_type = 'days' WHERE id = <id_of_the_cron_job>; 
           Replace <id_of_the_cron_job> with the actual ID of the cron job.

2. Restart the Odoo Service: After making changes to the database, restart the Odoo service to apply the fixes.
sudo service odoo restart

3. Debugging and Monitoring

  1. Check the Logs: After restarting, monitor the logs to ensure the error no longer appears.
  2. Verify Cron Jobs: Go to Settings > Technical > Automation > Scheduled Actions in Odoo, check that all cron jobs are enabled, and ensure they have valid interval types.

Let me this helps :)

1
Avatar
Annuleer
Avatar
Carlo
Auteur Beste antwoord

Thank you for great answer. Issue is resolved. I had two crons with NULL values and I managed to update values through pgAdmin.


0
Avatar
Annuleer
Sujata

Glad to hear that! 😊

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Cron job does not execute python code on scheduler, only on Run Manually button. Opgelost
cron cronjob
Avatar
Avatar
Avatar
3
sep. 23
12968
Backup and restore staging db
restore restoredb BACKUP
Avatar
Avatar
Avatar
2
sep. 25
1863
issue while restoring database
restoredb res.groups databasemigration
Avatar
Avatar
1
dec. 24
1812
Using CRON job to download and attach pdf to binary field ODOO16
cron cronjob ODOO16
Avatar
0
okt. 24
3168
Cron getting timeout
cron timeout cronjob
Avatar
Avatar
1
aug. 24
6231
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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