odoo-013 KeyError: ‘ir.http‘

文章目录

  • 一、错误日志
  • 二、原因 & 解决

一、错误日志

操作记录:restore的数据库有问题,删除后报错,访问127.0.0.1:8073 , 页面Internal Server Error 错误,后台错误日志如下:

2022-01-06 03:09:50,790 5179 INFO km01062_v13 werkzeug: 127.0.0.1 - - [06/Jan/2022 03:09:50] "GET / HTTP/1.1" 500 - 6 0.009 0.022
2022-01-06 03:09:50,794 5179 ERROR km01062_v13 werkzeug: Error on request:
Traceback (most recent call last):
  File "/home/odoo/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 306, in run_wsgi
    execute(self.server.app)
  File "/home/odoo/.local/lib/python3.6/site-packages/werkzeug/serving.py", line 294, in execute
    application_iter = app(environ, start_response)
  File "/home/odoo/odoo-dev/odoo13/odoo/odoo/service/server.py", line 439, in app
    return self.app(e, s)
  File "/home/odoo/odoo-dev/odoo13/odoo/odoo/service/wsgi_server.py", line 142, in application
    return application_unproxied(environ, start_response)
  File "/home/odoo/odoo-dev/odoo13/odoo/odoo/service/wsgi_server.py", line 117, in application_unproxied
    result = odoo.http.root(environ, start_response)
  File "/home/odoo/odoo-dev/odoo13/odoo/odoo/http.py", line 1287, in __call__
    return self.dispatch(environ, start_response)
  File "/home/odoo/odoo-dev/odoo13/odoo/odoo/http.py", line 1257, in __call__
    return self.app(environ, start_wrapped)
  File "/home/odoo/.local/lib/python3.6/site-packages/werkzeug/middleware/shared_data.py", line 220, in __call__
    return self.app(environ, start_response)
  File "/home/odoo/odoo-dev/odoo13/odoo/odoo/http.py", line 1441, in dispatch
    ir_http = request.registry['ir.http']
  File "/home/odoo/odoo-dev/odoo13/odoo/odoo/modules/registry.py", line 177, in __getitem__
    return self.models[model_name]
KeyError: 'ir.http' - - -
2022-01-06 03:13:38,591 5179 WARNING ? odoo.addons.base.models.ir_cron: Tried to poll an undefined table on database km01062_v13. 
2022-01-06 03:13:42,591 5179 DEBUG ? odoo.service.server: cron1 polling for jobs 
2022-01-06 03:13:42,592 5179 ERROR km01062_v13 odoo.sql_db: bad query: SELECT latest_version FROM ir_module_module WHERE name='base'
ERROR: relation "ir_module_module" does not exist
LINE 1: SELECT latest_version FROM ir_module_module WHERE name='base...
                                   ^
 
2022-01-06 03:13:42,592 5179 WARNING ? odoo.addons.base.models.ir_cron: Tried to poll an undefined table on database km01062_v13. 

二、原因 & 解决

常用的关于数据库的地址,有的不能直接访问的

/web/database/selector
/web/database/manager
/web/database/create
/web/database/duplicate
/web/database/drop
/web/database/backup
/web/database/restore
/web/database/list

通过报错信息,debug 源码,删除的数据库,实际上还在 session 中,如下图,也就是说没有删除掉,但是页面也打不开,不能从页面上删除,使用 pgadmin4,可以查看所有的数据库,直接删除后再访问就可以了。
odoo-013 KeyError: ‘ir.http‘_第1张图片

你可能感兴趣的:(Odoo,总结,python)