My app is running fine locally, but when running on Streamlit cloud I’m running into errors retrieving data from a Deta Base I’m using. It seems to be centered on logging in or retrieving user info from that database. When reloading the page however, the command does seem to have gone through.
link to app
2023-01-15 06:44:06.304 Uncaught app exception
Traceback (most recent call last):
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
exec(code, module.__dict__)
File "/app/online_course_platform_with_streamlit/app.py", line 54, in <module>
name, authentication_status, username = authenticator.login("Login", "main")
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit_authenticator/authenticate.py", line 194, in login
return st.session_state['name'], st.session_state['authentication_status'], st.session_state['username']
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/state/session_state_proxy.py", line 89, in __getitem__
return get_session_state()[key]
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/state/safe_session_state.py", line 108, in __getitem__
raise KeyError(key)
KeyError: 'name'
2023-01-15 06:44:07.978 Uncaught app exception
Traceback (most recent call last):
File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
exec(code, module.__dict__)
File "/app/online_course_platform_with_streamlit/app.py", line 74, in <module>
st.session_state["email"] = db.get_user(st.session_state["username"])["email"]
TypeError: list indices must be integers or slices, not str
To me it looks as if the functions trying to get the user(s) fro the Deta db are returning empty lists but I don’t understand why if it is working fine locally