This question has been flagged
9 Replies
54015 Views

Hi, While taking backup from odoo 10 Enterprise getting error ,


Database backup error: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmpAa0O5Q/dump.sql', u'ahlain_db01') error 1

my instance is hosted on AWS,



thanks 

"PostgreSQL 9.5.6 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609, 64-bit"

 

Avatar
Discard

Was this ever resolved? I am having the same issues restoring a backup.

Best Answer

This error is not very useful as such, error 1 means for sure there is an error, but not more.

While running pg_dump, one should examine the output for any warnings (printed on standard error).

So I had there the following:

pg_dump: aborting because of server version mismatch
pg_dump: server version: 12.4 (Ubuntu 12.4-1.pgdg20.04+1); pg_dump version: 10.14 (Ubuntu 10.14-1.pgdg20.04+1)

So in this case, you shall solve the version mismatch.

Hope it helps someone.

Cheers

Avatar
Discard
Author Best Answer

Hi,

In my case I had added one test table while was causing this issue then I had dropped that table as seems any object creation you might need to register or update scripts. Hope this will help. thanks

Avatar
Discard

Malik Sikandar Hayat, You are a life saver brother.

I did the same as you say but it still have this error, how can i fix it?

Best Answer

I have the same error, my idea is using command line to find the error

1. logging to postgresql

    sudo su - postgres

    -bash-4.2$ pg_dump od15_br220805 | gzip > od15_br220805.gz
    pg_dump: server version: 13.9; pg_dump version: 9.2.24
    pg_dump: aborting because of server version mismatch
    -bash-4.2$ exit

    ##so obviously is the pg_dump version not matched to the server version

2. change the pg_dump version

   pg_dump --version

       ## pg_dump (PostgreSQL)9.2##

   sudo find / -name pg_dump

        ## /usr/bin/pg_dump ##
        ## /usr/pgsql-13/bin/pg_dump ##

    sudo ln -sfn /usr/pgsql-13/bin/pg_dump /usr/bin/pg_dump

    pg_dump --version

        ## pg_dump (PostgreSQL) 13.9 ##

Finally I upgrade the pg_dump 

now I could backup the postgresql database either from odoo database manager and command line 

        



    

Avatar
Discard
Best Answer

Hi Malik! (MORE QUIKY WAY)  

Yo pude resolverlo, el problema es cuando intentas importar la database seleccionando el objeto "dump.sql" , lo correcto es elejir el objeto .zip que obtienes al Exportar la database, en ese caso me importó con exito y sin errores la informacion completa.

I has been able to solve it , my problem was when i try to import the database clicking "Restore Database" and load the "dump.sql" archive, but the correct way its loading the entire .zip file that export the odoo when you clic in "backup".


i hope it works.


Avatar
Discard
Best Answer

effectivement le souci est lié au filestore, si vous effectuez un backup depuis l'interface sans filestore , c'est a dire sans le mode ZIP , ca marche correctement ...

apres vous importerez votre filestore manuellement

Avatar
Discard

comment importer le filestore manuellement stp?

Best Answer

I got the same error, but it was because I run odoo with docker, postgres and odoo are in 2 different containers, and retrying the pg_dump from my odoo container I got this error "Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?" => and in my case, the answer was no to the 2 parts of the question.

To get a quick turnaround, I decided to run separatly the pg_dump from my postgres container et the tar.gz of the filestore from the odoo container

Avatar
Discard
Best Answer

For me it was because I was using postgres 12 instead of 11.

Have a look here: \https://github.com/minhng92/odoo-13-docker-compose/issues/1


Avatar
Discard
Best Answer

Thank you Malik. Your answer solved it for me. I had 2 tables created from pgadmin, i dropped them and the backup worked. If you want new tables in your odoo database, create them from studio, if you are on an Enterprise version.

Avatar
Discard
Best Answer

This looks like postgresql error. Please try to create manual full backup from /web/database/manager

Avatar
Discard