Unfortunately, āenableCORS=falseā doesnāt work.
After setting this option, I still get āPlease waitā¦ā screen when trying to connect to my EC2 (Iāve checked that the config is loaded properly via āstreamlit config showā and my 8501 port is open)
Iāve also tried binding it to 0.0.0.0 like when I deploy gunicorn (browser.serverAddress=ā0.0.0.0ā), as per How do I set the server to 0.0.0.0 for deployment using Docker
Not sure if itās relevant, but when I try the /healthz route, I get āOKā.
Any other ideas on how to resolve this?
Iāve encountered the same issue on several other EC2 instances I tried. I was so excited to showcase your amazing app to our team tomorrow
(but regardless of this issue - this is an amazing tool, guys!! )
Update: It works when I run streamlit on localhost on EC2 (browser.serverAddress=ālocalhostā) and forward my port via SSH tunnel. But I still havenāt found a way how to make it accessible on instanceās public IP.
Update 2: I just got home and got a very strange behaviour.
- At first, it was hanging at āplease waitā¦ā and I could see that ā/streamā call to websocket is timing out.
- But after a while (c. 2mins) Hello app suddenly popped up (ā/streamā went through with status code 101). I could replicate this behaviour several times (a few mins of time outs and then pop up).
- Now, when I refresh it loads immediately! I havenāt done any changes on EC2 (config is set to enableCORS=false, serverAddress=ā0.0.0.0ā)
Update 3: It again stopped working this morning (despite no changes). Since then, Iāve tried multiple AWS accounts, regions, set ups and streamlit apps with no difference. Winning combo (when it works) is as per my Update 2, but itās quite temperamental, which makes it hard to reproduce & debugā¦ I guess Iāll wait for a more stable release (EC2-wise).
For completeness: Issue is on path /stream that keeps hitting āWebSocket is closed before the connection is established.ā and over time changes into āError during WebSocket handshake: Unexpected response code: 503ā
Update 4: Temporary solution seems to be to put your EC2 behind an ALB that forwards from port 80 to whatever your Streamlit port is (eg, 8501).