3

streamlit app is running in a centOS stream 8 virtual machine. Access from intranet is fine but fails with "streamlit please wait.. page" when accessed from www via subDomain.companyDomain.com

Tested R shiny app and a static page from same virtual machine and same port. Both are successfully accessible from www with subDomain.companyDomain.com

network schema network schema

subDomain != virtualMachineName

company proxy server is ssl enabled

streamlit config.toml

[server]
port = 8585
headless = true
enableCORS = false
enableXsrfProtection = false
enableWebsocketCompression = false
address = "0.0.0.0"

[browser]
gatherUsageStats = false
serverAddress = "subDomain.companyDomain.com"

Edit 1:

tested Apache reverse proxy

/etc/httpd/conf.d/testApp.conf

<VirtualHost *:80>
    ServerName subDomain.companyDomain.com
    ServerAlias www.subDomain.companyDomain.com
    ProxyPreserveHost On
    ProxyPass "/" "http://local_IP:8585/"
    ProxyPassReverse "/" "http://local_IP:8585/"
    ErrorLog /var/log/httpd/testApp-error.log
    CustomLog /var/log/httpd/testApp-access.log common
</VirtualHost>

Interestingly, after redirecting http:local_IP:8585 to Apache virtualHost *:80, both local_IP:80 and subDomain.companyDomain.com hang at the same "streamlit.. please wait" page.

(btw, httpd/testApp* log files are empty)

Edit 2

With nginx (this thread), both http://local_IP:8585 and http://local_IP:80 correctly display the app. However, subDomain.companyDomain.com continues to hang with "streamlit please wait" page.

server {
    listen 80;

    location / {
        proxy_pass http://local_IP:8585/;
            proxy_http_version 1.1;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_read_timeout 86400;
    }
}

browser trace suggests error in redirection to/from company proxy server via websocket. But i can not pin point where and how to resolve error.

Edit 3 Tracing browser request via DevTools

enter image description here enter image description here

ss -tulpn |grep "streamlit"
tcp LISTEN 0 128 0.0.0.0:8585 0.0.0.0:* users:(("streamlit",pid=206126,fd=8)) 

netstat -tulpn
tcp 0 0 0.0.0.0:8585 0.0.0.0:* LISTEN 206126/python
tcp6 0 0 :::8585 :::* LISTEN 206126/python

Cross posted in streamlit.io because i am not sure if this problem is caused by streamlit or server.

5
  • - Are there any records in log files (streamlit | python | /var/log ) ? - How about to monitor network activity by ss or netstat command to specify source of the issue
    – Tom Newton
    Commented Apr 28, 2023 at 16:35
  • streamlit logs has no info related to failed app rendering from www. (I guess apps are running fine from the local ip, therefore perhaps streamlit is not showing up any errors in log ?!)
    – 384X21
    Commented Apr 29, 2023 at 8:58
  • It is good to check whether and in which form streamlit server receives requests. In which state are sockets (ports) for incoming connections during web request. The commands ss -tulpn or netstat -tulpn | grep streamlit can give listeneng ports with originating ip (suppose thae application name is as indicated). On the other end -- what shows the trace browser's request via Development tools?
    – Tom Newton
    Commented Apr 30, 2023 at 12:23
  • 1
    @TomNewton: edited question to include output of ss -tulpn and browser request trace
    – 384X21
    Commented May 2, 2023 at 9:08
  • 1
    it seems, next step will be solving google.com/search?q=a+websocket+connection+error+occurred Sorry, I'm not deeply familiar with web-programming
    – Tom Newton
    Commented May 2, 2023 at 11:46

1 Answer 1

0

Problem is related to web socket blocked by company server.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .