# ConnectionError with flask server

**URL:** <https://discuss.streamlit.io/t/connectionerror-with-flask-server/5525>\
**Category:** Using Streamlit\
**Tags:** flask\
**Created:** [September 12, 2020, 6:22am UTC](https://discuss.streamlit.io/t/connectionerror-with-flask-server/5525 "2020-09-12T06:22:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vishal\_Karthik](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/vishal_karthik/32/3117_2.png) [@Vishal\_Karthik](https://discuss.streamlit.io/u/Vishal_Karthik)\
**Post date:** [September 12, 2020, 6:22am UTC](https://discuss.streamlit.io/t/connectionerror-with-flask-server/5525/1 "2020-09-12T06:22:29Z")

</div>

I am getting the following error while run the streamlit app  
ConnectionError: HTTPConnectionPool(host=‘127.0.0.1’, port=5000): Max retries exceeded with url: / (Caused by NewConnectionError(’\<urllib3.connection.HTTPConnection object at 0x7f492268db20\>: Failed to establish a new connection: [Errno 111] Connection refused’))

The flask server code :

 ![flask](https://global.discourse-cdn.com/streamlit/original/2X/f/f3b7ff7090c0a65fb8da854711acee982fd79b87.png)  
streamlit app code:  
 ![streamlit](https://global.discourse-cdn.com/streamlit/original/2X/e/e55740e6c456a7ef8a1b8c4535fb749e609adcbd.png)

---

<div class="post-metadata">

**Author:** ![Vishal\_Karthik](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/vishal_karthik/32/3117_2.png) [@Vishal\_Karthik](https://discuss.streamlit.io/u/Vishal_Karthik)\
**Post date:** [September 12, 2020, 6:24am UTC](https://discuss.streamlit.io/t/connectionerror-with-flask-server/5525/2 "2020-09-12T06:24:14Z")

</div>

I have closed all other jupyter tabs or instances running the app,yet I get the same error. It would be very useful if you can send help,thanks!

 ![error](https://global.discourse-cdn.com/streamlit/original/2X/9/9b865da326ff7347f432ab22f9deeaff8d29b55d.png)

---

<div class="post-metadata">

**Author:** ![Vishal\_Karthik](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/vishal_karthik/32/3117_2.png) [@Vishal\_Karthik](https://discuss.streamlit.io/u/Vishal_Karthik)\
**Post date:** [September 12, 2020, 6:34am UTC](https://discuss.streamlit.io/t/connectionerror-with-flask-server/5525/3 "2020-09-12T06:34:08Z")

</div>

okay guys the issue is resolved,i just realised i was not running the server at first place,my bad.

---

<div class="post-metadata">

**Author:** ![andfanilo](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/andfanilo/32/1040_2.png) [@andfanilo](https://discuss.streamlit.io/u/andfanilo)\
**Post date:** [September 13, 2020, 11:14am UTC](https://discuss.streamlit.io/t/connectionerror-with-flask-server/5525/5 "2020-09-13T11:14:22Z")

</div>

Welcome to the community @Vishal_Karthik

Glad you found out 🙂 we all do this kind of error!

---

<div class="post-metadata">

**Author:** ![mzeidhassan](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/mzeidhassan/32/546_2.png) [@mzeidhassan](https://discuss.streamlit.io/u/mzeidhassan)\
**Post date:** [December 15, 2020, 6:39pm UTC](https://discuss.streamlit.io/t/connectionerror-with-flask-server/5525/6 "2020-12-15T18:39:09Z")

</div>

@andfanilo Sorry to reopen this, but I thought you might be able to help. I would like to hide such connection errors in a production environment. Right now, this error exposes my API URL which I would like to keep it hidden. Is there a configuration flag in Streamlit that can take care of this? Thanks in advance for your support!

---

<div class="post-metadata">

**Author:** ![randyzwitch](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/randyzwitch/32/58772_2.png) [@randyzwitch](https://discuss.streamlit.io/u/randyzwitch)\
**Post date:** [January 12, 2022, 10:03pm UTC](https://discuss.streamlit.io/t/connectionerror-with-flask-server/5525/7 "2022-01-12T22:03:39Z")

</div>


