Btashi
Btashi

Reputation: 37

Odoo Database Export Error

I'm using Odoo 11 in windows 10 which makes it unstable so, i decided to launch it from linux.

The problem is when i try to export the DB from Database Manager it gives me 500 Internal Server Error. Any idea of what goes wrong?

Here is the log:

2018-07-15 07:54:29,292 6920 ERROR odoo2 odoo.addons.web.controllers.main: Database.backup Traceback (most recent call last): File "C:\Program Files\Odoo 11.0\server\odoo\tools\misc.py", line 94, in find_pg_tool return which(name, path=path) File "C:\Program Files\Odoo 11.0\server\odoo\tools\which.py", line 144, in which raise IOError(ENOENT, '%s not found' % (mode & X_OK and 'command' or 'file'), file) FileNotFoundError: [Errno 2] command not found: 'pg_dump'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Program Files\Odoo 11.0\server\odoo\addons\web\controllers\main.py", line 735, in backup
    dump_stream = odoo.service.db.dump_db(name, None, backup_format)
  File "<decorator-gen-8>", line 2, in dump_db
  File "C:\Program Files\Odoo 11.0\server\odoo\service\db.py", line 40, in if_db_mgt_enabled
    return method(self, *args, **kwargs)
  File "C:\Program Files\Odoo 11.0\server\odoo\service\db.py", line 216, in dump_db
    odoo.tools.exec_pg_command(*cmd)
  File "C:\Program Files\Odoo 11.0\server\odoo\tools\misc.py", line 122, in exec_pg_command
    prog = find_pg_tool(name)
  File "C:\Program Files\Odoo 11.0\server\odoo\tools\misc.py", line 96, in find_pg_tool
    raise Exception('Command `%s` not found.' % name)
Exception: Command `pg_dump` not found.
2018-07-15 07:54:29,800 6920 INFO odoo2 odoo.sql_db: ConnectionPool(used=2/count=4/max=64): Closed 1 connections to 'host=localhost port=5432 user=openpg password=xxxxxxxxx sslmode=prefer dbname=odoo'
2018-07-15 07:54:29,804 6920 INFO odoo2 odoo.sql_db: ConnectionPool(used=1/count=1/max=64): Closed 3 connections to 'host=localhost port=5432 user=openpg password=xxxxxxxxx sslmode=prefer dbname=odoo2'
2018-07-15 07:54:29,819 6920 INFO odoo2 werkzeug: 127.0.0.1 - - [15/Jul/2018 07:54:29] "POST /web/database/backup HTTP/1.1" 500 -
2018-07-15 07:54:29,827 6920 ERROR odoo2 werkzeug: Error on request:
Traceback (most recent call last):
  File "C:\Program Files\Odoo 11.0\python\lib\site-packages\werkzeug\serving.py", line 209, in run_wsgi
    execute(self.server.app)
  File "C:\Program Files\Odoo 11.0\python\lib\site-packages\werkzeug\serving.py", line 197, in execute
    application_iter = app(environ, start_response)
  File "C:\Program Files\Odoo 11.0\server\odoo\service\server.py", line 252, in app
    return self.app(e, s)
  File "C:\Program Files\Odoo 11.0\server\odoo\service\wsgi_server.py", line 166, in application
    return application_unproxied(environ, start_response)
  File "C:\Program Files\Odoo 11.0\server\odoo\service\wsgi_server.py", line 154, in application_unproxied
    result = handler(environ, start_response)
  File "C:\Program Files\Odoo 11.0\server\odoo\http.py", line 1304, in __call__
    return self.dispatch(environ, start_response)
  File "C:\Program Files\Odoo 11.0\server\odoo\http.py", line 1278, in __call__
    return self.app(environ, start_wrapped)
  File "C:\Program Files\Odoo 11.0\python\lib\site-packages\werkzeug\wsgi.py", line 600, in __call__
    return self.app(environ, start_response)
  File "C:\Program Files\Odoo 11.0\server\odoo\http.py", line 1472, in dispatch
    response = self.get_response(httprequest, result, explicit_session)
  File "C:\Program Files\Odoo 11.0\server\odoo\http.py", line 279, in __exit__
    self._cr.commit()
  File "C:\Program Files\Odoo 11.0\server\odoo\sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "C:\Program Files\Odoo 11.0\server\odoo\sql_db.py", line 375, in commit
    result = self._cnx.commit()
