Traceback (most recent call last):


 "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main

"__main__", mod_spec)


 "/usr/lib/python3.6/runpy.py", line 85, in _run_code

exec(code, run_globals)


 "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 97, in <module>

main()


 "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main

click.Group(commands=commands)(prog_name='bench')


 "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 764, in __call__

return self.main(*args, **kwargs)


 "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 717, in main

rv = self.invoke(ctx)


 "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke

return _process_result(sub_ctx.command.invoke(sub_ctx))


 "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 1137, in invoke

return _process_result(sub_ctx.command.invoke(sub_ctx))


 "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 956, in invoke

return ctx.invoke(self.callback, **ctx.params)


 "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/click/core.py", line 555, in invoke

return callback(*args, **kwargs)


 "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 33, in new_site

db_type = db_type)


 "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 66, in _new_site

source_sql=source_sql,force=force, reinstall=reinstall, db_type=db_type)


 "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 35, in install_db

setup_database(force, source_sql, verbose)


 "/home/frappe/frappe-bench/apps/frappe/frappe/database/__init__.py", line 16, in setup_database

return frappe.database.mariadb.setup_db.setup_database(force, source_sql, verbose)


 "/home/frappe/frappe-bench/apps/frappe/frappe/database/mariadb/setup_db.py", line 40, in setup_database

dbman.delete_user(db_name)


 "/home/frappe/frappe-bench/apps/frappe/frappe/database/db_manager.py", line 31, in delete_user

self.db.sql("DROP USER '%s'@'%s';" % (target, host))


 "/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py", line 181, in sql

if(frappe.db.db_type == 'postgres'):


 "/home/frappe/frappe-bench/env/lib/python3.6/site-packages/werkzeug/local.py", line 348, in __getattr__

return getattr(self._get_current_object(), name)


 "/home/frappe/frappe-bench/env/lib/python3.6/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

Traceback (most recent call last):


 "../asyncserf/asyncserf/actor.py", line 430, in _run


 "/usr/lib/python3/dist-packages/anyio/_backends/_trio.py", line 49, in __aexit__


 "/usr/lib/python3/dist-packages/trio/_core/_ki.py", line 165, in wrapper


 "/usr/lib/python3/dist-packages/trio/_core/_run.py", line 199, in __exit__


 "/usr/lib/python3/dist-packages/trio/_core/_run.py", line 367, in _close


 "/usr/lib/python3/dist-packages/trio/_core/_run.py", line 1645, in current_task
RuntimeError: must be called from async context
