This question has been flagged
1 Reply
7971 Views

What is the current behavior that you observe?
When i click on any product in INVENTORY i get this error below!, and then when i click any of the buttons in the navigation bar, Operations, Products Reporting, etc. i Get a different error for each one!!! :((( This is really bad. 

What are the steps to reproduce your issue?
[MY ODOO is installed on a USB Drive and Without thinking i unplugged it from the Computer yesterday and when i put it back in i started getting these errors!]

OS:WINDOWS 10
Odoo v16 Community Edition
PostgreSQL 

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "D:\programs\server\odoo\api.py", line 983, in get
cache_value = field_cache[record._ids[0]]
KeyError: 59

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\programs\server\odoo\fields.py", line 1160, in __get__
value = env.cache.get(record, self)
File "D:\programs\server\odoo\api.py", line 990, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'product.product(59,).display_name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\programs\server\odoo\api.py", line 983, in get
cache_value = field_cache[record._ids[0]]
KeyError: 59

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\programs\server\odoo\fields.py", line 1160, in __get__
value = env.cache.get(record, self)
File "D:\programs\server\odoo\api.py", line 990, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'product.product(59,).product_template_attribute_value_ids'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\programs\server\odoo\http.py", line 1583, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "D:\programs\server\odoo\service\model.py", line 134, in retrying
result = func()
File "D:\programs\server\odoo\http.py", line 1610, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "D:\programs\server\odoo\http.py", line 1807, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "D:\programs\server\odoo\addons\base\models\ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "D:\programs\server\odoo\http.py", line 696, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "D:\programs\server\odoo\addons\web\controllers\dataset.py", line 42, in call_kw
return self._call_kw(model, method, args, kwargs)
File "D:\programs\server\odoo\addons\web\controllers\dataset.py", line 33, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "D:\programs\server\odoo\api.py", line 461, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "D:\programs\server\odoo\api.py", line 448, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "D:\programs\server\odoo\models.py", line 2979, in read
return self._read_format(fnames=fields, load=load)
File "D:\programs\server\odoo\models.py", line 3136, in _read_format
vals[name] = convert(record[name], record, use_name_get)
File "D:\programs\server\odoo\fields.py", line 2976, in convert_to_read
return (value.id, value.sudo().display_name)
File "D:\programs\server\odoo\fields.py", line 1208, in __get__
self.compute_value(recs)
File "D:\programs\server\odoo\fields.py", line 1367, in compute_value
records._compute_field_value(self)
File "D:\programs\server\odoo\addons\mail\models\mail_thread.py", line 403, in _compute_field_value
return super()._compute_field_value(field)
File "D:\programs\server\odoo\models.py", line 4193, in _compute_field_value
fields.determine(field.compute, self)
File "D:\programs\server\odoo\fields.py", line 97, in determine
return needle(*args)
File "D:\programs\server\odoo\addons\product\models\product_product.py", line 408, in _compute_display_name
return super()._compute_display_name()
File "D:\programs\server\odoo\models.py", line 1528, in _compute_display_name
names = dict(self.name_get())
File "D:\programs\server\odoo\addons\product\models\product_product.py", line 452, in name_get
variant = product.product_template_attribute_value_ids._get_combination_name()
File "D:\programs\server\odoo\fields.py", line 2771, in __get__
return super().__get__(records, owner)
File "D:\programs\server\odoo\fields.py", line 1185, in __get__
recs._fetch_field(self)
File "D:\programs\server\odoo\models.py", line 3162, in _fetch_field
self._read(fnames)
File "D:\programs\server\odoo\models.py", line 3272, in _read
field.read(fetched)
File "D:\programs\server\odoo\fields.py", line 4713, in read
records._cr.execute(query, where_params)
File "D:\programs\server\odoo\sql_db.py", line 313, in execute
res = self._obj.execute(query, params)
psycopg2.errors.DataCorrupted: invalid page in block 4 of relation base/16393/21436

Avatar
Discard
Best Answer

Based on the information you provided, it seems like there might be a data corruption issue in your Odoo database, possibly caused by unplugging the USB drive while it was being accessed.

To attempt a resolution, I would suggest taking the following steps:

  1. Create a backup of your current Odoo database to prevent further data loss.

  2. Restart the Odoo server and check if the issue still persists.

  3. If restarting does not solve the problem, you may need to repair the PostgreSQL database. You can use pg_dump to create a backup of your database first and then try to restore it using pg_restore. In case there are errors during restoration, this could help identify issues with corrupted tables or indexes.

  4. Depending on the severity of corruption, you may need to use additional PostgreSQL recovery tools or methods such as reindexdb to rebuild indexes or manual repair using SQL queries.

  5. If none of these methods resolve your issue, you could consider restoring from an earlier backup (if available) or seeking assistance from an experienced Odoo developer or consultant who can analyze and fix your specific issue.

Remember that working with databases can be potentially risky; always create backups before attempting any changes or repairs. Good luck!


Avatar
Discard