[6.1 trunk]: unable to backup database / zero size file

Bug #790164 reported by Bogdan Stanciu
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Medium
OpenERP's Framework R&D

Bug Description

hello,

while trying to backup a database from File>Databases>Backup database
I get the following result:
1a. if i type a WRONG pwd, I am asked for file dump location, then I get a message "Couldn't save db" AND NOT "AccessDenied"!!
1b. type the right passwd
2. select location (r/w access)
3. click ok > get msg "database successfully saved"
4. go to location, the file is there, size = 0 (empty file)

ubuntu 11.04, pg 9

thank you!
Bogdan

Revision history for this message
Bogdan Stanciu (bstanciu) wrote :

Forgot to mention, but no traceback, the openerp-server log file has only:
[2011-05-30 13:16:02,013][?] INFO:web-services:DUMP DB: bs_02
however, the pg log has this:
2011-05-30 13:16:01 CEST LOG: could not receive data from client: Connection reset by peer
2011-05-30 13:16:02 CEST LOG: could not receive data from client: Connection reset by peer

Revision history for this message
Bogdan Stanciu (bstanciu) wrote :

also, the server has this in the dialog:
localhost:8070, protocol NET_RPC (port:8070)

Revision history for this message
Bogdan Stanciu (bstanciu) wrote :

moreover, it appears that for some reason,

dump_b64 and dump at line 1512 in /client-trunk/bin/modules/gui/main.py

stay empty.

Revision history for this message
filsys (office-filsystem) wrote : Re: [Bug 790164] [NEW] [6.1 trunk]: unable to backup database

Also Ref: Re: [Bug 779474] Re: [6.1 trunk]:[account_voucher]:
loading test/account_voucher.yml fails

OpenERP try to backup 'unatended' database.
Password supplied in the OpenERP client is for access to the management
functions of OpenERP database (default admin at database creation).
But, postgres need the password for owner of database (openerp in your
case, from Ref.).
Please put this line in .pgpass file from your ~ :
localhost:5432:database:openerp:password
(like for postgres user)
I supposed that your server is localhost.

Thanks

On 30.05.2011 14:10, Bogdan Stanciu wrote:
> Public bug reported:
>
> hello,
>
> while trying to backup a database from File>Databases>Backup database
> I get the following result:
> 1a. if i type a WRONG pwd, I am asked for file dump location, then I get a message "Couldn't save db" AND NOT "AccessDenied"!!
> 1b. type the right passwd
> 2. select location (r/w access)
> 3. click ok> get msg "database successfully saved"
> 4. go to location, the file is there, size = 0 (empty file)
>
> ubuntu 11.04, pg 9
>
> thank you!
> Bogdan
>
> ** Affects: openobject-client
> Importance: Undecided
> Status: New
>
>
> ** Tags: backup database pg ubuntu
>

Revision history for this message
Bogdan Stanciu (bstanciu) wrote :

hello,

thank you for your advice. i did as you said, but no success...

should I understand that it works for you? if yes, what could be the
useful settings?

i did set the pg_path in the /etc/openerp-server.conf to /usr/bin

what else??

thank you!
b
On 30. 05. 11 14:27, filsys wrote:
> Also Ref: Re: [Bug 779474] Re: [6.1 trunk]:[account_voucher]:
> loading test/account_voucher.yml fails
>
> OpenERP try to backup 'unatended' database.
> Password supplied in the OpenERP client is for access to the management
> functions of OpenERP database (default admin at database creation).
> But, postgres need the password for owner of database (openerp in your
> case, from Ref.).
> Please put this line in .pgpass file from your ~ :
> localhost:5432:database:openerp:password
> (like for postgres user)
> I supposed that your server is localhost.
>
> Thanks
>
>
>
> On 30.05.2011 14:10, Bogdan Stanciu wrote:
>> Public bug reported:
>>
>> hello,
>>
>> while trying to backup a database from File>Databases>Backup database
>> I get the following result:
>> 1a. if i type a WRONG pwd, I am asked for file dump location, then I get a message "Couldn't save db" AND NOT "AccessDenied"!!
>> 1b. type the right passwd
>> 2. select location (r/w access)
>> 3. click ok> get msg "database successfully saved"
>> 4. go to location, the file is there, size = 0 (empty file)
>>
>> ubuntu 11.04, pg 9
>>
>> thank you!
>> Bogdan
>>
>> ** Affects: openobject-client
>> Importance: Undecided
>> Status: New
>>
>>
>> ** Tags: backup database pg ubuntu
>>

Changed in openobject-client:
status: New → Invalid
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote : Re: [6.1 trunk]: unable to backup database

Update: a recent change in trunk should make the situation less confusing. Having a zero bytes dump was usually the consequence of using non-default PostgreSQL access control on Unix (the default 'ident' authentication failed).
A fix has landed in trunk [1] and the system should now properly report these cases as errors (instead of saying the backup was successful), and it should also automatically try to use the password configured in the configuration file.
This method may still fail (this is a call to the external pg_dump/pg_restore commands) so in that case you should double-check the pg_path config variable and try to create a $HOME/.pgpass (Unix) or %APPDATA%\postgresql\pgpass.conf (Windows) as explained in the PostgreSQL documentation [2].

[1] server trunk (6.1) revision 3992 rev-id: <email address hidden>
[2] http://www.postgresql.org/docs/8.4/static/libpq-pgpass.html

Changed in openobject-client:
status: Invalid → Fix Released
milestone: none → 6.1
affects: openobject-client → openobject-server
Changed in openobject-server:
milestone: 6.1 → none
Revision history for this message
Cuong (bhcuong2008) wrote :

Hi Olivier,

[1] has solved the issue.

Thanks,

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote : Re: [Bug 790164] Re: [6.1 trunk]: unable to backup database

On 01/31/2012 03:21 PM, Cuong wrote:
> [1] has solved the issue.

Great! Thank you for the feedback!

summary: - [6.1 trunk]: unable to backup database
+ [6.1 trunk]: unable to backup database / zero size file
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

A variation on this bug was reintroduced in OpenERP 7: on non-win32 systems it was again necessary to explicitly create a $HOME/.pgpass file if the PostgreSQL authentication required a password (i.e. not connecting via unix socket).

This has been fixed in the server 7.0 branch at revision 4893
(revision-id: <email address hidden>)

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → Medium
milestone: none → 6.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.