[17.0 to 18.0] Error invalid input syntax for type json
Module
Base modules. (I cannot specify which module it is, as it indicates that it is a base module)
Describe the bug
A database is migrated from v14 to v17, everything goes smoothly and works, but when the migration from v17 to v18 is done it throws the error.
To Reproduce
Affected versions: v18
Steps to reproduce the behavior:
- Migrate from v16 to v17
- Migrate from v17 to v18
Expected behavior Complete the migration without errors, just as in previous versions.
Error log
2025-11-10 16:06:53,471 20 DEBUG odoo_ddbb OpenUpgrade: 0 rows affected after 0:00:00.000116 running DELETE FROM ir_model_data WHERE module = 'base' AND model='ir.module.module' AND name = 'module_hr_expense_remove_mobile_link'
2025-11-10 16:06:53,552 20 DEBUG odoo_ddbb OpenUpgrade: 1 rows affected after 0:00:00.000204 running UPDATE ir_model_data SET module = 'base', name = 'lang_sr@Cyrl' WHERE module = 'base' and name = 'lang_sr_RS'
2025-11-10 16:06:53,552 20 DEBUG odoo_ddbb OpenUpgrade: 1 rows affected after 0:00:00.000194 running UPDATE ir_model_data SET module = 'base', name = 'module_category_productivity_dashboard' WHERE module = 'spreadsheet_dashboard' and name = 'dashboard_management'
2025-11-10 16:06:53,570 20 DEBUG odoo_ddbb OpenUpgrade: 304 rows affected after 0:00:00.017597 running UPDATE ir_ui_view SET type='list' WHERE type='tree'
2025-11-10 16:06:53,574 20 DEBUG odoo_ddbb OpenUpgrade: 293 rows affected after 0:00:00.004419 running UPDATE ir_act_window
SET view_mode = REGEXP_REPLACE(view_mode, '(^|,)tree(,|$)', '\1list\2', 'g')
WHERE view_mode ~ '(^|,)tree(,|$)'
2025-11-10 16:06:53,590 20 DEBUG odoo_ddbb OpenUpgrade: 1 rows affected after 0:00:00.015027 running UPDATE res_lang SET code='sr@Cyrl', iso_code='sr@Cyrl' WHERE code='sr_RS'
2025-11-10 16:06:53,591 20 DEBUG odoo_ddbb OpenUpgrade: 0 rows affected after 0:00:00.001015 running UPDATE res_company SET layout_background='Blank' WHERE layout_background='Geometric'
2025-11-10 16:06:53,618 20 INFO odoo_ddbb odoo.modules.registry: module base: creating or updating database tables
2025-11-10 16:06:53,955 20 WARNING odoo_ddbb odoo.modules.loading: Transient module states were reset
2025-11-10 16:06:53,955 20 ERROR odoo_ddbb odoo.modules.registry: Failed to load registry
2025-11-10 16:06:53,955 20 CRITICAL odoo_ddbb odoo.service.server: Failed to initialize database `odoo_ddbb`.
Traceback (most recent call last):
File "/opt/odoo/odoo/service/server.py", line 1366, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/odoo/odoo/tools/func.py", line 97, in locked
return func(inst, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/odoo/odoo/modules/registry.py", line 129, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/opt/odoo/odoo/modules/loading.py", line 431, in load_modules
loaded_modules, processed_modules = load_module_graph(
^^^^^^^^^^^^^^^^^^
File "/opt/odoo/odoo/modules/loading.py", line 206, in load_module_graph
registry.init_models(env.cr, model_names, {'module': package.name}, new_install)
File "/opt/odoo/odoo/modules/registry.py", line 605, in init_models
model._auto_init()
File "/opt/odoo/odoo/models.py", line 3469, in _auto_init
new = field.update_db(self, columns)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/odoo/odoo/fields.py", line 1089, in update_db
self.update_db_column(model, column)
File "/opt/odoo/odoo/fields.py", line 2076, in update_db_column
super().update_db_column(model, column)
File "/opt/odoo/odoo/fields.py", line 1125, in update_db_column
self._convert_db_column(model, column)
File "/opt/odoo/odoo/fields.py", line 1792, in _convert_db_column
sql.convert_column(model._cr, model._table, self.name, self.column_type[1])
File "/opt/odoo/odoo/tools/sql.py", line 347, in convert_column
_convert_column(cr, tablename, columnname, columntype, using)
File "/opt/odoo/odoo/tools/sql.py", line 371, in _convert_column
cr.execute(query, log_exceptions=False)
File "/opt/odoo/odoo/sql_db.py", line 357, in execute
res = self._obj.execute(query, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type json
DETAIL: Token "NORYAY" is invalid.
CONTEXT: JSON data, line 1: NORYAY
2025-11-10 16:06:53,958 20 INFO odoo_ddbb odoo.service.server: Initiating shutdown
2025-11-10 16:06:53,958 20 INFO odoo_ddbb odoo.service.server: Hit CTRL-C again or send a second signal to force the shutdown.
2025-11-10 16:06:53,959 20 INFO odoo_ddbb odoo.sql_db: ConnectionPool(read/write;used=0/count=0/max=64): Closed 1 connections
As I've seen in other problems posted by the community, a similar error was supposedly already fixed and was related to analytical accounts, but the problem is the same, but in this case I understand it's in another module.
I tried searching the database for the word NORYAY and I couldn't find it either.
Since I saw that the solutions to those problems were recent, I downloaded openupgrade v17 and v18 again yesterday, and ran the migration again from v16 onwards, encountering the same problem.