Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

Cannot initialize DB in Odoo12

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
developmentinstallationdatabaseodoo12
2 Besvarelser
24889 Visninger
Avatar
Jorge

Hi, when I try to initialize the DB I get the following errors:

$ python odoo-bin --addons-path=addons  -i base

....
2021-07-14 04:46:48,122 6452 INFO borch odoo.modules.loading: loading base/data/res.lang.csv 2021-07-14 04:46:48,185 6452 INFO borch odoo.modules.loading: loading base/data/res_lang_data.xml 2021-07-14 04:46:48,195 6452 INFO borch odoo.modules.loading: loading base/data/res_partner_data.xml 2021-07-14 04:46:48,339 6452 INFO borch odoo.modules.loading: loading base/data/res_company_data.xml 2021-07-14 04:46:48,359 6452 INFO borch odoo.modules.loading: loading base/data/res_users_data.xml 2021-07-14 04:46:48,570 6452 INFO borch odoo.modules.loading: loading base/data/report_paperformat_data.xml 2021-07-14 04:46:48,578 6452 INFO borch odoo.modules.loading: loading base/data/res_currency_data.xml 2021-07-14 04:46:48,981 6452 INFO borch odoo.modules.loading: loading base/data/res_country_data.xml 2021-07-14 04:46:50,597 6452 INFO borch odoo.modules.loading: loading base/data/ir_demo_data.xml 2021-07-14 04:46:50,625 6452 ERROR borch 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 existLINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN... ^ 2021-07-14 04:46:50,625 6452 ERROR borch odoo.modules.registry: Failed to load registry Traceback (most recent call last): File "/home/borch/odoo/odoo/models.py", line 1128, in _validate_fields check(self) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 343, in _check_xml view_arch = etree.fromstring(view.arch.encode('utf-8')) File "src/lxml/etree.pyx", line 3213, in lxml.etree.fromstring File "src/lxml/parser.pxi", line 1877, in lxml.etree._parseMemoryDocument File "src/lxml/parser.pxi", line 1765, in lxml.etree._parseDoc File "src/lxml/parser.pxi", line 1127, in lxml.etree._BaseParser._parseDoc File "src/lxml/parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc File "src/lxml/parser.pxi", line 711, in lxml.etree._handleParseResult File "src/lxml/parser.pxi", line 640, in lxml.etree._raiseParseError File "", line 24lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 24, column 9
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/borch/odoo/odoo/tools/convert.py", line 758, in parse self._tags[rec.tag](rec, de, mode=mode) File "/home/borch/odoo/odoo/tools/convert.py", line 663, in _tag_record record = model.with_context(rec_context)._load_records([data], self.mode == 'update') File "/home/borch/odoo/odoo/models.py", line 3910, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/home/borch/odoo/odoo/models.py", line 3824, in _load_records_create return self.create(values) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create return super(View, self).create(vals_list) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/models.py", line 3641, in create fields[0].determine_inverse(batch_recs) File "/home/borch/odoo/odoo/fields.py", line 1200, in determine_inverse getattr(records, self.inverse)() File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch view.write(data) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 445, in write res = super(View, self).write(self._compute_defaults(vals)) File "/home/borch/odoo/odoo/models.py", line 3366, in write self._write(store_vals) File "/home/borch/odoo/odoo/models.py", line 3502, in _write self._validate_fields(vals) File "/home/borch/odoo/odoo/models.py", line 1132, in _validate_fields raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))odoo.exceptions.ValidationError: ('Error while validating constraint\n\nExtra content at the end of the document, line 24, column 9', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/borch/odoo/odoo/modules/registry.py", line 86, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/home/borch/odoo/odoo/modules/loading.py", line 360, in load_modules loaded_modules, processed_modules = load_module_graph( File "/home/borch/odoo/odoo/modules/loading.py", line 222, in load_module_graph load_data(cr, idref, mode, kind='data', package=package, report=report) File "/home/borch/odoo/odoo/modules/loading.py", line 68, in load_data tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report) File "/home/borch/odoo/odoo/tools/convert.py", line 802, in convert_file convert_xml_import(cr, module, fp, idref, mode, noupdate, report) File "/home/borch/odoo/odoo/tools/convert.py", line 865, in convert_xml_import obj.parse(doc.getroot(), mode=mode) File "/home/borch/odoo/odoo/tools/convert.py", line 761, in parse pycompat.reraise( File "/home/borch/odoo/odoo/tools/pycompat.py", line 86, in reraise raise value.with_traceback(tb) File "/home/borch/odoo/odoo/tools/convert.py", line 758, in parse self._tags[rec.tag](rec, de, mode=mode) File "/home/borch/odoo/odoo/tools/convert.py", line 663, in _tag_record record = model.with_context(rec_context)._load_records([data], self.mode == 'update') File "/home/borch/odoo/odoo/models.py", line 3910, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/home/borch/odoo/odoo/models.py", line 3824, in _load_records_create return self.create(values) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create return super(View, self).create(vals_list) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/models.py", line 3641, in create fields[0].determine_inverse(batch_recs) File "/home/borch/odoo/odoo/fields.py", line 1200, in determine_inverse getattr(records, self.inverse)() File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch view.write(data) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 445, in write res = super(View, self).write(self._compute_defaults(vals)) File "/home/borch/odoo/odoo/models.py", line 3366, in write self._write(store_vals) File "/home/borch/odoo/odoo/models.py", line 3502, in _write self._validate_fields(vals) File "/home/borch/odoo/odoo/models.py", line 1132, in _validate_fields raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))odoo.tools.convert.ParseError: "Error while validating constraint
Extra content at the end of the document, line 24, column 9None" while parsing /home/borch/odoo/odoo/addons/base/data/ir_demo_data.xml:9, near ir.demo.form ir.demo

  Danger Zone

