Hi all, require some help in helping me to debug this. My deployed streamlit app suddenly stopped working, however it still works fine when launched locally. Appreciate if anyone could help me on this.
These are my files in Github: GitHub - jethrowong1803/streamlit-W.W.M.J
Below is the error:
KeyError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).
Traceback:
File “/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 535, in _run_script
exec(code, module.dict)
File “/mount/src/streamlit-w.w.m.j/app.py”, line 219, in
cluster0_symbol, cluster1_symbol, cluster2_symbol, cluster0, cluster1, cluster2, sp500_cumm = load_data()
File “/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py”, line 212, in wrapper
return cached_func(*args, **kwargs)
File “/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py”, line 241, in call
return self._get_or_create_cached_value(args, kwargs)
File “/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py”, line 268, in _get_or_create_cached_value
return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
File “/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py”, line 324, in _handle_cache_miss
computed_value = self._info.func(*func_args, **func_kwargs)
File “/mount/src/streamlit-w.w.m.j/app.py”, line 63, in load_data
stockdata = stockdata.stack().reset_index().rename(index=str, columns={“level_1”: “Symbol”}).sort_values([‘Symbol’,‘Date’])
File “/home/adminuser/venv/lib/python3.9/site-packages/pandas/core/frame.py”, line 7159, in sort_values
keys = [self._get_label_or_level_values(x, axis=axis) for x in by]
File “/home/adminuser/venv/lib/python3.9/site-packages/pandas/core/frame.py”, line 7159, in
keys = [self._get_label_or_level_values(x, axis=axis) for x in by]
File “/home/adminuser/venv/lib/python3.9/site-packages/pandas/core/generic.py”, line 1910, in _get_label_or_level_values
raise KeyError(key)