OpenUpgrade icon indicating copy to clipboard operation
OpenUpgrade copied to clipboard

[15.0 -> 16.0] Cannot load the web interface after upgrade

Open Saphar opened this issue 10 months ago • 2 comments

Module

Assuming the problem is with the web module.

Describe the bug

I am trying to upgrade my database from 12.0 to the latest. I managed to climb up until 15.0 and seemingly it is working well, but there is no way to make it work on 16.0. After any attempt to upgrade, even running the script without any errors, I always have issues loading the web interface. First there were problems with the "assets", these errors I detected in the logs already and seemingly were caused by upgrade issues with other module. Upon fixing these I was able to upgrade to version 16.0 without any errors. Then I updated all the installed modules. But I cannot get past the login screen. After login it tries to load the /web and it fails, in the console I see the error message "odoo is not defined". It happens even if I upgrade an empty database or if I create an empty database on version 16.0.

To Reproduce

Affected versions: 16.0

Steps to reproduce the behavior:

  1. Upgrade from 15.0 to 16.0

Saphar avatar Feb 12 '25 15:02 Saphar

Dear @Saphar , @rvalyi , @ovnicraft , @azmeuk , @pniederlag

You are lucky to get script running at the end.

From my side, I still have two erros and can't figured it out.

Maybe you could highlight my path in this upgrade process from 15.0 to 16.0

  1. python3 ./odoo-bin -c /opt/odoo/16.0/odoo.conf -d mydatabase --update=all --load=base,web,openupgrade_framework --stop-after-init

  2. odoo.conf I forced debug_sql

  3. Logs eroor : psycopg2.errors.InvalidDatetimeFormat: invalid input syntax for type timestamp: ""

2025-03-04T22:43:56.120755+01:00 odoo16 Odoo Server 16.0:myodoo.com:ERROR:odoo.modules.registry:Failed to load registry#012Traceback (most recent call last):#012 File "/opt/odoo/16.0/odoo/odoo/modules/registry.py", line 87, in new#012 odoo.modules.load_modules(registry, force_demo, status, update_module)#012 File "/opt/odoo/16.0/odoo/odoo/modules/loading.py", line 485, in load_modules#012 processed_modules += load_marked_modules(cr, graph,#012 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#012 File "/opt/odoo/16.0/odoo/odoo/modules/loading.py", line 373, in load_marked_modules#012 loaded, processed = load_module_graph(#012 ^^^^^^^^^^^^^^^^^^#012 File "/opt/odoo/16.0/odoo/odoo/modules/loading.py", line 209, in load_module_graph#012 registry.init_models(cr, model_names, {'module': package.name}, new_install)#012 File "/opt/odoo/16.0/odoo/odoo/modules/registry.py", line 526, in init_models#012 model._auto_init()#012 File "/opt/odoo/16.0/odoo/odoo/models.py", line 2614, in _auto_init#012 new = field.update_db(self, columns)#012 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#012 File "/opt/odoo/16.0/odoo/odoo/fields.py", line 1007, in update_db#012 self.update_db_column(model, column)#012 File "/opt/odoo/16.0/odoo/odoo/fields.py", line 1043, in update_db_column#012 self._convert_db_column(model, column)#012 File "/opt/odoo/16.0/odoo/odoo/fields.py", line 1047, in _convert_db_column#012 sql.convert_column(model._cr, model._table, self.name, self.column_type[1])#012 File "/opt/odoo/16.0/odoo/odoo/tools/sql.py", line 128, in convert_column#012 _convert_column(cr, tablename, columnname, columntype, using)#012 File "/opt/odoo/16.0/odoo/odoo/tools/sql.py", line 147, in _convert_column#012 cr.execute(query, log_exceptions=False)#012 File "/opt/odoo/16.0/odoo/odoo/sql_db.py", line 321, in execute#012 res = self._obj.execute(query, params)#012 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#012psycopg2.errors.InvalidDatetimeFormat: invalid input syntax for type timestamp: ""

