Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Odoo 14: request not bound to a database

Subscribe

Get notified when there's activity on this post

This question has been flagged
databaserestoreodoo
2 Replies
7848 Views
Avatar
Bao Dang

I am trying to run Odoo 14 in my developing environment by restoring database from Prod and stuck at this issue. 


raise RuntimeError('request not bound to a database')


2022-10-20 07:06:44,575 21365 INFO ? werkzeug: 127.0.0.1 - - [20/Oct/2022 07:06:44] "GET /web/webclient/translations/5227498d9df4b403b0244c75aac21e0c091e50ce?lang=en_US HTTP/1.1" 404 - 1 0.003 0.019
2022-10-20 07:06:44,592 21365 ERROR ? werkzeug: Error on request:
Traceback (most recent call last):
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/http.py", line 1500, in _dispatch_nodb
result = request.dispatch()
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/http.py", line 810, in dispatch
r = self._call_function(**self.params)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/http.py", line 360, in _call_function
return self.endpoint(*args, **kwargs)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/http.py", line 916, in __call__
return self.method(*args, **kw)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/http.py", line 535, in response_wrap
response = f(*args, **kw)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/addons/web/controllers/main.py", line 951, in qweb
content = HomeStaticTemplateHelpers.get_qweb_templates(mods, db, debug=request.session.debug, bundle=bundle)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/addons/web/controllers/main.py", line 575, in get_qweb_templates
return cls(addons, db, debug=debug)._get_qweb_templates(bundle)[0]
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/addons/web/controllers/main.py", line 561, in _get_qweb_templates
for path, addon, _ in self._get_asset_paths(bundle):
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/addons/web/controllers/main.py", line 551, in _get_asset_paths
return request.env['ir.asset']._get_asset_paths(addons=self.addons, bundle=bundle, xml=True)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/http.py", line 244, in env
self._env = odoo.api.Environment(self.cr, self.uid, self.context)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/http.py", line 214, in cr
raise RuntimeError('request not bound to a database')
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/noufal/ODOO-Git/odoo/odoo15/venv/lib/python3.10/site-packages/werkzeug/serving.py", line 319, in run_wsgi
execute(self.server.app)
File "/home/noufal/ODOO-Git/odoo/odoo15/venv/lib/python3.10/site-packages/werkzeug/serving.py", line 308, in execute
application_iter = app(environ, start_response)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/service/server.py", line 482, in app
return self.app(e, s)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/service/wsgi_server.py", line 112, in application
return application_unproxied(environ, start_response)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/service/wsgi_server.py", line 87, in application_unproxied
result = odoo.http.root(environ, start_response)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/http.py", line 1336, in __call__
return self.dispatch(environ, start_response)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/http.py", line 1302, in __call__
return self.app(environ, start_wrapped)
File "/home/noufal/ODOO-Git/odoo/odoo15/venv/lib/python3.10/site-packages/werkzeug/middleware/shared_data.py", line 287, in __call__
return self.app(environ, start_response)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/http.py", line 1533, in dispatch
result = _dispatch_nodb()
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/http.py", line 1502, in _dispatch_nodb
return request._handle_exception(e)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/http.py", line 748, in _handle_exception
return super(HttpRequest, self)._handle_exception(exception)
File "/home/noufal/ODOO-Git/odoo/odoo15/odoo15/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
RuntimeError: request not bound to a database - - -

0
Avatar
Discard
Ermin Trevisan

Please post a readable traceback and provide the necessary context.

Bao Dang
Author

So I was restoring our production database to my development environment and get this message:

