On first page load, I get a message dialog: "Bad message format - Tried to use SessionInfo before it was initialized". I can then click on the OK button and I can proceed as normal.
On Windows 10 - installed clean separate Python virtual environment. Then installed using pip install streamlit
Then launched hello demo app: streamlit hello
Then I immediately get the dialog message.
yes
pip freeze output:
altair==4.0.0
argh==0.26.2
astor==0.8.1
attrs==19.3.0
base58==1.0.3
blinker==1.4
boto3==1.10.43
botocore==1.13.43
certifi==2019.11.28
chardet==3.0.4
Click==7.0
decorator==4.4.1
docutils==0.15.2
entrypoints==0.3
enum-compat==0.0.3
future==0.18.2
idna==2.8
importlib-metadata==1.3.0
Jinja2==2.10.3
jmespath==0.9.4
jsonschema==3.2.0
MarkupSafe==1.1.1
more-itertools==8.0.2
numpy==1.17.4
pandas==0.25.3
pathtools==0.1.2
Pillow==6.2.1
protobuf==3.11.1
pyrsistent==0.15.6
python-dateutil==2.8.0
pytz==2019.3
PyYAML==5.2
requests==2.22.0
s3transfer==0.2.1
six==1.13.0
streamlit==0.52.0
toml==0.10.0
toolz==0.10.0
tornado==5.1.1
tzlocal==2.0.0
urllib3==1.25.7
validators==0.14.1
watchdog==0.9.0
wincertstore==0.2
zipp==0.6.0
I have the same problem when trying to locally run my app but not when deployed to heroku.
I'm trying to repro this, but having trouble. Here's what I did:
1) Install Windows 10 VM
2) Installed Anaconda
3) Open a new conda environment
4) pip install streamlit
5) streamlit hello
...and it works fine.
Can you provide a little more info on how to reproduce?
Also: Can you try force-reloading your browser tab? Try Shift-F5 or Ctrl-Shift-R.
It's possible you're using an old tab that has version 0.51.0 of our Javascript running. (Which is something that we're fixing right now, actually! See #536 )
Experienced this on OSX also after upgrading from 0.51. I then uninstalled and reinstalled streamlit 0.52, but error persists. Presumably can run strealit in debug mode?
More details on how to reproduce. I first cleared Chome's cache. Then proceeded to do the following on a Windows 10 machine with no admin rights using Miniconda3:
conda create -n streamlit_test python=3.7
conda activate streamlit_test
pip install streamlit
Then I added the following to my config.toml file which I saved at C:Users
[global]
logLevel = "debug"
[server]
headless = true
Then I did: streamlit hello
Here's the output of the debug log prior to visiting the URL with browser. So I have not visited any URL yet:
Initialized tornado logs
Skipping PyPI version check
Setting up signal handler
Using selector: SelectSelector
Server state: None -> State.INITIAL
Starting server...
Serving static content from d:\miniconda3\envs\streamlit_test\lib\site-packages\streamlit\static
Server started on port 8501
Creating new context for ws PREHEATED_REPORT_SESSION
No singleton. Registering one.
Watcher created for d:\miniconda3\envs\streamlit_test\lib\site-packages\streamlit\hello\hello.py
ReportSession initialized (id=0)
Beginning script thread
Server state: State.INITIAL -> State.WAITING_FOR_FIRST_BROWSER
Running script RerunData(widget_state=None)
OnScriptRunnerEvent: ScriptRunnerEvent.SCRIPT_STARTED
New browser connection: gather_usage_stats=True, sharing_enabled=False, max_cached_message_age=2
OnScriptRunnerEvent: ScriptRunnerEvent.SCRIPT_STOPPED_WITH_SUCCESS
OnScriptRunnerEvent: ScriptRunnerEvent.SHUTDOWN
Starting new HTTP connection (1): checkip.amazonaws.com:80
http://checkip.amazonaws.com:80 "GET / HTTP/1.1" 200 14
You can now view your Streamlit app in your browser.
Network URL: http://my_internal_ip:8501
External URL: http://my_external_ip:8501
Then the following shows up in the debug log output after I visit the Network URL with my Chrome browser:
Reusing preheated context for ws <streamlit.server.Server._BrowserWebSocketHandler object at 0x000002222601A710>
Server state: State.WAITING_FOR_FIRST_BROWSER -> State.ONE_OR_MORE_BROWSERS_CONNECTED
Report finished successfully; removing expired entries from MessageCache (max_age=2)
Received the following back message:
update_widgets {
}
Skipping rerun since the preheated run is the same
and yes, I still have that pop-up message.
I have the same problem with the awesome-streamlit.org repo after upgrading from 0.51 to 0.52 via a pip install streamlit==0.52 -u command.

Fixed for now by reverting back to 0.51 via a pip install streamlit==0.51 command.
I'm also getting this on Ubuntu 18.04 with streamlit version 0.52.0
To reproduce using Docker, I have the dockerfile:
FROM python:3.7.2-slim
RUN pip install streamlit==0.52
EXPOSE 8501
CMD [ "streamlit", "hello"]
Then:
docker build -t robmarkcole/streamlit-hello-docker .docker run -p 8501:8501 robmarkcole/streamlit-hello-docker:latest
streamlit==0.51Same problem for me with a clean installation on a google cloud VM using Debian GNU/Linux 9
I have the same problem with the awesome-streamlit.org repo after upgrading from 0.51 to 0.52 via a
pip install streamlit==0.52 -ucommand.
Fixed for now by reverting back to 0.51 via a
pip install streamlit==0.51command.
Had the same issue, reverting back to 0.51 solved it. Thanks for sharing @MarcSkovMadsen !
Thanks for the extra info!
I just figured out a way to repro. The issue only happens when you have:
server.headless = true(Note that headless is also turned on automatically when we detect that there's no display — such as when you're running in Docker)
I have a fix I'll be releasing soon, but in the meantime the workaround is to set up an email. Just use streamlit activate.
“Tried to use SessionInfo before it was initialized”,How to solve this problem?
pip uninstall streamlit
and then
pip install streamlit==0.51
solves the problem, thanks to @MarcSkovMadsen 😍
The fix has been pushed as 0.52.1
Still have the issue at version 0.57.0
Did you try streamlit activate to setup an email?
Do you have server.headless = true or are you in Docker?
Please provide more information on your environment
Also seeing this issue with version 0.57.0
With server.headless = false, outside a Docker container, this seems to only happen if I _also_ try to access the app from the browser _before_ the first window is done loading. Waiting a few seconds functionally resolves it for me.
From inside a Docker container (server.headless = true), only the second window I open has this problem (!?) Not the 1st, not the 3rd/4th/5th.
I can confirm this was still happening in 0.57.0, using @sreeladas' repro steps - I created a Dockerfile based on @robmarkcole's instructions above:
dockerfile:
FROM python:3.7.2-slim
RUN pip install streamlit==0.57.0
EXPOSE 8501
CMD [ "streamlit", "hello"]
And ran it:
$ docker build -t dockerfile .
$ docker run -p 8501:8501 dockerfile:latest
Then I opened two web browser tabs, both pointing to http://localhost:8501. The second tab consistently showed the "Tried to use SessionInfo..." error.
It turns out it was re-introduced (in a slightly different form) - but! then it was fixed in 0.57.1. So I'm going to close this bug. (We're now testing for it manually, before each release - our automated tests use Cypress, which doesn't easily support opening multiple tabs or browser windows, which this requires to repro.)
Most helpful comment
I have the same problem with the awesome-streamlit.org repo after upgrading from 0.51 to 0.52 via a
pip install streamlit==0.52 -ucommand.Fixed for now by reverting back to 0.51 via a
pip install streamlit==0.51command.