Demo data should only be used on test databases! Once they are loaded, they cannot be removed!

Please confirm that you want to irreversibly make this database a demo database.



During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/borch/odoo/odoo/modules/registry.py", line 88, in new odoo.modules.reset_modules_state(db_name) File "/home/borch/odoo/odoo/modules/loading.py", line 556, in reset_modules_state cr.execute( File "/home/borch/odoo/odoo/sql_db.py", line 148, in wrapper return f(self, *args, **kwargs) File "/home/borch/odoo/odoo/sql_db.py", line 225, in execute res = self._obj.execute(query, params)psycopg2.errors.UndefinedTable: relation "ir_module_module" does not existLINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN... ^
2021-07-14 04:46:50,627 6452 CRITICAL borch odoo.service.server: Failed to initialize database `borch`. Traceback (most recent call last): File "/home/borch/odoo/odoo/models.py", line 1128, in _validate_fields check(self) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 343, in _check_xml view_arch = etree.fromstring(view.arch.encode('utf-8')) File "src/lxml/etree.pyx", line 3213, in lxml.etree.fromstring File "src/lxml/parser.pxi", line 1877, in lxml.etree._parseMemoryDocument File "src/lxml/parser.pxi", line 1765, in lxml.etree._parseDoc File "src/lxml/parser.pxi", line 1127, in lxml.etree._BaseParser._parseDoc File "src/lxml/parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc File "src/lxml/parser.pxi", line 711, in lxml.etree._handleParseResult File "src/lxml/parser.pxi", line 640, in lxml.etree._raiseParseError File "", line 24lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 24, column 9
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/borch/odoo/odoo/tools/convert.py", line 758, in parse self._tags[rec.tag](rec, de, mode=mode) File "/home/borch/odoo/odoo/tools/convert.py", line 663, in _tag_record record = model.with_context(rec_context)._load_records([data], self.mode == 'update') File "/home/borch/odoo/odoo/models.py", line 3910, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/home/borch/odoo/odoo/models.py", line 3824, in _load_records_create return self.create(values) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create return super(View, self).create(vals_list) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/models.py", line 3641, in create fields[0].determine_inverse(batch_recs) File "/home/borch/odoo/odoo/fields.py", line 1200, in determine_inverse getattr(records, self.inverse)() File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch view.write(data) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 445, in write res = super(View, self).write(self._compute_defaults(vals)) File "/home/borch/odoo/odoo/models.py", line 3366, in write self._write(store_vals) File "/home/borch/odoo/odoo/models.py", line 3502, in _write self._validate_fields(vals) File "/home/borch/odoo/odoo/models.py", line 1132, in _validate_fields raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))odoo.exceptions.ValidationError: ('Error while validating constraint\n\nExtra content at the end of the document, line 24, column 9', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/borch/odoo/odoo/modules/registry.py", line 86, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/home/borch/odoo/odoo/modules/loading.py", line 360, in load_modules loaded_modules, processed_modules = load_module_graph( File "/home/borch/odoo/odoo/modules/loading.py", line 222, in load_module_graph load_data(cr, idref, mode, kind='data', package=package, report=report) File "/home/borch/odoo/odoo/modules/loading.py", line 68, in load_data tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report) File "/home/borch/odoo/odoo/tools/convert.py", line 802, in convert_file convert_xml_import(cr, module, fp, idref, mode, noupdate, report) File "/home/borch/odoo/odoo/tools/convert.py", line 865, in convert_xml_import obj.parse(doc.getroot(), mode=mode) File "/home/borch/odoo/odoo/tools/convert.py", line 761, in parse pycompat.reraise( File "/home/borch/odoo/odoo/tools/pycompat.py", line 86, in reraise raise value.with_traceback(tb) File "/home/borch/odoo/odoo/tools/convert.py", line 758, in parse self._tags[rec.tag](rec, de, mode=mode) File "/home/borch/odoo/odoo/tools/convert.py", line 663, in _tag_record record = model.with_context(rec_context)._load_records([data], self.mode == 'update') File "/home/borch/odoo/odoo/models.py", line 3910, in _load_records records = self._load_records_create([data['values'] for data in to_create]) File "/home/borch/odoo/odoo/models.py", line 3824, in _load_records_create return self.create(values) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create return super(View, self).create(vals_list) File "", line 2, in create File "/home/borch/odoo/odoo/api.py", line 462, in _model_create_multi return create(self, arg) File "/home/borch/odoo/odoo/models.py", line 3641, in create fields[0].determine_inverse(batch_recs) File "/home/borch/odoo/odoo/fields.py", line 1200, in determine_inverse getattr(records, self.inverse)() File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch view.write(data) File "/home/borch/odoo/odoo/addons/base/models/ir_ui_view.py", line 445, in write res = super(View, self).write(self._compute_defaults(vals)) File "/home/borch/odoo/odoo/models.py", line 3366, in write self._write(store_vals) File "/home/borch/odoo/odoo/models.py", line 3502, in _write self._validate_fields(vals) File "/home/borch/odoo/odoo/models.py", line 1132, in _validate_fields raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))odoo.tools.convert.ParseError: "Error while validating constraint
Extra content at the end of the document, line 24, column 9None" while parsing /home/borch/odoo/odoo/addons/base/data/ir_demo_data.xml:9, near ir.demo.form ir.demo
  Danger Zone

