streamlit
streamlit copied to clipboard
version.1.27.0: "Tried to use SessionInfo before it was initialized"
Checklist
- [X] I have searched the existing issues for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.
Summary
Hi everyone.
I keep getting this error with the latest streamlit version
Tried to use SessionInfo before it was initialized
I have found this https://github.com/streamlit/streamlit/issues/1282, but it's about an older version.
And this is the error in the console
Exception in callback AppSession._on_scriptrunner_event.<locals>.<lambda>() at C:\Users\AlexandrosFilothodor\anaconda3\envs\GPT\Lib\site-packages\streamlit\runtime\app_session.py:463
handle: <Handle AppSession._on_scriptrunner_event.<locals>.<lambda>() at C:\Users\...\site-packages\streamlit\runtime\app_session.py:463>
Traceback (most recent call last):
File "C:\Users\...\Lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
lambda: self._handle_scriptrunner_event_on_event_loop(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users...\site-packages\streamlit\runtime\app_session.py", line 533, in _handle_scriptrunner_event_on_event_loop
self._create_new_session_message(page_script_hash)
File "C:\Users\...\site-packages\streamlit\runtime\app_session.py", line 641, in _create_new_session_message
imsg.environment_info.streamlit_version = STREAMLIT_VERSION_STRING
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: bad argument type for built-in operation
Exception in callback AppSession._on_scriptrunner_event.<locals>.<lambda>() at C:\Users\...\Lib\site-packages\streamlit\runtime\app_session.py:463
handle: <Handle AppSession._on_scriptrunner_event.<locals>.<lambda>() at C:\Users\...T\Lib\site-packages\streamlit\runtime\app_session.py:463>
Traceback (most recent call last):
File "C:\Users\...\Lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
File "C:\Users\...\site-packages\streamlit\runtime\app_session.py", line 463, in <lambda>
lambda: self._handle_scriptrunner_event_on_event_loop(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users...\site-packages\streamlit\runtime\app_session.py", line 533, in _handle_scriptrunner_event_on_event_loop
self._create_new_session_message(page_script_hash)
File "C:\Users\...\site-packages\streamlit\runtime\app_session.py", line 641, in _create_new_session_message
imsg.environment_info.streamlit_version = STREAMLIT_VERSION_STRING
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: bad argument type for built-in operation
This is not happening with version 1.22.0.
Reproducible Code Example
import streamlit as st
st.title('Welcome')
Steps To Reproduce
Go to the directory. Run the app.
Expected Behavior
There should be no error pop up window.
Current Behavior
Error message:
Bad message format Tried to use SessionInfo before it was initialized
Is this a regression?
- [ ] Yes, this used to work in a previous version.
Debug info
- Streamlit version: 1.27.0
- Python version: 3.11.0
- Operating System: Win 10
- Browser: Edge (latest version), Chrome(latest version)
Additional Information
No response
If this issue affects you, please react with a 👍 (thumbs up emoji) to the initial post.
Your feedback helps us prioritize which bugs to investigate and address first.
Hi @alexfilothodoros, thanks for your submission!
I was unable to reproduce, but in the past users have been able to resolve this issue by upgrading their streamlit version. Could you try upgrading to latest 1.28
?
Hi! It looks OK now.
@mayagbarnes, I am getting this same error with 1.30.0 and 1.31.0, but not 1.29.0. It's been an issue before, so is this regression?
Hi. I have re-opened the issue to ease discussion. I haven't updated to the latest version yet, so I cannot confirm that this problem is back.
I am having the same issue when deployed via Google Cloud Run using version 1.30.0. Is there an update on the fix?
Hi, I have same problem with version 1.32.2, same with version 1.31.1 but when i was with version 1.29 it was fine.
Also I have same issue with streamlit==1.33.0
. For now the only way to resolve is downgrade to 1.29?
downgraded to 1.29 to see if issue is gone
Hi, I'm facing the same issue with current version 1.34.0. I'll be using 1.29.0 as well
BTW I was using cloudrun upgraded everything to v2(cloud run) seems to help with the stability
im getting this issue in 1.35.
@kmcgrady will the fix be shipped with 1.36? Is there any plan to have a patch in the meantime? thanks
Hey @lucasrodes ! It will be shipped in 1.36. We did not plan to release a patch, mainly because it's a race condition. You are welcome to install streamlit-nightly
instead, which should have the fix in. Let us know if it works.
We found this tends to activate when a user calls st.rerun
quickly in the app, which finishes execution before the app started. In case that lines up with the issue you are seeing.
thanks @kmcgrady!
I actually looked for the develop version, installed it and it is working on my end. Thanks.