TCP health check failed on port 8000. Retrying…
Deployment logs:
- “Instance created. Preparing to start…”
- “Instance is starting. Propagating network configuration…”
- “Network configuration propagated”
- “Bot Started Powered By @unicornguardian”
- “Bot Started Powered By @unicornguardian”
- “TCP health check failed on port 8000. Retrying…”
- “Instance stopped”
It’s bot working perfectly, but after some time, the TCP health check fails, and then the bot stops working. How can I bypass the TCP health check or find another solution?
2 Likes
I have the same issue.
web-1 | INFO: Started server process [1]
08/02/2024, 03:44:06 AM stderr web-1 | INFO: Waiting for application startup.
08/02/2024, 03:44:06 AM stderr web-1 | INFO: Application startup complete.
08/02/2024, 03:44:06 AM stderr web-1 | INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
08/02/2024, 03:44:16 AM event TCP health check failed on port 8000. Retrying...
08/02/2024, 03:44:56 AM event Instance stopped
Could you find any solution? I am facing with same issue
Yes,
- Create an
app.py
file (it works for Python Telegram bots) with the following code:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'unicornguardian'
if __name__ == "__main__":
app.run()
- Create a
run_cmd.txt
file with the following command:
gunicorn app:app & python3 main.py
- Enter the run command in the Koyeb builder pack.
- Create a
requirements.txt
file with the following content:
Flask==1.1.2
gunicorn==20.1.0
werkzeug==2.0.2
This setup helps create a web page that signals to Koyeb and performs a TCP health check on port 8000, ensuring the application is healthy and operational.
check public link pass port = complicated-ambur-rahulrathee52402-50411549.koyeb.app/
1 Like