This question has been flagged
6 Replies
11162 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.

 

Avatar
Discard
Best Answer

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.

Cheers,

Ankit H Gandhi.

Avatar
Discard
Best Answer

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.

Avatar
Discard

@Ludo,

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

https://github.com/odoo/odoo/issues/5241

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.

@Ludo,

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:

https://github.com/odoo/odoo/commit/ec9a543014a91be17398ba6e443578fe37c3a885

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

https://github.com/odoo/odoo/issues/5241#issuecomment-76509036

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.

Author Best Answer

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.

Avatar
Discard

@JA,

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