2025-03-04T22:43:56.122686+01:00 odoo16 Odoo Server 16.0:myodoo.com:CRITICAL:odoo.service.server:Failed to initialize database myodoo.com.#012Traceback (most recent call last):#012 File "/opt/odoo/16.0/odoo/odoo/service/server.py", line 1323, in preload_registries#012 registry = Registry.new(dbname, update_module=update_module)#012 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#012 File "", line 2, in new#012 File "/opt/odoo/16.0/odoo/odoo/tools/func.py", line 87, in locked#012 return func(inst, *args, **kwargs)#012 ^^^^^^^^^^^^^^^^^^^^^^^^^^^#012 File "/opt/odoo/16.0/odoo/odoo/modules/registry.py", line 87, in new#012 odoo.modules.load_modules(registry, force_demo, status, update_module)#012 File "/opt/odoo/16.0/odoo/odoo/modules/loading.py", line 485, in load_modules#012 processed_modules += load_marked_modules(cr, graph,#012 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#012 File "/opt/odoo/16.0/odoo/odoo/modules/loading.py", line 373, in load_marked_modules#012 loaded, processed = load_module_graph(#012 ^^^^^^^^^^^^^^^^^^#012 File "/opt/odoo/16.0/odoo/odoo/modules/loading.py", line 209, in load_module_graph#012 registry.init_models(cr, model_names, {'module': package.name}, new_install)#012 File "/opt/odoo/16.0/odoo/odoo/modules/registry.py", line 526, in init_models#012 model._auto_init()#012 File "/opt/odoo/16.0/odoo/odoo/models.py", line 2614, in _auto_init#012 new = field.update_db(self, columns)#012 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#012 File "/opt/odoo/16.0/odoo/odoo/fields.py", line 1007, in update_db#012 self.update_db_column(model, column)#012 File "/opt/odoo/16.0/odoo/odoo/fields.py", line 1043, in update_db_column#012 self._convert_db_column(model, column)#012 File "/opt/odoo/16.0/odoo/odoo/fields.py", line 1047, in _convert_db_column#012 sql.convert_column(model._cr, model._table, self.name, self.column_type[1])#012 File "/opt/odoo/16.0/odoo/odoo/tools/sql.py", line 128, in convert_column#012 _convert_column(cr, tablename, columnname, columntype, using)#012 File "/opt/odoo/16.0/odoo/odoo/tools/sql.py", line 147, in _convert_column#012 cr.execute(query, log_exceptions=False)#012 File "/opt/odoo/16.0/odoo/odoo/sql_db.py", line 321, in execute#012 res = self._obj.execute(query, params)#012 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#012psycopg2.errors.InvalidDatetimeFormat: invalid input syntax for type timestamp: ""

2025-03-04T22:43:56.122995+01:00 odoo16 Odoo Server 16.0:myodoo.com:INFO:odoo.service.server:Stopping gracefully

Thanks if you could help me

Best Regards,

yboujraf avatar Mar 04 '25 21:03 yboujraf

Dear @Saphar , @rvalyi , @ovnicraft , @azmeuk , @pniederlag

You are lucky to get script running at the end.

From my side, I still have two erros and can't figured it out.

Maybe you could highlight my path in this upgrade process from 15.0 to 16.0

  1. python3 ./odoo-bin -c /opt/odoo/16.0/odoo.conf -d mydatabase --update=all --load=base,web,openupgrade_framework --stop-after-init
  2. odoo.conf I forced debug_sql
  3. Logs eroor : psycopg2.errors.InvalidDatetimeFormat: invalid input syntax for type timestamp: ""

2025-03-04T22:43:56.120755+01:00 odoo16 Odoo Server 16.0:myodoo.com:ERROR:odoo.modules.registry:Failed to load registry#012Traceback (most recent call last):#12 File "/opt/odoo/16.0/odoo/odoo/modules/registry.py", line 87, in new#012 odoo.modules.load_modules(registry, force_demo, status, update_module)#12 File "/opt/odoo/16.0/odoo/odoo/modules/loading.py", line 485, in load_modules#012 processed_modules += load_marked_modules(cr, graph,#12 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#12 File "/opt/odoo/16.0/odoo/odoo/modules/loading.py", line 373, in load_marked_modules#012 loaded, processed = load_module_graph(#12 ^^^^^^^^^^^^^^^^^^#12 File "/opt/odoo/16.0/odoo/odoo/modules/loading.py", line 209, in load_module_graph#012 registry.init_models(cr, model_names, {'module': package.name}, new_install)#12 File "/opt/odoo/16.0/odoo/odoo/modules/registry.py", line 526, in init_models#012 model._auto_init()#12 File "/opt/odoo/16.0/odoo/odoo/models.py", line 2614, in _auto_init#012 new = field.update_db(self, columns)#12 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#12 File "/opt/odoo/16.0/odoo/odoo/fields.py", line 1007, in update_db#012 self.update_db_column(model, column)#12 File "/opt/odoo/16.0/odoo/odoo/fields.py", line 1043, in update_db_column#012 self._convert_db_column(model, column)#12 File "/opt/odoo/16.0/odoo/odoo/fields.py", line 1047, in _convert_db_column#012 sql.convert_column(model._cr, model._table, self.name, self.column_type[1])#12 File "/opt/odoo/16.0/odoo/odoo/tools/sql.py", line 128, in convert_column#012 _convert_column(cr, tablename, columnname, columntype, using)#12 File "/opt/odoo/16.0/odoo/odoo/tools/sql.py", line 147, in _convert_column#012 cr.execute(query, log_exceptions=False)#12 File "/opt/odoo/16.0/odoo/odoo/sql_db.py", line 321, in execute#012 res = self._obj.execute(query, params)#12 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#012psycopg2.errors.InvalidDatetimeFormat: invalid input syntax for type timestamp: ""

