Monthly Archive: June, 2018

ir_attachment: IOError: [Errno 2] No such file or directory

恢复Odoo数据抛出错误导致无法进入页面

2018-06-14 08:26:09,705 30127 INFO yszs odoo.addons.base.ir.ir_attachment: _read_file reading /var/lib/odoo/filestore/yszs/98/9809d6d03b894abb232008e691e68e8d34a2fb71
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/odoo/addons/base/ir/ir_attachment.py", line 100, in _file_read
r = open(full_path,'rb').read().encode('base64')
IOError: [Errno 2] No such file or directory: u'/var/lib/odoo/filestore/yszs/98/9809d6d03b894abb232008e691e68e8d34a2fb71'

解决方法:

select *
from ir_attachment
where url LIKE '/web/content/%';

DELETE FROM ir_attachment
WHERE url LIKE '/web/content/%';

重启Odoo服务