Hi,
In an Odoo11 server running w/o change for many weeks a model_name key disappeared from the model registry. There was no change to the modules, configuration, etc. Restarting the Apache server hosting Odoo as a WSGI app fixed the problem. From the stack trace, this seems to be an issue with the Odoo model registry cache. Since the lost model was a non-Odoo addon, Odoo closed the issue w/o looking at the stack trace, which consists entirely of calls within their code. I'm posting the trace here to see if any other Odoo 11 users have seen similar problems. Here's the trace:
```
[Wed May 09 16:27:50.293960 2018] [wsgi:error] [pid 20840:tid 139917498210048] ERROR:odoo.http:Exception during JSON request handling. [Wed May 09 16:27:50.294113 2018] [wsgi:error] [pid 20840:tid 139917498210048] Traceback (most recent call last): [Wed May 09 16:27:50.294166 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/fields.py", line 944, in __get__ [Wed May 09 16:27:50.294211 2018] [wsgi:error] [pid 20840:tid 139917498210048] value = record.env.cache.get(record, self) [Wed May 09 16:27:50.294255 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/api.py", line 960, in get [Wed May 09 16:27:50.294297 2018] [wsgi:error] [pid 20840:tid 139917498210048] value = self._data[field][record.id][key] [Wed May 09 16:27:50.294339 2018] [wsgi:error] [pid 20840:tid 139917498210048] KeyError: <odoo.api.Environment object at 0x7f40fcd7e198> [Wed May 09 16:27:50.294381 2018] [wsgi:error] [pid 20840:tid 139917498210048] [Wed May 09 16:27:50.294422 2018] [wsgi:error] [pid 20840:tid 139917498210048] During handling of the above exception, another exception occurred: [Wed May 09 16:27:50.294513 2018] [wsgi:error] [pid 20840:tid 139917498210048] [Wed May 09 16:27:50.294565 2018] [wsgi:error] [pid 20840:tid 139917498210048] Traceback (most recent call last): [Wed May 09 16:27:50.294607 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/http.py", line 646, in _handle_exception [Wed May 09 16:27:50.294649 2018] [wsgi:error] [pid 20840:tid 139917498210048] return super(JsonRequest, self)._handle_exception(exception) [Wed May 09 16:27:50.294690 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/http.py", line 307, in _handle_exception [Wed May 09 16:27:50.294732 2018] [wsgi:error] [pid 20840:tid 139917498210048] raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) [Wed May 09 16:27:50.294774 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/tools/pycompat.py", line 87, in reraise [Wed May 09 16:27:50.294816 2018] [wsgi:error] [pid 20840:tid 139917498210048] raise value [Wed May 09 16:27:50.294865 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/http.py", line 683, in dispatch [Wed May 09 16:27:50.294912 2018] [wsgi:error] [pid 20840:tid 139917498210048] result = self._call_function(**self.params) [Wed May 09 16:27:50.294955 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/http.py", line 339, in _call_function [Wed May 09 16:27:50.294997 2018] [wsgi:error] [pid 20840:tid 139917498210048] return checked_call(self.db, *args, **kwargs) [Wed May 09 16:27:50.295038 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/service/model.py", line 97, in wrapper [Wed May 09 16:27:50.295079 2018] [wsgi:error] [pid 20840:tid 139917498210048] return f(dbname, *args, **kwargs) [Wed May 09 16:27:50.295120 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/http.py", line 332, in checked_call [Wed May 09 16:27:50.295162 2018] [wsgi:error] [pid 20840:tid 139917498210048] result = self.endpoint(*a, **kw) [Wed May 09 16:27:50.295202 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/http.py", line 927, in __call__ [Wed May 09 16:27:50.295244 2018] [wsgi:error] [pid 20840:tid 139917498210048] return self.method(*args, **kw) [Wed May 09 16:27:50.295313 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/http.py", line 512, in response_wrap [Wed May 09 16:27:50.295358 2018] [wsgi:error] [pid 20840:tid 139917498210048] response = f(*args, **kw) [Wed May 09 16:27:50.295400 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/addons/web/controllers/main.py", line 1200, in load [Wed May 09 16:27:50.295443 2018] [wsgi:error] [pid 20840:tid 139917498210048] action = request.env[action_type].browse([action_id]).read() [Wed May 09 16:27:50.295485 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/addons/base/ir/ir_actions.py", line 194, in read [Wed May 09 16:27:50.295527 2018] [wsgi:error] [pid 20840:tid 139917498210048] result = super(IrActionsActWindow, self).read(fields, load=load) [Wed May 09 16:27:50.295569 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/models.py", line 2520, in read [Wed May 09 16:27:50.295611 2018] [wsgi:error] [pid 20840:tid 139917498210048] values[name] = field.convert_to_read(record[name], record, use_name_get) [Wed May 09 16:27:50.295653 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/models.py", line 4657, in __getitem__ [Wed May 09 16:27:50.295695 2018] [wsgi:error] [pid 20840:tid 139917498210048] return self._fields[key].__get__(self, type(self)) [Wed May 09 16:27:50.295736 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/fields.py", line 948, in __get__ [Wed May 09 16:27:50.295778 2018] [wsgi:error] [pid 20840:tid 139917498210048] self.determine_value(record) [Wed May 09 16:27:50.295828 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/fields.py", line 1059, in determine_value [Wed May 09 16:27:50.295876 2018] [wsgi:error] [pid 20840:tid 139917498210048] self.compute_value(recs) [Wed May 09 16:27:50.295919 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/fields.py", line 1015, in compute_value [Wed May 09 16:27:50.295961 2018] [wsgi:error] [pid 20840:tid 139917498210048] self._compute_value(records) [Wed May 09 16:27:50.296002 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/fields.py", line 1006, in _compute_value [Wed May 09 16:27:50.296044 2018] [wsgi:error] [pid 20840:tid 139917498210048] getattr(records, self.compute)() [Wed May 09 16:27:50.296085 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/addons/base/ir/ir_actions.py", line 154, in _compute_search_view [Wed May 09 16:27:50.296127 2018] [wsgi:error] [pid 20840:tid 139917498210048] fvg = self.env[act.res_model].fields_view_get(act.search_view_id.id, 'search') [Wed May 09 16:27:50.296169 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/api.py", line 760, in __getitem__ [Wed May 09 16:27:50.296249 2018] [wsgi:error] [pid 20840:tid 139917498210048] return self.registry[model_name]._browse((), self) [Wed May 09 16:27:50.296301 2018] [wsgi:error] [pid 20840:tid 139917498210048] File "/home/odoo11/odoo/odoo/modules/registry.py", line 181, in __getitem__ [Wed May 09 16:27:50.296386 2018] [wsgi:error] [pid 20840:tid 139917498210048] return self.models[model_name] [Wed May 09 16:27:50.296450 2018] [wsgi:error] [pid 20840:tid 139917498210048] KeyError: 'tidb.case'
Thanks