auto_backup icon indicating copy to clipboard operation
auto_backup copied to clipboard

Odoo 14.0 (self hosted) - 0 byte backups

Open Maximvdw opened this issue 11 months ago • 4 comments

First of all, thank you for the addon. I have been using it for a few years and recently saved me from a lot of headaches. I used to use the addon on a server where both odoo and postgres where running on the same server (localhost). I now migrated to two docker containers, one for odoo and one for postgresql. The issue I am facing is that the backups are 0 bytes.

I've searched the issues so I will list some of the common questions:

  • I do not use odoo.sh, it is self hosted
  • PostgreSQL is on another host
  • My configuration uses "localhost" as the host with port 8069 (This was not clear from the documentation) but I have also tried to use the host of the postgresql database
  • Database size of the ZIP file (before I migrated servers) was 455MB
  • Just to confirm, my database does work; Odoo correctly connects to my remote database
  • I've modified the configuration similar to what I've had before; multiple workers and modified the default cpu time
  • I confirm that the port in the backup configuration is correct
  • I confirm that the database name in the backup configuration is correct
  • The backup directory is writeable by odoo (hence also the 0byte files)
  • I use the latest commit from 2 years ago (https://github.com/Yenthe666/auto_backup/tree/14.0) However, I do have to mention that before I still used an older version. I only updated after I experienced the issue and also because I got a deprecation warning for osutil.tempdir which was solved in the last update.

Configuration: Host: localhost Port: 8069 Database: (name of database) Backup dir: /var/lib/odoo/backups/ Type: zip

Note: there is no mention of the db host and port; but I assume you fetch this information from the odoo.conf anyway?

Symptoms: I start the backup, the 0 byte zip file is almost instantly created. ~No errors in the console~

2024-02-27 09:29:31,885 41 INFO xxxxxxx odoo.addons.auto_backup.models.db_backup: DUMP DB: xxxxxxx format zip 
2024-02-27 09:29:34,868 33 INFO ? werkzeug: 10.0.2.177 - - [27/Feb/2024 09:29:34] "GET /web/static/src/img/spin.png HTTP/1.0" 304 - - - -
2024-02-27 09:29:37,390 41 INFO xxxxxxx werkzeug: 10.0.2.177 - - [27/Feb/2024 09:29:37] "POST /web/dataset/call_button HTTP/1.0" 200 - 15 0.015 5.511
2024-02-27 09:29:37,496 30 INFO xxxxxxx werkzeug: 10.0.2.177 - - [27/Feb/2024 09:29:37] "POST /web/dataset/call_kw/ir.cron/read HTTP/1.0" 200 - 38 0.036 0.043

EDIT: after modifying the logger.debug to logger.error

2024-02-27 10:04:19,427 41 ERROR xxxxx odoo.addons.auto_backup.models.db_backup: Couldn't backup database xxxxx. Bad database administrator password for server running at http://localhost:8069 
2024-02-27 10:04:19,427 41 ERROR xxxxx odoo.addons.auto_backup.models.db_backup: Exact error from the exception: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmp1hbll290/dump.sql', 'xxxxx') error 1 

From the above error it looks like the pg_dump does not consider the host of the database?

Maximvdw avatar Feb 27 '24 09:02 Maximvdw

Few extra comments:

  • I have tried a dump instead of a zip and it works
  • The database dump is 14MB (correct) the rest of the zip file (other 400+MB) is normally filled by the filestore
  • The database uses postgres 13 (so the issue does not seem to be related to https://github.com/Yenthe666/auto_backup/issues/226#issuecomment-1790624453)

Maximvdw avatar Feb 27 '24 09:02 Maximvdw

I'm pretty sure it happens because of the workers/server timing out.. I've never been able to reproduce it locally myself :(

Yenthe666 avatar Mar 04 '24 13:03 Yenthe666

Seeing the 0byte zip is created almost immediately after starting the backup that would seem weird? Also the "dump" works so it can not be a db timeout.

I will see if I can make a minimum viable reproducable example using the same docker stack (but with dummy data).

Maximvdw avatar Mar 04 '24 13:03 Maximvdw

I'm having a same setup where the database server is in another host. Both dump and zip result in 0 byte file.

I got postgres setup in application server so that pg_dump command is able to run. But still both dump and zip result in 0 byte file.

goeyzai avatar Apr 22 '24 16:04 goeyzai