Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

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

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

Cursor closed error during large CSV import via cron job in Odoo.sh

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
databasecronjobodoo18odoo-developmentodoo-customization
1 Antworten
2065 Ansichten
Avatar
Rushik Pitroda

Hi Odoo Community, 

I'm facing an issue while importing large datasets (e.g., thousands of records) using a cron job in Odoo, and this is specifically on Odoo.sh.

🧪 Scenario:
  • I upload a large CSV file (with 5000+ records).
  • A scheduled cron job runs every 5 minutes to process and create records in the database.
  • After some time (usually mid-process), the cron crashes with this error:

psycopg2.InterfaceError: cursor already closed

🔍 Observations:
  • The issue does not occur with small files (under 500 records).
  • It seems to be related to long-running loops, likely causing the DB session or cursor to close unexpectedly.
  • This happens consistently during large data operations on Odoo.sh and also in Local.
❓ My Questions:
  1. Why does the “cursor already closed” error occur during long cron executions in Odoo?
  2. Since I’m using Odoo.sh, I cannot modify server timeouts or configurations — what are the alternatives?
  3. What’s the best practice to safely process thousands of records in a cron job on Odoo.sh? and also in Local

Any help would be highly appreciated 🙏

Thanks in advance!

0
Avatar
Verwerfen
Chris TRINGHAM

If you are using a shared server on odoo.sh then you can't run long batch jobs. As a dedicated odoo.sh server is very expensive you probably need to look at other hosting options which allow you to have more control.

Avatar
Christoph Farnleitner
Beste Antwort

You need to perform your import in smaller chunks.

We usually do this by just fetching a more reasonable number of lines from a large file and keep track of the last processed line once that chunk has been processed.

Now, by keeping track of the last record, you can utilize the ir.cron.trigger model. In here you would store the cron_id and a call_at datetime allowing you to continue with the next set of lines, once it's its turn.

This way you don't have to deal with manual cursor creation since each iteration of a cron task would just work on a limited number of records, safely process it, stop gracefully and the awaits the next trigger to run the cron task (starting from the last processed line + 1). This is logic you will have develop.

0
Avatar
Verwerfen
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
How to Set Decimal Accuracy for a Custom Float Field
odoo18 odoo17 odoo-development odoo-customization
Avatar
Avatar
1
Juni 25
1906
Schedule Action code is not working in odoo 18 Gelöst
cronjob odoo18
Avatar
Avatar
1
Nov. 25
7500
🔍 Odoo 17 : How to Search Compute Fields Without store=True in Python (Backend)? Gelöst
computed-fields odoo-development odoo-customization
Avatar
Avatar
1
Juni 25
2076
Alternative to `numbercall` for Automated (Cron) Jobs (Scheduled Action) in Odoo 18 Gelöst
cronjob AutomatedActions ScheduledActions odoo18
Avatar
Avatar
1
Okt. 25
6023
Is it safe to remove a module by deleting it from the addons directory along with all dependent modules?
database addons uninstall ir_model_fields odoo18
Avatar
Avatar
1
Jan. 25
1869
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Bildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة 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 ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

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