This question has been flagged
2 Replies
30540 Views


Hi,

I'm new to odoo. I have setup odoo v13 via docker and it works fine but suddenly stops working and starts raising this CacheMiss error. Here is the complete traceback of the error


```

2019-11-20 13:38:50,473 1 INFO odoo werkzeug: 172.21.0.1 - - [20/Nov/2019 13:38:50] "GET / HTTP/1.1" 200 - 50 0.019 0.053
2019-11-20 13:38:50,528 1 INFO odoo odoo.addons.base.models.ir_attachment: _read_file reading /var/lib/odoo/.local/share/Odoo/filestore/odoo/c3/c314f0ddceda24f93b37eab79c38c432f494e443
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/api.py", line 753, in get
value = self._data[field][record._ids[0]]
KeyError: 535

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 955, in __get__
value = env.cache.get(record, self)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 759, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('ir.attachment(535,).datas', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_attachment.py", line 103, in _file_read
with open(full_path,'rb') as fd:
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/odoo/.local/share/Odoo/filestore/odoo/c3/c314f0ddceda24f93b37eab79c38c432f494e443'
2019-11-20 13:38:50,533 1 INFO odoo odoo.addons.base.models.ir_attachment: _read_file reading /var/lib/odoo/.local/share/Odoo/filestore/odoo/58/58277504533e0ea8b7e160159b0324925b240a82
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/api.py", line 753, in get
value = self._data[field][record._ids[0]]
KeyError: 534

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 955, in __get__
value = env.cache.get(record, self)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 759, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('ir.attachment(534,).datas', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_attachment.py", line 103, in _file_read
with open(full_path,'rb') as fd:
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/odoo/.local/share/Odoo/filestore/odoo/58/58277504533e0ea8b7e160159b0324925b240a82'
2019-11-20 13:38:50,534 1 INFO odoo werkzeug: 172.21.0.1 - - [20/Nov/2019 13:38:50] "GET /web/content/535-177e6a6/1/web.assets_frontend.css HTTP/1.1" 404 - 6 0.010 0.015
2019-11-20 13:38:50,551 1 INFO odoo werkzeug: 172.21.0.1 - - [20/Nov/2019 13:38:50] "GET /web/content/534-b7b13c6/1/web.assets_common.css HTTP/1.1" 404 - 6 0.008 0.035
2019-11-20 13:38:50,552 1 INFO odoo odoo.addons.base.models.ir_attachment: _read_file reading /var/lib/odoo/.local/share/Odoo/filestore/odoo/a7/a71a4f8941d1f20d44292585be3dc205f66c4c03
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/api.py", line 753, in get
value = self._data[field][record._ids[0]]
KeyError: 538

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 955, in __get__
value = env.cache.get(record, self)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 759, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('ir.attachment(538,).datas', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_attachment.py", line 103, in _file_read
with open(full_path,'rb') as fd:
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/odoo/.local/share/Odoo/filestore/odoo/a7/a71a4f8941d1f20d44292585be3dc205f66c4c03'
2019-11-20 13:38:50,553 1 INFO odoo odoo.addons.base.models.ir_attachment: _read_file reading /var/lib/odoo/.local/share/Odoo/filestore/odoo/08/08efb3bfc9c36d5f94e7b320b1a326285a70d494
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/api.py", line 753, in get
value = self._data[field][record._ids[0]]
KeyError: 537

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 955, in __get__
value = env.cache.get(record, self)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 759, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('ir.attachment(537,).datas', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_attachment.py", line 103, in _file_read
with open(full_path,'rb') as fd:
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/odoo/.local/share/Odoo/filestore/odoo/08/08efb3bfc9c36d5f94e7b320b1a326285a70d494'
2019-11-20 13:38:50,556 1 INFO odoo werkzeug: 172.21.0.1 - - [20/Nov/2019 13:38:50] "GET /web/content/538-3a5eadd/1/web.assets_frontend_minimal_js.js HTTP/1.1" 404 - 6 0.014 0.019
2019-11-20 13:38:50,558 1 INFO odoo werkzeug: 172.21.0.1 - - [20/Nov/2019 13:38:50] "GET /web/content/537-5174ce9/1/web.assets_common_minimal_js.js HTTP/1.1" 404 - 6 0.013 0.025
2019-11-20 13:38:50,585 1 INFO ? werkzeug: 172.21.0.1 - - [20/Nov/2019 13:38:50] "GET /web/static/src/img/odoo_logo_tiny.png HTTP/1.1" 304 - - - -
2019-11-20 13:38:50,587 1 INFO odoo odoo.addons.base.models.ir_attachment: _read_file reading /var/lib/odoo/.local/share/Odoo/filestore/odoo/2c/2cce86c2ff77c597a53e67c89d5f82ae7ae62149
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/api.py", line 753, in get
value = self._data[field][record._ids[0]]
KeyError: 451

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/fields.py", line 955, in __get__
value = env.cache.get(record, self)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 759, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: ('ir.attachment(451,).datas', None)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_attachment.py", line 103, in _file_read
with open(full_path,'rb') as fd:
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/odoo/.local/share/Odoo/filestore/odoo/2c/2cce86c2ff77c597a53e67c89d5f82ae7ae62149'
2019-11-20 13:38:50,595 1 INFO odoo werkzeug: 172.21.0.1 - - [20/Nov/2019 13:38:50] "GET /web/image/website/1/logo/My Website?unique=4bee797 HTTP/1.1" 404 - 8 0.004 0.016
2019-11-20 13:38:50,631 1 INFO odoo werkzeug: 172.21.0.1 - - [20/Nov/2019 13:38:50] "GET /web/image/website/1/favicon?unique=4bee797 HTTP/1.1" 200 - 5 0.003 0.011

```

This issue looks very similar to this one that I came across where  such error will be fixed simply by an update. I already have the latest version of odoo which is v13.

https://www.odoo.com/forum/help-1/question/error-in-odoo12-community-147586

Can anyone please help me out on this?


Avatar
Discard

Hello, I'm having the same error but I don't understand your solution can you or any one describe? Thank you.

Best Answer

This is the key error:

FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/odoo/.local/share/Odoo/filestore/odoo/2c/2cce86c2ff77c597a53e67c89d5f82ae7ae62149'

When you create a new database, odoo stores some corresponding binary data (such as javascript and images) in a "filestore" directory.

If you are using docker, and ephemeral containers, you'll need to map a docker volume so that the filestore data is not lost when the container restarts.

You can control the path of the filestore using the data_dir setting in the odoo configuration file.

HTH

Russ

Avatar
Discard

Many, many thanks!

This is a critical gem of information for modern docker-based/cloud-based deployments. It should be clearly stated in the official Deployment documentation.

(It has taken me days to find this critical information - thanks, again!)

...a further question, adding on to the comment below:

Would it be safe to locate the 'data_dir' in a shared folder that is accessible to multiple instances/containers in a load-balanced, clustered deployment?

Author Best Answer

@russ. I have applied your suggested fix by following volume mapping

​./odo/.local/share/Odoo/:/var/lib/odoo/.local/share/Odoo/
./odo/.odoo:/usr/lib/python3/dist-packages/odoo/

Guess will find out if it work in a couple of days.
Thanks for the help... :)

Avatar
Discard
Author

Yep this worked Thanks Russ.