Demo data should only be used on test databases! Once they are loaded, they cannot be removed!

Please confirm that you want to irreversibly make this database a demo database.



During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/borch/odoo/odoo/service/server.py", line 1164, in preload_registries registry = Registry.new(dbname, update_module=update_module) File "/home/borch/odoo/odoo/modules/registry.py", line 88, in new odoo.modules.reset_modules_state(db_name) File "/home/borch/odoo/odoo/modules/loading.py", line 556, in reset_modules_state cr.execute( File "/home/borch/odoo/odoo/sql_db.py", line 148, in wrapper return f(self, *args, **kwargs) File "/home/borch/odoo/odoo/sql_db.py", line 225, in execute res = self._obj.execute(query, params)psycopg2.errors.UndefinedTable: relation "ir_module_module" does not existLINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN... ^

I have already created the database using the following commands:

$ sudo -u postgres createuser -s $USER
$ createdb $USER

Instructions from here: https://www.odoo.com/documentation/12.0/administration/install.html#id7


I can connect with the database without any issues:
$ psql 

psql (11.12 (Debian 11.12-0+deb10u1))Type "help" for help.
borch=# 

Already installed all requirements. Is there something I am missing? Thanks.


0
Avatar
Kassér
Jorge
Forfatter

Hi Rajprasad, I recreated the DB and tried to initialize again but I got the same problem:

(.venv) borch@g4560:~/odoo$ dropdb borch

(.venv) borch@g4560:~/odoo$ createdb odoodb

(.venv) borch@g4560:~/odoo$ psql

psql: FATAL: database "borch" does not exist

(.venv) borch@g4560:~/odoo$ psql odoodb

psql (11.12 (Debian 11.12-0+deb10u1))

Type "help" for help.

odoodb=# \l

odoodb=# exit

(.venv) borch@g4560:~/odoo$ python3 odoo-bin --addons-path=addons -d odoodb -i base

es.loading: loading base/data/ir_demo_data.xml

2021-07-14 14:14:19,452 14647 ERROR odoodb 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...

^

2021-07-14 14:14:19,452 14647 ERROR odoodb odoo.modules.registry: Failed to load registry

Avatar
Rajprasad Joshi
Bedste svar

Hi Jorge,

Try with the below commands:
1) Create a new database:
    createdb #database name
2) Run using python3 instead of python and add newly created db in terminal
    python3 odoo-bin --addons-path=addons  -d #database name -i base

Regards,
RPJ

4
Avatar
Kassér
Avatar
Mustaq Ahmed
Bedste svar

The working configuration for ODOO14 docker compose is as follows

docker-compose:::

version: '2'
services:
web:
image: odoo:14.0
depends_on:
- db
ports:
- "8069:8069"
volumes:
- odoo-web-data:/var/lib/odoo
- ./config:/etc/odoo
- ./addons:/mnt/extra-addons
db:
image: postgres:10
environment:
- POSTGRES_PASSWORD=odoo
- POSTGRES_USER=odoo
- POSTGRES_DB=odoodb
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- odoo-db-data:/var/lib/postgresql/data/pgdata
volumes:
odoo-web-data:
odoo-db-data:


odoo.conf in /config folder

[options]
admin_passwd = yoursecret
db_host = db
db_name = odoodb
db_port = 5432
db_user = odoo
db_password = odoo
addons_path = /mnt/extra-addons,/mnt/enterprise
proxy_mode = True
data_dir = /var/lib/odoo

0
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
Odoo OpenERP Server Error Traceback (most recent call last):
development installation database odoo8
Avatar
0
jun. 16
11516
How to reset the development database Løst
development database
Avatar
Avatar
Avatar
2
aug. 25
3074
how to install sassc? Løst
installation odoo12
Avatar
Avatar
Avatar
Avatar
Avatar
12
jul. 24
81157
Restore backup to postgresql for odoo
development database pgadmin
Avatar
0
nov. 24
50
Database selector for on-premises instance first setup
development setup database
Avatar
0
apr. 22
109
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now