psycopg2.InterfaceError: connection already closed
2018-07-15 07:54:43,988 6920 INFO odoo2 werkzeug: 192.168.1.2 - - [15/Jul/2018 07:54:43] "POST /longpolling/poll HTTP/1.1" 200 -
2018-07-15 07:55:34,032 6920 INFO odoo2 werkzeug: 192.168.1.2 - - [15/Jul/2018 07:55:34] "POST /longpolling/poll HTTP/1.1" 200 -
2018-07-15 07:56:24,078 6920 INFO odoo2 werkzeug: 192.168.1.2 - - [15/Jul/2018 07:56:24] "POST /longpolling/poll HTTP/1.1" 200 -
2018-07-15 07:56:49,944 6920 INFO odoo2 odoo.addons.base.ir.ir_cron: Starting job `Mail: Fetchmail Service`.
2018-07-15 07:56:50,037 6920 INFO odoo2 odoo.addons.fetchmail.models.fetchmail: start checking for new emails on pop server PROJECTS APPLICATIONS
2018-07-15 07:56:53,536 6920 INFO odoo2 odoo.addons.fetchmail.models.fetchmail: General failure when trying to fetch mail from pop server PROJECTS APPLICATIONS.
Traceback (most recent call last):
  File "C:\Program Files\Odoo 11.0\server\odoo\addons\fetchmail\models\fetchmail.py", line 202, in fetch_mail
    pop_server = server.connect()
  File "C:\Program Files\Odoo 11.0\server\odoo\addons\fetchmail\models\fetchmail.py", line 124, in connect
    connection.pass_(self.password)
  File "C:\Program Files\Odoo 11.0\python\lib\poplib.py", line 213, in pass_
    return self._shortcmd('PASS %s' % pswd)
  File "C:\Program Files\Odoo 11.0\python\lib\poplib.py", line 176, in _shortcmd
    return self._getresp()
  File "C:\Program Files\Odoo 11.0\python\lib\poplib.py", line 152, in _getresp
    raise error_proto(resp)
poplib.error_proto: b'-ERR [AUTH] Authentication failed.'
2018-07-15 07:56:53,536 6920 INFO odoo2 odoo.addons.fetchmail.models.fetchmail: start checking for new emails on pop server Recruitment 
2018-07-15 07:57:02,180 6920 INFO odoo2 odoo.addons.fetchmail.models.fetchmail: General failure when trying to fetch mail from pop server Recruitment .
Traceback (most recent call last):
  File "C:\Program Files\Odoo 11.0\server\odoo\addons\fetchmail\models\fetchmail.py", line 202, in fetch_mail
    pop_server = server.connect()
  File "C:\Program Files\Odoo 11.0\server\odoo\addons\fetchmail\models\fetchmail.py", line 124, in connect
    connection.pass_(self.password)
  File "C:\Program Files\Odoo 11.0\python\lib\poplib.py", line 213, in pass_
    return self._shortcmd('PASS %s' % pswd)
  File "C:\Program Files\Odoo 11.0\python\lib\poplib.py", line 176, in _shortcmd
    return self._getresp()
  File "C:\Program Files\Odoo 11.0\python\lib\poplib.py", line 152, in _getresp
    raise error_proto(resp)
poplib.error_proto: b'-ERR [AUTH] Authentication failed.'
2018-07-15 07:57:14,139 6920 INFO odoo2 werkzeug: 192.168.1.2 - - [15/Jul/2018 07:57:14] "POST /longpolling/poll HTTP/1.1" 200 -
2018-07-15 07:57:56,378 6920 INFO odoo2 odoo.addons.base.ir.ir_cron: Starting job `Event: Mail Scheduler`.
2018-07-15 07:58:04,193 6920 INFO odoo2 werkzeug: 192.168.1.2 - - [15/Jul/2018 07:58:04] "POST /longpolling/poll HTTP/1.1" 200 -

Upvotes: 0

Views: 1890

Answers (1)

miw
miw

Reputation: 764

The interesting part of your error message is:

command not found: 'pg_dump'

This indicates that you need to add PostgreSQL’s bin directory (default: C:\Program Files\PostgreSQL\9.4\bin) to your PATH. For reference, see the paragraph "on Windows" in the Source Install / Prepare section: https://www.odoo.com/documentation/11.0/setup/install.html#id3 Note that you need to reboot Windows in case you are running Odoo as a Windows Service so that the process picks up this change in the system environment variables.

The other log snipped contains two more error messages. The first message is

psycopg2.InterfaceError: connection already closed

This may be caused by being the next statement after the failed dump/export. Or, this may be another symptom of the "instability" you are referring to. Generally, this kind of error only happens when long-running transactions are killed from database side (like for timeouts) and then still are used from the client.

To further examine this, please post another question with more details like: observed error messages, the postgres configuration and the Odoo configuration file.

The second message is

poplib.error_proto: b'-ERR [AUTH] Authentication failed.'

coming out of the odoo\addons\fetchmail\models\fetchmail.py. This indicates an issue with the username/password setting in the Email settings of your Odoo server. This has nothing to do with stability or the ability to export the database.

Upvotes: 3

Related Questions