"RuntimeError: no object bound to db " bench new-site

MySQL root password:
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/srv/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/srv/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/srv/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/srv/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/srv/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/srv/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/srv/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/srv/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/srv/bench/erpnext/apps/frappe/frappe/commands/site.py”, line 33, in new_site
db_type = db_type)
File “/srv/bench/erpnext/apps/frappe/frappe/commands/site.py”, line 66, in _new_site
source_sql=source_sql,force=force, reinstall=reinstall, db_type=db_type)
File “/srv/bench/erpnext/apps/frappe/frappe/installer.py”, line 35, in install_db
setup_database(force, source_sql, verbose)
File “/srv/bench/erpnext/apps/frappe/frappe/database/init.py”, line 16, in setup_database
return frappe.database.mariadb.setup_db.setup_database(force, source_sql, verbose)
File “/srv/bench/erpnext/apps/frappe/frappe/database/mariadb/setup_db.py”, line 40, in setup_database
dbman.delete_user(db_name)
File “/srv/bench/erpnext/apps/frappe/frappe/database/db_manager.py”, line 31, in delete_user
self.db.sql(“DROP USER ‘%s’@’%s’;” % (target, host))
File “/srv/bench/erpnext/apps/frappe/frappe/database/database.py”, line 181, in sql
if(frappe.db.db_type == ‘postgres’):
File “/srv/bench/erpnext/env/local/lib/python2.7/site-packages/werkzeug/local.py”, line 348, in getattr
return getattr(self._get_current_object(), name)
File “/srv/bench/erpnext/env/local/lib/python2.7/site-packages/werkzeug/local.py”, line 311, in _get_current_object
raise RuntimeError(“no object bound to %s” % self.name)
RuntimeError: no object bound to db

1 Like

Getting same error. Any progress?

Restoring docker to default factory settings and then going through the process again fixed the problem.

Got same problem after restoring from production to test.

Same error here also

hello @suraj.jahagirdar and @w3ecram any luck with fixing this error?