Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Custom code: Odoo 17: Import CSV Failed to fetch (VM Local)

Subscriure's

Get notified when there's activity on this post

This question has been flagged
2 Respostes
876 Vistes
Avatar
Diego Perona

Hello everyone,

I'm developing custom modules in Odoo 17 and am encountering a persistent issue when trying to import a CSV file into a custom model. Any help would be greatly appreciated.

Environment Context:

  • Odoo Version: Odoo 17
  • System: Odoo is installed on a Virtual Machine (VM) running Ubuntu Server 22.04.
  • Odoo Access: I access the Odoo web interface (http://localhost:8069) from the Chrome browser, which is also installed and running inside the same Virtual Machine. So, both the browser and the Odoo server are within the same VM environment.
  • Affected Modules: I'm working on a custom module (amazon_catalogs) that defines several models for storing reference data. The issue occurs when attempting to import data into any of these models.
  • Database: I'm working on the Ofituria database.

Detailed Problem Description:

When I try to import a CSV file via the Odoo interface (e.g., in Amazon Catalogs -> Supplier Mapping -> Gear icon -> Import records -> Upload file):

  1. I select the CSV file from the VM's file explorer.
  2. The file explorer closes.
  3. The Odoo screen, where it should preview the data and allow me to map columns, remains blank and unchanged, as if no file was uploaded.
  4. In the browser console (Chrome, inside the VM), the following error is displayed:
    UncaughtPromiseError > TypeError
    Uncaught Promise > Failed to fetch
    TypeError: Failed to fetch
        at Object.post (http://localhost:8069/web/assets/80df7b8/web.assets_web.min.js:2932:30)
        at FileInput.uploadFiles (http://localhost:8069/web/assets/80df7b8/web.assets_web.min.js:2520:32)
        at FileInput.onFileInputChange (http://localhost:8069/web/assets/80df7b8/web.assets_web.min.js:2522:85)
        at Object.mainEventHandler (http://localhost:8069/web/assets/80df7b8/web.assets_web.min.js:1593:77)
        at HTMLInputElement.listener (http://localhost:8069/web/assets/80df7b8/web.assets_web.min.js:748:15)
    

Troubleshooting Steps Already Taken (and Results):

  1. Odoo Server Logs Check: I've monitored the Odoo service logs (sudo journalctl -u odoo.service -f) during the import attempt. No new entries, ERRORs, or WARNINGs appear in the server logs at the time of failure. This strongly suggests the request is not even reaching the server.
  2. Simplified CSV Test: I created a very simple CSV file (just headers and one or two basic data rows, e.g., internal_supplier_code,nationality\nTEST1,ES) with UTF-8 encoding. The error persists.
  3. Incognito Mode: I tried the import in Chrome's incognito mode (within the VM), and the Failed to fetch error still occurs. This rules out browser cache or extension conflicts.

My Current Hypotheses (and Request for Help):

Given that the server doesn't register the request and the issue occurs on the browser side within the same VM, my current suspicions are:

  • Internal VM Firewall (Ubuntu - ufw): Could a local firewall (like ufw) be blocking even localhost communications on that specific port? What specific rules should I check for or apply/disable for testing? I've checked sudo ufw status but am unsure what exactly to look for.
  • VM Resource Limitations: Could the browser be running out of memory or CPU when trying to process the file or the upload request, even for a simple CSV? The VM is allocated 4GB RAM and 2 CPU cores.
  • Subtle CSV File Corruption/Access Issue: Even though a simple CSV failed, could there be a peculiarity in how the browser accesses/reads the file from the VM's filesystem that prevents it from being sent?

Any guidance or suggestions would be greatly appreciated. Thank you in advance!

0
Avatar
Descartar
Avatar
Diego Perona
Autor Best Answer

I'm still stuck with a TypeError: Failed to fetch when trying to import CSV/Excel files into Odoo 17. Critically, both Odoo (the server) and the browser (Chrome/Firefox) are running within the same Virtual Machine (Ubuntu Server 22.04 with a graphical environment), and there are no logs on the Odoo server when the failure occurs. This indicates the request isn't even reaching the server.

I've followed all suggestions and exhausted the main lines of investigation. I'd greatly appreciate any new ideas on what else might be causing this.

What I've tried and ruled out:

  • Browser Issue:
    • Fails in Chrome (TypeError: Failed to fetch in console).
    • Fails in Firefox (fails silently, import screen doesn't advance).
    • Incognito mode/clean profiles tested on both.
    • Ruled out: The problem isn't browser-specific, nor is it extensions/cache.
  • Firewall/Internal Network Issue:
    • ufw is inactive on the VM.
    • /etc/hosts is correct (127.0.0.1 localhost).
    • Loopback (lo) interface restarted and active (127.0.0.1).
    • Odoo listens on 0.0.0.0:8069.
    • Ruled out: Not a firewall block or obvious internal network misconfiguration.
  • Odoo/Server Issue:
    • Odoo server logs (journalctl -u odoo.service -f) show no entries during the import failure.
    • limit_request_body in odoo.conf is set to 100MB.
    • Ruled out: The request isn't reaching the server; Odoo isn't directly responsible for the "fetch" failure.
  • CSV/File Location Issue:
    • Tested with an extremely simple CSV (one data row).
    • Files moved to secure local folders (~/Documents/odoo_csv) within the VM.
    • Ruled out: Not the file content or its location.
  • Graphical Environment/Chrome Launch Issue:
    • While the Missing X server or $DISPLAY error persists when trying to launch Chrome with debugging flags (--disable-web-security), the VM's general graphical environment does work (I use the browser normally from it).
    • Not fully ruled out: The influence of a graphical/permission issue on the browser's interaction with the system during upload is still a possibility, but it's not the obvious root of the "fetch" itself.

Seeking New Ideas:

Since the request dies before even leaving the browser and reaching Odoo, and we've ruled out the most common causes of Failed to fetch, I'm looking for ideas on:

  • Deeper corruption in the VM's network stack that specifically affects POST requests for file uploads from browsers to localhost.
  • Operating system-level permission issues that prevent the browser process from reading the file for upload or performing the network operation, even if standard file permissions look fine.
  • Other low-level services or configurations in Ubuntu Server that might be intercepting or corrupting these requests before they're sent.
  • Any other insights that could explain this behavior in a completely local VM environment.

Any additional perspectives or suggestions for low-level debugging would be highly valuable.

Thanks again for your time and help!

0
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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