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):
- I select the CSV file from the VM's file explorer.
- The file explorer closes.
- 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.
- 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):
- 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.
- 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.
- 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!