Thank you both. I deployed the same site twice on DO droplets without any issues and the site was running fine for a year, but it stopped working lately. I did not find any clue so far.
1. Before deployment
$ ps -ef | grep runserver
rmbl 1424 1414 0 05:02 pts/0 00:00:00 grep --color=auto runserver
-----------
$
$ sudo nmap -p 4000, 22 > 136.189.5.1 -Pn
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-02-29 05:03 UTC
Nmap scan report for 22 (0.0.0.22)
Host is up.
PORT STATE SERVICE
4000/tcp filtered remoteanything
Nmap scan report for rmbl-s-1vcpu-2gb-ams3-01 (136.189.5.1)
Host is up (0.000082s latency).
PORT STATE SERVICE 4000/tcp closed remoteanything
Nmap done: 2 IP addresses (2 hosts up) scanned in 2.15 seconds
------------
$
$ sudo ufw status Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
8080 ALLOW Anywhere
8000 ALLOW Anywhere
5432 ALLOW Anywhere
4000 ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
8080 (v6) ALLOW Anywhere (v6)
8000 (v6) ALLOW Anywhere (v6)
5432 (v6) ALLOW Anywhere (v6)
4000 (v6) ALLOW Anywhere (v6)
----------------------
2. After successful deployment:
$
$ sudo netstat -lanp | grep 4000
$
$ sudo nmap -p 4000, 22 136.189.5.1 -Pn
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-02-29 05:07 UTC
Nmap scan report for 22 (0.0.0.22)
Host is up.
PORT STATE SERVICE
4000/tcp filtered remoteanything
Nmap scan report for rmbl-s-1vcpu-2gb-ams3-01 (136.189.5.1)
Host is up(0.000082s latency).
PORT STATE SERVICE 4000/tcp closed remoteanything
Nmap done: 2 IP addresses (2 hosts up) scanned in 2.14 seconds
$
$ ps -ef | grep runserver
jenkins 1679 1 1 05:05 ? 00:00:00 /var/lib/jenkins/workspace/dev-rmbl-project/env/bin/python manage.py runserver 0.0.0.0:4000
jenkins 1691 1679 1 05:05 ? 00:00:01 /var/lib/jenkins/workspace/dev-rmbl-project/env/bin/python manage.py runserver 0.0.0.0:4000
rmbl 1727 1414 0 05:07 pts/0 00:00:00 grep --color=auto runserver
$
$ sudo nmap -p 4000, 22 136.189.5.1 -Pn
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-02-29 05:08 UTC
Nmap scan report for 22 (0.0.0.22)
Host is up.
PORT STATE SERVICE
4000/tcp filtered remoteanything
Nmap scan report for rmbl-s-1vcpu-2gb-ams3-01 (136.189.5.1)
Host is up (0.000078s latency).
PORT STATE SERVICE
4000/tcp closed remoteanything
Nmap done: 2 IP addresses (2 hosts up) scanned in 2.13 seconds
$
$
$wget http://136.189.5.1:4000
--2024-02-29 13:44:39-- http://136.189.5.1:4000/
Connecting to 136.189.5.1:4000... failed: Connection refused.
3. DO support answer:
Upon checking the issue you are facing with the Django application, I can see port 4000 is showing as closed on your Droplet. Please refer to the snippet for the details:nmap -p 4000,22 136.189.5.1 -PnStarting Nmap 7.94 ( https://nmap.org ) at 2024-02-28 13:45 ISTNmap scan report for 136.189.5.1Host is up (0.23s latency).PORT STATE SERVICE22/tcp open ssh4000/tcp closed http-altA closed result means, no active service is listening to that port. In this situation, you would need to check the application status that's configured to run on this port and proceed further with its result. If it's not active, try restarting the service. If it is still failing to start, you might have to troubleshoot further to check what is preventing the services from starting. If it shows any error please check the logs and proceed accordingly.
Best Regards,
~Ram