centOS7安装odoo14社区版,所有依赖和包都安装好了,启动时报错,无法创建数据库
-
- 配置文件
vi /opt/odoo/odoo14/odoo14.conf
[options]
; This is the password that allows database operations:
admin_passwd = Longshine01
db_host = False
db_port = False
db_user = odoo
db_password = False
xmlrpc_port = 8069
; longpolling_port = 8072
logfile = /opt/odoo/odoo14/odoo14.log
logrotate = True
addons_path = /opt/odoo/odoo14/odoo/addons - odoo14.service
vi /usr/lib/systemd/system/odoo14.service
[Unit]
Description=odoo14
Requires=postgresql-12.service
After=network.target[Service]
Type=simple
SyslogIdentifier=odoo
PermissionsStartOnly=true
User=odoo
Group=root
ExecStart=/opt/odoo/odoo14/odoo14-venv/bin/python3 /opt/odoo/odoo14/odoo-bin -c /opt/odoo/odoo14/odoo14.conf
StandardOutput=journal+console
[Install]
WantedBy=multi-user.target- 启动报错
[root@instance-20240327-1336 /opt/odoo/odoo14]$./odoo-bin -d odoo-test -i base
Running as user 'root' is a security risk.
2024-04-15 13:36:20,766 587 INFO ? odoo: Odoo version 14.0+e-20210211
2024-04-15 13:36:20,766 587 INFO ? odoo: addons paths: ['/opt/odoo/odoo14/odoo/addons', '/root/.local/share/Odoo/addons/14.0']
2024-04-15 13:36:20,766 587 INFO ? odoo: database: default@default:default
2024-04-15 13:36:21,181 587 INFO ? odoo.addons.base.models.ir_actions_report: You need Wkhtmltopdf to print a pdf version of the reports.
Exception in thread odoo.service.httpd:
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.9/threading.py", line 950, in _bootstrap_inner
self.run()
File "/usr/local/python3/lib/python3.9/threading.py", line 888, in run
self._target(*self._args, **self._kwargs)
File "/opt/odoo/odoo14/odoo/service/server.py", line 441, in http_thread
self.httpd = ThreadedWSGIServerReloadable(self.interface, self.port, app)
File "/opt/odoo/odoo14/odoo/service/server.py", line 149, in init
super(ThreadedWSGIServerReloadable, self).init(host, port, app,
File "/usr/local/python3/lib/python3.9/site-packages/werkzeug/serving.py", line 740, in init
HTTPServer.init(self, server_address, handler)
File "/usr/local/python3/lib/python3.9/socketserver.py", line 452, in init
self.server_bind()
File "/opt/odoo/odoo14/odoo/service/server.py", line 165, in server_bind
super(ThreadedWSGIServerReloadable, self).server_bind()
File "/usr/local/python3/lib/python3.9/http/server.py", line 138, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/local/python3/lib/python3.9/socketserver.py", line 466, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
2024-04-15 13:36:21,659 587 INFO ? odoo.modules.loading: init db
2024-04-15 13:36:26,267 587 INFO odoo-test odoo.modules.loading: loading 1 modules...
2024-04-15 13:36:26,267 587 INFO odoo-test odoo.modules.loading: Loading module base (1/1)
2024-04-15 13:36:26,569 587 INFO odoo-test odoo.modules.registry: module base: creating or updating database tables
2024-04-15 13:36:29,976 587 INFO odoo-test odoo.models: Storing computed values of ir.module.module.menus_by_module
2024-04-15 13:36:29,976 587 INFO odoo-test odoo.models: Storing computed values of ir.module.module.reports_by_module
2024-04-15 13:36:29,976 587 INFO odoo-test odoo.models: Storing computed values of ir.module.module.views_by_module
2024-04-15 13:36:29,979 587 INFO odoo-test odoo.models: Storing computed values of res.partner.display_name
2024-04-15 13:36:29,980 587 INFO odoo-test odoo.models: Storing computed values of res.partner.partner_share
2024-04-15 13:36:29,980 587 INFO odoo-test odoo.models: Storing computed values of res.partner.commercial_partner_id
2024-04-15 13:36:29,980 587 INFO odoo-test odoo.models: Storing computed values of res.partner.commercial_company_name
2024-04-15 13:36:29,981 587 INFO odoo-test odoo.models: Storing computed values of res.currency.decimal_places
2024-04-15 13:36:29,984 587 INFO odoo-test odoo.models: Storing computed values of res.company.logo_web
2024-04-15 13:36:29,984 587 INFO odoo-test odoo.models: Storing computed values of res.company.email
2024-04-15 13:36:29,984 587 INFO odoo-test odoo.models: Storing computed values of res.company.phone
2024-04-15 13:36:30,030 587 INFO odoo-test odoo.models: Storing computed values of res.users.share
2024-04-15 13:36:32,568 587 INFO odoo-test odoo.modules.loading: loading base/data/res.lang.csv
2024-04-15 13:36:32,864 587 INFO odoo-test odoo.modules.loading: loading base/data/res_lang_data.xml
2024-04-15 13:36:32,889 587 INFO odoo-test odoo.modules.loading: loading base/data/res_partner_data.xml
2024-04-15 13:36:33,136 587 INFO odoo-test odoo.modules.loading: loading base/data/res_company_data.xml
2024-04-15 13:36:33,154 587 INFO odoo-test odoo.modules.loading: loading base/data/res_users_data.xml
2024-04-15 13:36:33,443 587 INFO odoo-test odoo.modules.loading: loading base/data/report_paperformat_data.xml
2024-04-15 13:36:33,460 587 INFO odoo-test odoo.modules.loading: loading base/data/res_currency_data.xml
2024-04-15 13:36:34,456 587 INFO odoo-test odoo.modules.loading: loading base/data/res_country_data.xml
2024-04-15 13:36:35,967 587 INFO odoo-test odoo.modules.loading: loading base/data/ir_demo_data.xml
2024-04-15 13:36:36,276 587 INFO odoo-test odoo.modules.loading: loading base/security/base_groups.xml
2024-04-15 13:36:36,770 587 INFO odoo-test odoo.modules.loading: loading base/security/base_security.xml
2024-04-15 13:36:37,250 587 INFO odoo-test odoo.modules.loading: loading base/views/base_menus.xml
2024-04-15 13:36:37,529 587 INFO odoo-test odoo.modules.loading: loading base/views/decimal_precision_views.xml
2024-04-15 13:36:37,569 587 INFO odoo-test odoo.modules.loading: loading base/views/res_config_views.xml
2024-04-15 13:36:37,670 587 INFO odoo-test odoo.modules.loading: loading base/data/res.country.state.csv
2024-04-15 13:36:43,833 587 INFO odoo-test odoo.modules.loading: loading base/views/ir_actions_views.xml
2024-04-15 13:36:44,528 587 ERROR odoo-test odoo.sql_db: bad query: UPDATE ir_module_module SET state='installed' WHERE state IN ('to remove', 'to upgrade')
ERROR: relation "ir_module_module" does not exist
LINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN...
^
2024-04-15 13:36:44,528 587 ERROR odoo-test odoo.modules.registry: Failed to load registry
2024-04-15 13:36:44,529 587 CRITICAL odoo-test odoo.service.server: Failed to initialize databaseodoo-test
.
Traceback (most recent call last):
File "/opt/odoo/odoo14/odoo/tools/convert.py", line 677, in _tag_root
f(rec)
File "/opt/odoo/odoo14/odoo/tools/convert.py", line 580, in _tag_record
record = model._load_records([data], self.mode == 'update')
File "/opt/odoo/odoo14/odoo/models.py", line 4185, in _load_records
records = self._load_records_create([data['values'] for data in to_create])
File "/opt/odoo/odoo14/odoo/models.py", line 4114, in _load_records_create
return self.create(values)
File "/usr/local/python3/lib/python3.9/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/opt/odoo/odoo14/odoo/api.py", line 345, in _model_create_multi
return create(self, arg)
File "/opt/odoo/odoo14/odoo/addons/base/models/ir_actions.py", line 46, in create
res = super(IrActions, self).create(vals_list)
File "/usr/local/python3/lib/python3.9/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/opt/odoo/odoo14/odoo/api.py", line 345, in _model_create_multi
return create(self, arg)
File "/opt/odoo/odoo14/odoo/addons/base/models/ir_fields.py", line 508, in create
recs = super().create(vals_list)
File "/usr/local/python3/lib/python3.9/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/opt/odoo/odoo14/odoo/api.py", line 345, in _model_create_multi
return create(self, arg)
File "/opt/odoo/odoo14/odoo/models.py", line 3842, in create
records = self._create(data_list)
File "/opt/odoo/odoo14/odoo/models.py", line 4015, in _create
records._validate_fields(name for data in data_list for name in data['stored'])
File "/opt/odoo/odoo14/odoo/models.py", line 1249, in _validate_fields
check(self)
File "/opt/odoo/odoo14/odoo/addons/base/models/ir_actions.py", line 437, in _check_python_code
raise ValidationError(msg)
odoo.exceptions.ValidationError: forbidden opcode(s) in "config = model.next() or {}\nif config.get('type') not in ('ir.actions.act_window_close',):\n action = config": CONTAINS_OPDuring handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo/odoo14/odoo/modules/registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/opt/odoo/odoo14/odoo/modules/loading.py", line 394, in load_modules
loaded_modules, processed_modules = load_module_graph(
File "/opt/odoo/odoo14/odoo/modules/loading.py", line 221, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/opt/odoo/odoo14/odoo/modules/loading.py", line 69, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/opt/odoo/odoo14/odoo/tools/convert.py", line 733, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate)
File "/opt/odoo/odoo14/odoo/tools/convert.py", line 799, in convert_xml_import
obj.parse(doc.getroot())
File "/opt/odoo/odoo14/odoo/tools/convert.py", line 719, in parse
self._tag_root(de)
File "/opt/odoo/odoo14/odoo/tools/convert.py", line 681, in _tag_root
raise ParseError('while parsing %s:%s, near\n%s' % (
odoo.tools.convert.ParseError: while parsing /opt/odoo/odoo14/odoo/addons/base/views/ir_actions_views.xml:457, near
Config: Run Remaining Action Todo
ir.actions.server
code
config = model.next() or {}
if config.get('type') not in ('ir.actions.act_window_close',):
action = config
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/odoo/odoo14/odoo/service/server.py", line 1198, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "/opt/odoo/odoo14/odoo/modules/registry.py", line 91, in new
odoo.modules.reset_modules_state(db_name)
File "/opt/odoo/odoo14/odoo/modules/loading.py", line 583, in reset_modules_state
cr.execute(
File "/usr/local/python3/lib/python3.9/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/opt/odoo/odoo14/odoo/sql_db.py", line 101, in check
return f(self, *args, **kwargs)
File "/opt/odoo/odoo14/odoo/sql_db.py", line 298, in execute
res = self._obj.execute(query, params)
psycopg2.errors.UndefinedTable: relation "ir_module_module" does not exist
LINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN... - 配置文件
-
至少有两个错误:
-
addons目录,你这里仅仅包含了
base
基本模块,Odoo的功能模块应该在/opt/odoo/odoo14/addons
目录下
-
监听端口冲突:
-