AttributeError: module 'frappe' has no attribute '_dev_server'

After bench update --reset command, server is not running and I am getting following error with any bench command:

Traceback (most recent call last):
File “/usr/lib/python3.8/runpy.py”, line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.8/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/home/mmr/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 101, in
if not frappe._dev_server:
AttributeError: module ‘frappe’ has no attribute ‘_dev_server’

I am also running into the same exception. Didn’t find a solution yet.

frappe.get_doc(‘Project’, ‘My Project’)
Traceback (most recent call last):
File “”, line 1, in
File “/home/chiku/projects/frappe_bench/frappe-bench/apps/frappe/frappe/init.py”, line 1175, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
File “/home/chiku/projects/frappe_bench/frappe-bench/apps/frappe/frappe/model/document.py”, line 73, in get_doc
controller = get_controller(doctype)
File “/home/chiku/projects/frappe_bench/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 76, in get_controller
if frappe.local.dev_server:
File “/home/chiku/projects/frappe_bench/frappe-bench/env/lib/python3.10/site-packages/werkzeug/local.py”, line 88, in getattr
raise AttributeError(name)
AttributeError: dev_server