Skip to content

[12]Database backup error: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmpwq82mb_s/dump.sql', 'rsswork') error 1 #234

@youmingzhao

Description

@youmingzhao

Impacted versions:
odoo 12.0
pg_dump (PostgreSQL) 10.6 (Debian 10.6-1.pgdg90+1)
postgres (PostgreSQL) 10.6 (Debian 10.6-1.pgdg90+1)
psql (PostgreSQL) 10.6 (Debian 10.6-1.pgdg90+1)

Steps to reproduce:

Install docker container (default installation)
Try to make a backup
Current behavior:

Gives error:
"Database backup error: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmpwq82mb_s/dump.sql', 'rsswork') error 1"

Activity

otech-nl

otech-nl commented on Dec 20, 2018

@otech-nl

Same here.

FWIW, when I enter a shell on the db container as user postgres I can do pg_dump -U odoo -d <dbname> >dump.sql

Then extract it with docker cp <containerId>:/var/lib/postgresql/dump.sql .

e-belair

e-belair commented on Jan 8, 2019

@e-belair

Hi I encounter the same problem. I think it's because the psql client version installed on the odoo image is 9.x while db is 10.x
When I connect to the odoo bash, psql -V return 9.6.10 while db return 10.6.
And when I try to dump, I get this error in the odoo output:

2019-01-08 16:06:03,107 1 INFO odoo odoo.service.db: DUMP DB: odoo format dump
pg_dump: server version: 10.6 (Debian 10.6-1.pgdg90+1); pg_dump version: 9.6.10
pg_dump: aborting because of server version mismatch
holdenrehg

holdenrehg commented on Jan 10, 2019

@holdenrehg

This seems to be an ongoing issue with the odoo docker images @manuscle and as far as I'm aware, the general response from odoo is manually patch it yourself.

e-belair

e-belair commented on Jan 10, 2019

@e-belair

@holdenrehg I already forked and patched the repos. But as long as Odoo 12 need Postgres 10 minimal, the pg client should be at least v10

fractalf

fractalf commented on Jan 28, 2019

@fractalf

I hade the same issue and wrongly connected it to the odoo repo. Apparently there is a fix coming.
Check out the comments here odoo/odoo#30599

gauravgcchawla

gauravgcchawla commented on Feb 1, 2019

@gauravgcchawla

I have found the solution to this problem
docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres:10

Despite of using this command to create a postgres database in docker use this

docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres:9.6

What it will do is it will install postgres 9.6 and you can then create backup easily

fractalf

fractalf commented on Feb 8, 2019

@fractalf

@gauravgcchawla any anyone else coming across this:

This is fixed now in the official docker image https://github.com/odoo/docker
Use this instead of downgrading your postgres db :)

@d-fence You can probably close this issue now :)

nikolaiortiz

nikolaiortiz commented on Feb 13, 2019

@nikolaiortiz

@gauravgcchawla any anyone else coming across this:

This is fixed now in the official docker image https://github.com/odoo/docker
Use this instead of downgrading your postgres db :)

@d-fence You can probably close this issue now :)

Hi, sorry, totaly new on this but with the same problem.
Can you explain a little more about what to do.

Thanks a lot.

d-fence

d-fence commented on Feb 14, 2019

@d-fence
Contributor

Hi, it's fixed here
and was merged in docker hub here

As already explained, if the psql client used to create the backup is from a postgres version smaller than the postgres server, it may fail. The latest dockers images, for any Odoo version, now uses the latest postgres psql client to create backups.
So the best thing to do is using the latest Docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @d-fence@e-belair@holdenrehg@fractalf@otech-nl

        Issue actions

          [12]Database backup error: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmpwq82mb_s/dump.sql', 'rsswork') error 1 · Issue #234 · odoo/docker