Bench stopped working suddenly

Hello

I am using frappe through production.ova in VM. It was working good. But when I created new script report, it stopped suddenly. So, I revert back everything in report, still it didn’t work. Something got disturbed. Restarted bench still same issue. Run command to restart mariadb service but no luck.

Finally, I took fresh .ova file again, started bench. It starts. Created new site. Till this, bench keeps running and even site loads and works. Then I get my app from github using “bench get-app [repo-url]”. But then it shows following error, and bench stops working.

INFO:bench.app:getting app ******
INFO:bench.utils:git clone https://github.com//.git --depth 1 --origin upstream
Cloning into '
’…
Username for ‘https://github.com’: xxxx
Password for ‘https://xxxx@github.com’:
remote: Enumerating objects: 69, done.
remote: Counting objects: 100% (69/69), done.
remote: Compressing objects: 100% (45/45), done.
remote: Total 69 (delta 22), reused 59 (delta 19), pack-reused 0
Unpacking objects: 100% (69/69), done.
Checking connectivity… done.
(‘installing’, u’
’)
INFO:bench.app:installing ****
INFO:bench.utils:./env/bin/pip install -q -e ./apps/
***–no-cache-dir
Traceback (most recent call last):
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/werkzeug/local.py”, line 70, in getattr
return self.storage[self.ident_func()][name]
KeyError: ‘session’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/werkzeug/local.py”, line 308, in _get_current_object
return getattr(self.__local, self.name)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/werkzeug/local.py”, line 72, in getattr
raise AttributeError(name)
AttributeError: session

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 13, in main
commands = get_app_groups()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 25, in get_app_groups
app_commands = get_app_commands(app)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 63, in get_app_commands
if os.path.exists(frappe.get_app_path(app, ‘commands.py’))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 729, in get_app_path
return get_pymodule_path(app_name, *joins)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 744, in get_pymodule_path
return os.path.join(os.path.dirname(get_module(scrub(modulename)).file), *joins)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 706, in get_module
return importlib.import_module(modulename)
File “/home/frappe/frappe-bench/env/lib/python3.5/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 986, in _gcd_import
File “”, line 969, in _find_and_load
File “”, line 958, in _find_and_load_unlocked
File “”, line 673, in _load_unlocked
File “”, line 665, in exec_module
File “”, line 222, in _call_with_frames_removed
File “/home/frappe/frappe-bench/apps/appname/appname/init.py”, line 7, in
email = frappe.session.user
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/werkzeug/local.py”, line 347, in getattr
return getattr(self._get_current_object(), name)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/werkzeug/local.py”, line 310, in _get_current_object
raise RuntimeError(‘no object bound to %s’ % self.name)
RuntimeError: no object bound to session

How to solve this?