Skip to Content
Menu
This question has been flagged
3 Replies
4001 Views

Hello everyone,



I have a problem with my Odoo installation.


I have built an Odoo 14 in a set of Docker containers (an Odoo container and a Postgres container in version 10.3). Everything seems to work fine.



I tried to create a new database from the Odoo web interface and all went well. The database was created in the postgres container and the filestore directory was created in the odoo container (in /var/lib/odoo/filestore).



In the same Odoo installation, I tried to restore an existing database using the ZIP archive containing the database dump and filestore directory and, although the database was created in the postgres container, the filestore directory was not created in the odoo container at all.



Has anyone ever encountered this phenomenon?


I've already checked the filestore directory (/var/lib/odoo) permissions and I've also checked postgres versions (psql, pg_dump and pg_restore are all in version 10.3). 


The restored database was originally created with postgresql 10.3 as well.



I get no errors in the logs (neither Odoo nor postgres) when I try to restore the database.


On the other hand, I tried to dump the database I created directly from the web interface and got this error in the Odoo logs:



2024-01-25 14:19:45,357 9 INFO ? odoo.service.db: DUMP DB: odoo format zip 

2024-01-25 14:19:45,578 9 ERROR ? odoo.addons.web.controllers.main: Database.backup 

Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1180, in backup

    dump_stream = odoo.service.db.dump_db(name, None, backup_format)

  File "", line 2, in dump_db

  File "/usr/lib/python3/dist-packages/odoo/service/db.py", line 41, in if_db_mgt_enabled

    return method(self, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/odoo/service/db.py", line 241, in dump_db

    odoo.tools.exec_pg_command(*cmd)

  File "/usr/lib/python3/dist-packages/odoo/tools/misc.py", line 130, in exec_pg_command

    raise Exception('Postgres subprocess %s error %s' % (args2, rc))

Exception: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmpok49pnxc/dump.sql', 'odoo') error 1



There's definitely a configuration problem somewhere, but I can't put my finger on it. Does anyone have any ideas?


Thank you in advance


Avatar
Discard
Author Best Answer

Hello everyone,

I come to update my post because I found what was wrong with the database restore.


When I built my Odoo Docker installation, I used the Odoo 14 Docker image provided by Odoo in my Odoo container and the version 13.0 Postgres Docker image in my Postgresql container.


I couldn't restore the database correctly with the ZIP archive from Odoo's manager restore feature, so I searched my Odoo and Postgresql containers for any anomaly. 


I found that a Postgresql version 16.0 was installed in the Odoo container (certainly installed from the docker image provided by Odoo).


To check whether this was indeed the problem with the restoration, I completely recreated my docker environment using a postgres 16.0 image in my Postgresql container.


When I tried to restore the database, the filestore directory was indeed created in the correct directory (in the /var/lib/odoo/filestore directory of the Odoo container).


This seems to have solved my problem of restoring the database with a zip archive. 


The database dump problem persists, however, with exactly the same error. 

So I'm going back to my research!



UPDATE (22.02.2024)


For those of you experiencing the same problem with the dump, here's what I did that worked:

In my docker-compose.yml, I mounted a new volume as follows: 


volumes:
     [...]
      - /data/openupgrade/extra-addons/odoo/service/db.py:/usr/lib/python3/dist-packages/odoo/service/db.py 


I created the path "/data/openupgrade/extra-addons/odoo/service" and added a file db.py

I've overridden the "dump_db()" function code to replace it with the function code in version 16.


This manipulation solved my problem with the dump()







Avatar
Discard
Best Answer

The filestore is essential in Odoo as it holds attachments and binary files for the database

Avatar
Discard

Always back up the database and filestore together using the Odoo interface or manually.
https://incrediboxsprunki.com/mods/

Related Posts Replies Views Activity
2
Jan 21
7854
1
Mar 24
2172
0
Mar 16
4347
1
May 21
4314
1
Oct 21
2523