Odoo Help


Could Not Restore Database Error. Odoo V8

on 2/12/15, 10:16 AM 6,034 views

It starts to run, gets to about 80% and then the message on the center off screen: Could Not Restore Database. But at the same time on a message box at right top corner says database resored.

Can not figure it out.


Thanks in advance for your time and help.



Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--

| 6 5 6
Baroda, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 4/14/16, 2:18 AM

Dear JA,

Please use below code.

Modified the openerp/tools/misc.py as follows:

def exec_pg_command(name, *args):
    prog = find_pg_tool(name)
    env = exec_pg_environ()
    with open(os.devnull) as dn:
# default commit 4bd2ee1
# https://github.com/odoo/odoo/commit/4bd2ee1aaace8e7f6fa5621688e00dc2115fa8a7
#        args2 = (prog,) + args
#        rc = subprocess.call(args2, env=env, stdout=dn, stderr=subprocess.STDOUT)
#        if rc:
#            raise Exception('Postgres subprocess %s error %s' % (args2, rc))
# new modification maclarensg
# https://github.com/odoo/odoo/issues/5241#issuecomment-76509036
         rc = subprocess.call((prog,) + args, env=env, stdout=dn, stderr=subprocess.STDOUT)
# new modification end

Hope this help for you.


Ankit H Gandhi.


Ludo - Neobis

--Ludo - Neobis--
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--


Ludo - Neobis
On 2/12/15, 10:19 AM

Check your logs for Odoo to see what the reason would be. Then post them here and we can have a look on how to solve this.


I'm having the same issue after a recent pull that @JA has described. I've opened a github issue here:


along with steps to reproduce and an excerpt from the debug logs. The traceback is as follows:

2015-02-12 09:18:10,054 7521 DEBUG testing openerp.tools.translate: translation went wrong for "'Backup Database'", skipped 2015-02-12 09:22:16,089 7521 INFO None openerp.service.db: DUMP DB: testing format zip 2015-02-12 09:22:16,208 7521 ERROR testing openerp.addons.web.controllers.main: Database.backup Traceback (most recent call last): File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 736, in backup dump_stream = openerp.service.db.dump_db(backup_db, None, backup_format) File "/opt/odoo/odoo-server/openerp/service/db.py", line 196, in dump_db openerp.tools.exec_pg_command(*cmd) File "/opt/odoo/odoo-server/openerp/tools/misc.py", line 127, in exec_pg_command raise Exception('Postgres subprocess %s error %s' % (args2, rc)) NameError: global name 'args2' is not defined 2015-02-12 09:22:16,209 7521 DEBUG testing openerp.tools.translate: translation went wrong for "'Backup Database'", skipped

I think the issue may have been introduced in a recent commit, although I am not sure which one. I have referenced a commit with a reference to the name 'args2' that was done recently, however i'm not absolutely sure whether this commit is related to the issue or not.

Luke Branch
on 2/12/15, 10:55 PM


Thanks for your help. I've just updated the github issue mentioned above. It looks like xmo-odoo issued a fix for the initial issue here:


However i've run into another issue in the same process detailed here:


I'm trying to determine if it has something to do with my setup/environment, or if it's a problem with an update in one of the core Odoo SA modules.

This setup was working fine up until a couple of weeks ago, so I suspect it may be related to Odoo core code updates, however if not I need to revise my setup procedure.

Your insight on this would be invaluable.

Luke Branch
on 2/27/15, 11:26 PM
On 2/12/15, 2:18 PM

Thanks. It seems in my case is because a configuration on nginx, and the error is about file to big. The case is that the file is only 4.3mb.

I will find correct configuration and see if this resolves issue.


Please write back here with what you find. I seem to have run into exactly the same issue without an Nginx proxy.

Luke Branch
on 2/16/15, 10:58 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 2/12/15, 10:16 AM
Seen: 6034 times
Last updated: 4/14/16, 2:18 AM