Issues with accessing behind a VPN

I am able to interact with the Streamlit app fine on localhost, but am having issues when running remotely using a VPN.

My config is as follows:
[global]
logLevel = “debug”

[server]
enableCORS = false
port = 8080

[browser]
serverAddress = “0.0.0.0/0”

For example, sometimes I get this SessionInfo error:

Other times, the webpage doesn’t load and keeps trying to reconnect:

Using fontManager instance from /home/user/.cache/matplotlib/fontlist-v310.json
Loaded backend agg version unknown.
Loaded backend agg version unknown.
Setting up signal handler
Using selector: EpollSelector
Server state: None -> State.INITIAL
Starting server…
Serving static content from /home/user/.local/lib/python3.6/site-packages/streamlit/static
Server started on port 8080
No singleton. Registering one.
Watcher created for /home/user/fetalgui/fetalGUI/sl_test.py
ReportSession initialized (id=4cae1087-bfe1-48eb-8489-f1571a95d820)
Created new session for ws 10306432. Session ID: 4cae1087-bfe1-48eb-8489-f1571a95d820
Beginning script thread
Server state: State.INITIAL -> State.WAITING_FOR_FIRST_BROWSER
Running script RerunData(widget_state=None)

Disconnecting files for session with ID 4cae1087-bfe1-48eb-8489-f1571a95d820
You can now view your Streamlit app in your browser.
Sessions still active: dict_keys([])

URL: http://0.0.0.0/0:8080
Files: 0; Sessions with files: 0
OnScriptRunnerEvent: ScriptRunnerEvent.SCRIPT_STARTED
New browser connection: gather_usage_stats=True, sharing_enabled=False, max_cached_message_age=2

Entering st.cache: None
Entering st.cache: <function get_static_store at 0x7f3bad707ea0>
mem_cache key for main.get_static_store: b39c88d3d9e7c2eea81ac6f6b159e79a
Creating new mem_cache (key=b39c88d3d9e7c2eea81ac6f6b159e79a, max_entries=inf, ttl=inf)
Cache key: d41d8cd98f00b204e9800998ecf8427e-b39c88d3d9e7c2eea81ac6f6b159e79a
Memory cache MISS: d41d8cd98f00b204e9800998ecf8427e-b39c88d3d9e7c2eea81ac6f6b159e79a
Cache miss: <function get_static_store at 0x7f3bad707ea0>
Reused preheated session for ws 139893831348296. Session ID: 4cae1087-bfe1-48eb-8489-f1571a95d820
Server state: State.WAITING_FOR_FIRST_BROWSER -> State.ONE_OR_MORE_BROWSERS_CONNECTED
Shutting down (id=4cae1087-bfe1-48eb-8489-f1571a95d820)
Server state: State.ONE_OR_MORE_BROWSERS_CONNECTED -> State.NO_BROWSERS_CONNECTED
No longer equal, rerunning
Oh noes. Couldn’t get your Streamlit Session objectAre you doing something fancy with threads?
OnScriptRunnerEvent: ScriptRunnerEvent.SCRIPT_STOPPED_WITH_SUCCESS
Shutting down
OnScriptRunnerEvent: ScriptRunnerEvent.SHUTDOWN
Disconnecting files for session with ID 4cae1087-bfe1-48eb-8489-f1571a95d820
Sessions still active: dict_keys([])
Files: 0; Sessions with files: 0
Watcher created for /home/user/fetalgui/fetalGUI/sl_test.py
ReportSession initialized (id=fc2b9dd8-e721-4ca9-9b39-e6f3f9c208da)
Created new session for ws 139894298447152. Session ID: fc2b9dd8-e721-4ca9-9b39-e6f3f9c208da
Server state: State.NO_BROWSERS_CONNECTED -> State.ONE_OR_MORE_BROWSERS_CONNECTED
Shutting down (id=fc2b9dd8-e721-4ca9-9b39-e6f3f9c208da)
Server state: State.ONE_OR_MORE_BROWSERS_CONNECTED -> State.NO_BROWSERS_CONNECTED
Watcher created for /home/user/fetalgui/fetalGUI/sl_test.py
ReportSession initialized (id=2cc52df4-57c5-48bf-9933-e16ae89c5a7c)
Created new session for ws 139893831050128. Session ID: 2cc52df4-57c5-48bf-9933-e16ae89c5a7c
Server state: State.NO_BROWSERS_CONNECTED -> State.ONE_OR_MORE_BROWSERS_CONNECTED
Shutting down (id=2cc52df4-57c5-48bf-9933-e16ae89c5a7c)
Server state: State.ONE_OR_MORE_BROWSERS_CONNECTED -> State.NO_BROWSERS_CONNECTED
Watcher created for /home/user/fetalgui/fetalGUI/sl_test.py
ReportSession initialized (id=05c52523-46d1-44a0-96b3-1071602d25b3)
Created new session for ws 139893831050912. Session ID: 05c52523-46d1-44a0-96b3-1071602d25b3
Server state: State.NO_BROWSERS_CONNECTED -> State.ONE_OR_MORE_BROWSERS_CONNECTED
Shutting down (id=05c52523-46d1-44a0-96b3-1071602d25b3)
Server state: State.ONE_OR_MORE_BROWSERS_CONNECTED -> State.NO_BROWSERS_CONNECTED
Watcher created for /home/user/fetalgui/fetalGUI/sl_test.py
ReportSession initialized (id=059e05b4-006a-4575-b321-1ee10f187694)
Created new session for ws 139893831180640. Session ID: 059e05b4-006a-4575-b321-1ee10f187694
Server state: State.NO_BROWSERS_CONNECTED -> State.ONE_OR_MORE_BROWSERS_CONNECTED
Shutting down (id=059e05b4-006a-4575-b321-1ee10f187694)
Server state: State.ONE_OR_MORE_BROWSERS_CONNECTED -> State.NO_BROWSERS_CONNECTED
^C Stopping…
Server state: State.NO_BROWSERS_CONNECTED -> State.STOPPING
Server state: State.STOPPING -> State.STOPPED

In this case, after dismissing the error alert, the UI does not rerun after user interaction. i.e text is not written to the screen on tapping a checkbox, whereas the same action in the local app does.

I have tried clearing the cache but this didn’t work either.

Thanks for the help!

Any updates? Would really appreciate some feedback, can reword if any part is unclear. :slight_smile:

Hi Pranav! Sorry for the delay in getting back. Could you please provide some details about your setup, specifically the VPN, where the app is running, and details of the OS versions on localhost and remote. I also wonder if this issue has something to do with the fact that Streamlist app relies on websocket connections, and the VPN could be interfering with it.

1 Like

Not sure if it will help, but I’m on Windows and have streamlit app running on company’s VPN and running off of my work machine. I am using my machine’s computer name or whatever shows up when I do: ping localhost and use that for the serverAddress= config setting instead of “0.0.0.0/0”.