Odoo数据库导出错误

时间:2018-07-15 08:34:31

标签: database odoo odoo-11

我在Windows 10中使用Odoo 11,这使其变得不稳定,因此,我决定从Linux启动它。

问题是,当我尝试从数据库管理器导出数据库时,它给了我500 Internal Server Error。有什么问题的想法吗?

这是日志:

  

2018-07-15 07:54:29,292 6920错误odoo2 odoo.addons.web.controllers.main:Database.backup       追溯(最近一次通话):         在find_pg_tool中的文件“ C:\ Program Files \ Odoo 11.0 \ server \ odoo \ tools \ misc.py”,第94行           返回哪个(名称,路径=路径)         文件“ C:\ Program Files \ Odoo 11.0 \ server \ odoo \ tools \ which.py​​”,行144,其中           引发IOError(ENOENT,'未找到%s'%(模式&X_OK和'command'或'file'),文件)       FileNotFoundError:找不到[Errno 2]命令:'pg_dump'

在处理上述异常期间,发生了另一个异常:

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 -

1 个答案:

答案 0 :(得分:3)

错误消息中有趣的部分是:

command not found: 'pg_dump'

这表示您需要将PostgreSQL的bin目录(默认:C:\Program Files\PostgreSQL\9.4\bin)添加到PATH中。 作为参考,请参见“源安装/准备”部分中的“在Windows上”段落:https://www.odoo.com/documentation/11.0/setup/install.html#id3请注意,如果您将Odoo作为Windows服务运行,则需要重新启动Windows,以便该过程在Windows中获取此更改。系统环境变量。

其他已删除的日志包含另外两个错误消息。 第一条消息是

psycopg2.InterfaceError: connection already closed

这可能是由于转储/导出失败后的下一条语句引起的。或者,这可能是您所指的“不稳定”的另一种症状。通常,这种错误仅在长时间运行的事务从数据库端被杀死(例如超时)然后仍从客户端使用时发生。

要进一步检查该问题,请发布另一个问题,其中包含更多详细信息,例如:观察到的错误消息,postgres配置和Odoo配置文件。

第二条消息是

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

来自odoo\addons\fetchmail\models\fetchmail.py。这表明Odoo服务器的“电子邮件”设置中的用户名/密码设置存在问题。这与稳定性或导出数据库的能力无关。