Getting error:[manager] Error checking Streamlit healthz: Get "http://localhost:8501/healthz":

Hello, I successfully deployed my app in streamlit
But when I try to run it more than 3 time, It crashes.

The log says
[manager] Error checking Streamlit healthz: Get "http://localhost:8501/healthz": dial tcp 127.0.0.1:8501: connect: connection refused [manager] Streamlit server consistently failed status checks

I understand the error is because of resource allocation,
but I am using st.cache here, so the file won’t be downloaded again

@st.cache
def download1(url1):
    url = url1
    filename = url.split('/')[-1]
    urllib.request.urlretrieve(url, filename)

download1(“https://github.com/Anubhav1107/streamlit/releases/download/fasterrcnn.pth/fasterrcnn.pth”)
The app is in
https://share.streamlit.io/anubhav1107/streamlit/streamlit.py

Thanks

1 Like

Hi @Anubhav1107 -

In looking at your app, unfortunately I think this has to do with using Torch. As far as I can tell, your app doesn’t have any obvious flaws, but Torch is such a big dependency that running your app a few times then exhausts all available RAM, which causes the error you are seeing.

I’ll forward this thread on to our product and cloud teams, so they can have another example and possibly find a solution for this.

Best,
Randy

1 Like

OK, thanks so much for looking @randyzwitch

Hi @randyzwitch I encountered same problem with torch dependent project, is there anything I can change to get it running.

Hello @randyzwitch,

I’ve come across the same error for a website for which these requirements were used:

pip>=22.1.1
protobuf==3.20.1
matplotlib==3.3.4
seaborn==0.11.1
scikit-learn==0.24.1
catboost==1.0.3
bokeh==2.4.1
numpy==1.20.1
pandas==1.2.4
streamlit>=1.8.1
plotly==5.4.0
statsmodels==0.13.0
streamlit_bokeh_events

The full code of my website is here:
https://github.com/jchatterjee/nycdsa_ml_project_website/blob/main/Ames_map.py

Please let me know how I can clean up my code or requirements to keep this error from popping up, or whether there are improvements that your service are due for to resolve this issue. Thanks.

I’m not using Torch, but I got the same error. Must be due to memory usage, even on my local machine it would be running very slow due to several Folium maps generating in sequence, but how to fix it?

[19:20:45] :exclamation: The service has encountered an error while checking the health of the Streamlit app: Get “http://localhost:8501/healthz”: read tcp 127.0.0.1:49860->127.0.0.1:8501: read: connection reset by peer
/app/scripts/run-streamlit.sh: line 9: 213 Killed sudo -E -u appuser /home/adminuser/venv/bin/streamlit “$@”
[19:22:16] :exclamation: Streamlit server consistently failed status checks
[19:22:16] :exclamation: Please fix the errors, push an update to the git repo, or reboot the app.