FileNotFoundError: [Errno 2] No such file or directory: value = self._data[key][field][record._ids[0]]

File "/opt/odoo-12/apps/odoo/lib/odoo-12.0.post20191215-py3.7.egg/odoo/api.py", line 1049, in get

    value = self._data[key][field][record._ids[0]]

 

Traceback (most recent call last):

  File "/opt/odoo-12/apps/odoo/lib/odoo-12.0.post20191215-py3.7.egg/odoo/fields.py", line 1004, in __get__

    value = record.env.cache.get(record, self)

  File "/opt/odoo-12/apps/odoo/lib/odoo-12.0.post20191215-py3.7.egg/odoo/api.py", line 1051, in get

    raise CacheMiss(record, field)

odoo.exceptions.CacheMiss: ('ir.attachment(237509,).datas', None)

 

During handling of the above exception, another exception occurred:

 

Traceback (most recent call last):

  File "/opt/odoo-12/apps/odoo/lib/odoo-12.0.post20191215-py3.7.egg/odoo/addons/base/models/ir_attachment.py", line 113, in _file_read

    r = base64.b64encode(open(full_path,'rb').read())

FileNotFoundError: [Errno 2] No such file or directory: '/opt/odoo-12/apps/odoo/data/filestore/bitnami_odoo/1a/1ae5dac9fc78e871ac1307e883dd4e66cae35788'

 

Solution: 

delete FROM "public"."ir_attachment" WHERE "public"."ir_attachment"."store_fname" LIKE '%1ae5dac9fc78e871ac1307e883dd4e66cae35788%'