2025-03-04T22:43:56.122686+01:00 odoo16 Odoo Server 16.0:myodoo.com:CRITICAL:odoo.service.server:Failed to initialize database myodoo.com.#012Traceback (most recent call last):#12 File "/opt/odoo/16.0/odoo/odoo/service/server.py", line 1323, in preload_registries#012 registry = Registry.new(dbname, update_module=update_module)#12 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#12 File "", line 2, in new#012 File "/opt/odoo/16.0/odoo/odoo/tools/func.py", line 87, in locked#012 return func(inst, *args, **kwargs)#12 ^^^^^^^^^^^^^^^^^^^^^^^^^^^#12 File "/opt/odoo/16.0/odoo/odoo/modules/registry.py", line 87, in new#012 odoo.modules.load_modules(registry, force_demo, status, update_module)#12 File "/opt/odoo/16.0/odoo/odoo/modules/loading.py", line 485, in load_modules#012 processed_modules += load_marked_modules(cr, graph,#12 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#12 File "/opt/odoo/16.0/odoo/odoo/modules/loading.py", line 373, in load_marked_modules#012 loaded, processed = load_module_graph(#12 ^^^^^^^^^^^^^^^^^^#12 File "/opt/odoo/16.0/odoo/odoo/modules/loading.py", line 209, in load_module_graph#012 registry.init_models(cr, model_names, {'module': package.name}, new_install)#12 File "/opt/odoo/16.0/odoo/odoo/modules/registry.py", line 526, in init_models#012 model._auto_init()#12 File "/opt/odoo/16.0/odoo/odoo/models.py", line 2614, in _auto_init#012 new = field.update_db(self, columns)#12 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#12 File "/opt/odoo/16.0/odoo/odoo/fields.py", line 1007, in update_db#012 self.update_db_column(model, column)#12 File "/opt/odoo/16.0/odoo/odoo/fields.py", line 1043, in update_db_column#012 self._convert_db_column(model, column)#12 File "/opt/odoo/16.0/odoo/odoo/fields.py", line 1047, in _convert_db_column#012 sql.convert_column(model._cr, model._table, self.name, self.column_type[1])#12 File "/opt/odoo/16.0/odoo/odoo/tools/sql.py", line 128, in convert_column#012 _convert_column(cr, tablename, columnname, columntype, using)#12 File "/opt/odoo/16.0/odoo/odoo/tools/sql.py", line 147, in _convert_column#012 cr.execute(query, log_exceptions=False)#12 File "/opt/odoo/16.0/odoo/odoo/sql_db.py", line 321, in execute#012 res = self._obj.execute(query, params)#12 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#012psycopg2.errors.InvalidDatetimeFormat: invalid input syntax for type timestamp: ""

2025-03-04T22:43:56.122995+01:00 odoo16 Odoo Server 16.0:myodoo.com:INFO:odoo.service.server:Stopping gracefully

Thanks if you could help me

Best Regards,

@yboujraf This issue is related to the data in the table. Please check the error table to see if there is any 'datetime' field with an empty string value(ex in my case : update mail_mail set scheduled_date = null WHERE LENGTH(TRIM(CAST(scheduled_date AS TEXT))) = 0;). If found, set it to NULL — this should resolve the error.

TuNT2512 avatar Jun 06 '25 04:06 TuNT2512