0

我正在使用 Windows 10、PostgreSQL 12、Python 3.7.5。我创建用户名odoo、密码odoo、创建数据库mydb

源代码是https://github.com/odoo/odoo/tree/aa0554d224337e1d966479a351a3ed059d297765

我运行命令

python odoo-bin -r odoo -w odoo --addons-path=addons --db-filter=mydb$

错误

E:\source_code\github.com\xxxxxxxx\odoo>python odoo-bin -r odoo -w odoo --addons-path=addons --db-filter=mydb$
2019-11-11 09:20:31,240 7372 INFO ? odoo: Odoo version 13.0
2019-11-11 09:20:31,240 7372 INFO ? odoo: addons paths: ['E:\\source_code\\github.com\\xxxxxxxx\\odoo\\odoo\\addons', 'c:\\users\\xxxxxxxx\\appdata\\local\\openerp s.a\\odoo\\addons\\13.0', 'e:\\source_code\\github.com\\xxxxxxxx\\odoo\\addons', 'e:\\source_code\\github.com\\xxxxxxxx\\odoo\\odoo\\addons']
2019-11-11 09:20:31,241 7372 INFO ? odoo: database: odoo@default:default
2019-11-11 09:20:31,397 7372 INFO ? odoo.addons.base.models.ir_actions_report: You need Wkhtmltopdf to print a pdf version of the reports.
2019-11-11 09:20:31,517 7372 INFO ? odoo.service.server: HTTP service (werkzeug) running on D1CMPS_VyDN.mptelecom.com:8069
2019-11-11 09:20:45,250 7372 INFO ? odoo.http: HTTP Configuring static files
2019-11-11 09:20:45,296 7372 INFO ? odoo.sql_db: Connection to the database failed
2019-11-11 09:20:45,299 7372 INFO ? werkzeug: 192.168.50.215 - - [11/Nov/2019 09:20:45] "GET / HTTP/1.1" 500 - 0 0.000 0.039
2019-11-11 09:20:45,333 7372 ERROR ? werkzeug: Error on request:
Traceback (most recent call last):
  File "C:\Program Files\Python37\lib\site-packages\werkzeug\serving.py", line 270, in run_wsgi
    execute(self.server.app)
  File "C:\Program Files\Python37\lib\site-packages\werkzeug\serving.py", line 258, in execute
    application_iter = app(environ, start_response)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\service\server.py", line 414, in app
    return self.app(e, s)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\service\wsgi_server.py", line 142, in application
    return application_unproxied(environ, start_response)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\service\wsgi_server.py", line 117, in application_unproxied
    result = odoo.http.root(environ, start_response)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\http.py", line 1281, in __call__
    return self.dispatch(environ, start_response)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\http.py", line 1251, in __call__
    return self.app(environ, start_wrapped)
  File "C:\Program Files\Python37\lib\site-packages\werkzeug\wsgi.py", line 766, in __call__
    return self.app(environ, start_response)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\http.py", line 1415, in dispatch
    self.setup_db(httprequest)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\http.py", line 1338, in setup_db
    httprequest.session.db = db_monodb(httprequest)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\http.py", line 1499, in db_monodb
    dbs = db_list(True, httprequest)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\http.py", line 1466, in db_list
    dbs = odoo.service.db.list_dbs(force)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\service\db.py", line 378, in list_dbs
    with closing(db.cursor()) as cr:
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\sql_db.py", line 649, in cursor
    return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\sql_db.py", line 186, in __init__
    self._cnx = pool.borrow(dsn)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\sql_db.py", line 532, in _locked
    return fun(self, *args, **kwargs)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\sql_db.py", line 600, in borrow
    **connection_info)
  File "C:\Program Files\Python37\lib\site-packages\psycopg2\__init__.py", line 126, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  role "odoo" is not permitted to log in - - -
2019-11-11 09:20:45,442 7372 INFO ? odoo.sql_db: Connection to the database failed
2019-11-11 09:20:45,443 7372 INFO ? werkzeug: 192.168.50.215 - - [11/Nov/2019 09:20:45] "GET /favicon.ico HTTP/1.1" 500 - 0 0.000 0.057
2019-11-11 09:20:45,449 7372 ERROR ? werkzeug: Error on request:
Traceback (most recent call last):
  File "C:\Program Files\Python37\lib\site-packages\werkzeug\serving.py", line 270, in run_wsgi
    execute(self.server.app)
  File "C:\Program Files\Python37\lib\site-packages\werkzeug\serving.py", line 258, in execute
    application_iter = app(environ, start_response)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\service\server.py", line 414, in app
    return self.app(e, s)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\service\wsgi_server.py", line 142, in application
    return application_unproxied(environ, start_response)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\service\wsgi_server.py", line 117, in application_unproxied
    result = odoo.http.root(environ, start_response)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\http.py", line 1281, in __call__
    return self.dispatch(environ, start_response)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\http.py", line 1251, in __call__
    return self.app(environ, start_wrapped)
  File "C:\Program Files\Python37\lib\site-packages\werkzeug\wsgi.py", line 766, in __call__
    return self.app(environ, start_response)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\http.py", line 1415, in dispatch
    self.setup_db(httprequest)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\http.py", line 1338, in setup_db
    httprequest.session.db = db_monodb(httprequest)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\http.py", line 1499, in db_monodb
    dbs = db_list(True, httprequest)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\http.py", line 1466, in db_list
    dbs = odoo.service.db.list_dbs(force)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\service\db.py", line 378, in list_dbs
    with closing(db.cursor()) as cr:
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\sql_db.py", line 649, in cursor
    return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\sql_db.py", line 186, in __init__
    self._cnx = pool.borrow(dsn)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\sql_db.py", line 532, in _locked
    return fun(self, *args, **kwargs)
  File "E:\source_code\github.com\xxxxxxxx\odoo\odoo\sql_db.py", line 600, in borrow
    **connection_info)
  File "C:\Program Files\Python37\lib\site-packages\psycopg2\__init__.py", line 126, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  role "odoo" is not permitted to log in - - -

如何从源代码启动 Odoo 13 成功?

4

3 回答 3

1

创建 PostgreSQL 用户,请执行以下步骤:

  1. 将 PostgreSQL 的bin目录(默认为:)添加C:\Program Files\PostgreSQL\<version>\bin到您的PATH.
  2. 使用 pg admin gui 创建一个带有密码的 postgres 用户:

    • 打开pgAdminIII
    • 双击服务器以创建连接。
    • 选择 Edit ‣ New Object ‣ New Login Role。
    • 在角色名称字段中输入用户名(例如odoo)。
    • 打开定义选项卡并输入密码(例如odoo),然后单击确定

于 2019-11-11T12:11:57.053 回答
1

我认为您需要配置数据库以信任您的 IP 地址:

进行以下更改pg_hba.conf

# IPv4 local connections:
host all all 127.0.0.1/32   trust
host all all MY_IP/24 trust

也见这个

于 2019-11-11T10:13:44.247 回答
0

odoo 13 一个默认用户名 odoo,该用户具有 postgress 它使用最近创建的数据库。

您可以在配置文件中传递数据库配置

odoo 13 /debian/odoo.conf

[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = False
db_port = False
db_user = odoo
db_password = False
;addons_path = /usr/lib/python3/dist-packages/odoo/addons

您可以设置数据库主机端口用户密码并使用它

于 2020-01-29T11:28:41.887 回答