Exception has occurred: RuntimeError (note: full exception trace is shown but execution is paused at: env)request not bound to a database File "D:\Gearment\ODOO\GM_Odoo\odoo\http.py", line 228, in cr raise RuntimeError('request not bound to a database') File "D:\Gearment\ODOO\GM_Odoo\odoo\http.py", line 258, in env (Current frame) self._env = odoo.api.Environment(self.cr, self.uid, self.context) File "D:\Gearment\ODOO\GM_Odoo\odoo\tools\translate.py", line 431, in _get_lang lang = request.env.lang File "D:\Gearment\ODOO\GM_Odoo\odoo\tools\translate.py", line 473, in _get_translation lang = self._get_lang(frame) File "D:\Gearment\ODOO\GM_Odoo\odoo\tools\translate.py", line 447, in __call__ translation = self._get_translation(source) File "D:\Gearment\ODOO\GM_Odoo\odoo\addons_ent\account_invoice_extract\models\account_invoice.py", line 36, in ERROR_INTERNAL: _("An error occurred"), File "D:\Gearment\ODOO\GM_Odoo\odoo\addons_ent\account_invoice_extract\models\__init__.py", line 4, in from . import account_invoice File "D:\Gearment\ODOO\GM_Odoo\odoo\addons_ent\account_invoice_extract\__init__.py", line 4, in from . import models File "D:\Gearment\ODOO\GM_Odoo\odoo\modules\module.py", line 358, in load_openerp_module __import__('odoo.addons.' + module_name) File "D:\Gearment\ODOO\GM_Odoo\odoo\modules\loading.py", line 178, in load_module_graph load_openerp_module(package.name) File "D:\Gearment\ODOO\GM_Odoo\odoo\modules\loading.py", line 346, in load_marked_modules loaded, processed = load_module_graph( File "D:\Gearment\ODOO\GM_Odoo\odoo\modules\loading.py", line 449, in load_modules processed_modules += load_marked_modules(cr, graph, File "D:\Gearment\ODOO\GM_Odoo\odoo\modules\registry.py", line 89, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "D:\Gearment\ODOO\GM_Odoo\odoo\service\db.py", line 308, in restore_db registry = odoo.modules.registry.Registry.new(db) File "D:\Gearment\ODOO\GM_Odoo\odoo\service\db.py", line 41, in if_db_mgt_enabled return method(self, *args, **kwargs) File "D:\Gearment\ODOO\GM_Odoo\odoo\addons\web\controllers\main.py", line 1186, in restore db.restore_db(name, data_file.name, str2bool(copy)) File "D:\Gearment\ODOO\GM_Odoo\odoo\http.py", line 530, in response_wrap response = f(*args, **kw) File "D:\Gearment\ODOO\GM_Odoo\odoo\http.py", line 911, in __call__ return self.method(*args, **kw) File "D:\Gearment\ODOO\GM_Odoo\odoo\http.py", line 359, in _call_function return self.endpoint(*args, **kwargs) File "D:\Gearment\ODOO\GM_Odoo\odoo\http.py", line 805, in dispatch r = self._call_function(**self.params) File "D:\Gearment\ODOO\GM_Odoo\odoo\http.py", line 1439, in _dispatch_nodb result = request.dispatch() File "D:\Gearment\ODOO\GM_Odoo\odoo\http.py", line 1466, in dispatch result = _dispatch_nodb() File "D:\Gearment\ODOO\GM_Odoo\odoo\http.py", line 1262, in __call__ return self.app(environ, start_wrapped) File "D:\Gearment\ODOO\GM_Odoo\odoo\http.py", line 1294, in __call__ return self.dispatch(environ, start_response) File "D:\Gearment\ODOO\GM_Odoo\odoo\service\wsgi_server.py", line 99, in application_unproxied result = odoo.http.root(environ, start_response) File "D:\Gearment\ODOO\GM_Odoo\odoo\service\wsgi_server.py", line 124, in application return application_unproxied(environ, start_response) File "D:\Gearment\ODOO\GM_Odoo\odoo\service\server.py", line 440, in app return self.app(e, s)

Avatar
Nesrine Essaies
Best Answer

add db_name = database_name to your config file

1
Avatar
Discard
Avatar
Bao Dang
Author Best Answer

Sorted it out by removing all cached from source code then checkout and re-run it./

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Restore database from Odoo 12 to Odoo 16 Solved
database restore odoo
Avatar
Avatar
1
Feb 24
79
clean purchase history
database odoo
Avatar
Avatar
1
Mar 24
2428
"Restoring Odoo Online to Day One: Returning to Initial Conditions" Solved
database restore
Avatar
Avatar
Avatar
2
Dec 23
3925
How can I recover ownership? Solved
database odoo
Avatar
Avatar
1
Feb 23
2748
Odoo database failed Solved
database odoo
Avatar
Avatar
1
Dec 22
12604
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now