Can`t connect to server

First time using Linode so this is probably me doing something wrong during the instalation. From my putty:

(venv) root@139-162-175-249:/var/www/my_flask_app/Flask_test_online# gunicorn -w 3 test:app
[2023-07-20 07:21:39 +0000] [20356] [INFO] Starting gunicorn 21.2.0
[2023-07-20 07:21:39 +0000] [20356] [ERROR] Connection in use: ('127.0.0.1', 8000)
[2023-07-20 07:21:39 +0000] [20356] [ERROR] Retrying in 1 second.
[2023-07-20 07:21:40 +0000] [20356] [ERROR] Connection in use: ('127.0.0.1', 8000)
[2023-07-20 07:21:40 +0000] [20356] [ERROR] Retrying in 1 second.
[2023-07-20 07:21:41 +0000] [20356] [ERROR] Connection in use: ('127.0.0.1', 8000)
[2023-07-20 07:21:41 +0000] [20356] [ERROR] Retrying in 1 second.
[2023-07-20 07:21:42 +0000] [20356] [ERROR] Connection in use: ('127.0.0.1', 8000)
[2023-07-20 07:21:42 +0000] [20356] [ERROR] Retrying in 1 second.
[2023-07-20 07:21:43 +0000] [20356] [ERROR] Connection in use: ('127.0.0.1', 8000)
[2023-07-20 07:21:43 +0000] [20356] [ERROR] Retrying in 1 second.
[2023-07-20 07:21:44 +0000] [20356] [ERROR] Can't connect to ('127.0.0.1', 8000)
(venv) root@139-162-175-249:/var/www/my_flask_app/Flask_test_online# ^C
(venv) root@139-162-175-249:/var/www/my_flask_app/Flask_test_online# sudo pkill gunicorn
(venv) root@139-162-175-249:/var/www/my_flask_app/Flask_test_online# sudo lsof -i :8000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
gunicorn3 20366 root 5u IPv4 338391 0t0 TCP localhost:8000 (LISTEN)
gunicorn3 20369 root 5u IPv4 338391 0t0 TCP localhost:8000 (LISTEN)
gunicorn3 20370 root 5u IPv4 338391 0t0 TCP localhost:8000 (LISTEN)
gunicorn3 20371 root 5u IPv4 338391 0t0 TCP localhost:8000 (LISTEN)
(venv) root@139-162-175-249:/var/www/my_flask_app/Flask_test_online# ^C
(venv) root@139-162-175-249:/var/www/my_flask_app/Flask_test_online# sudo pkill gunicorn3
(venv) root@139-162-175-249:/var/www/my_flask_app/Flask_test_online#
(venv) root@139-162-175-249:/var/www/my_flask_app/Flask_test_online# sudo lsof -i :8000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
gunicorn3 20385 root 5u IPv4 338906 0t0 TCP localhost:8000 (LISTEN)
gunicorn3 20388 root 5u IPv4 338906 0t0 TCP localhost:8000 (LISTEN)
gunicorn3 20389 root 5u IPv4 338906 0t0 TCP localhost:8000 (LISTEN)
gunicorn3 20390 root 5u IPv4 338906 0t0 TCP localhost:8000 (LISTEN)

Can anyone explain to me what I am doing wrong? I have uploaded the flask app and it runs without problems locally. I have installed the NGINX and all the python scripts. I have configured flask using json and installed unicorn but I have done something wrong. I do not know why or how to start debugging.

2 Replies

I'm not sure if you already saw this, but we have another post on our site about what sounds like the same issue that you may want to check out.

The suggestion there is that something is bringing gunicorn back up, and you need to find that and stop it in order to kill all the processes.

This StackOverflow forum explaining options for killing processes may also help.

Someone more familiar with these applications may be able to provide a more complete answer, but I hope something in those resources gets you moving in the right direction.

Thanks for the answer. I actually got the solution from one of the guys on the Linode team. The premade app kept restarting the gunicorn3 that I killed so once that was handled everything went smooth. But thanks for the reply!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct