# Getting "Address already in use" error

**URL:** <https://discourse.openondemand.org/t/getting-address-already-in-use-error/1435>\
**Category:** Get Help\
**Created:** [April 17, 2021, 12:54pm UTC](https://discourse.openondemand.org/t/getting-address-already-in-use-error/1435 "2021-04-17T12:54:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [April 19, 2021, 6:06pm UTC](https://discourse.openondemand.org/t/getting-address-already-in-use-error/1435/2 "2021-04-19T18:06:11Z")

</div>

Hi and welcome! What are the processes `3310` and `3310`? I take it their nginx processes’ but I’m wondering if they’re defunct or running.

When you complete step 2 (`/opt/ood/nginx_stage/sbin/nginx_stage nginx_clean --user=$USER`) I would search for these processes’ if they’re still up or what. Also be sure it removes the socket file.

```plaintext
[root@faa43c1fc202 ~]# sudo /opt/ood/nginx_stage/sbin/nginx_stage nginx_clean --user jeff
[root@faa43c1fc202 ~]# ls /var/run/ondemand-nginx/jeff/ -lrt
total 0
[root@faa43c1fc202 ~]# ps -elf | grep nginx
0 S root 636 431 0 80 0 - 2297 - 17:59 pts/0 00:00:00 grep --color=auto nginx

```

I confirmed that even if you force kill that nginx master process, it’s smart enough to remove the socket file. But even if it doesn’t, you can try to force kill the nginx master (and any child processes’ if they exist) and force remove the socket file.

```auto
[root@faa43c1fc202 ~]# ps -elf | grep nginx
5 S root 670 1 0 80 0 - 23026 - 18:00 ? 00:00:00 nginx: master process (jeff) -c /var/lib/ondemand-nginx/config/puns/jeff.conf
5 S jeff 671 670 0 80 0 - 26668 - 18:00 ? 00:00:00 nginx: worker process
0 S root 727 431 0 80 0 - 2297 - 18:00 pts/0 00:00:00 grep --color=auto nginx
[root@faa43c1fc202 ~]# kill 670
[root@faa43c1fc202 ~]# ps -elf | grep nginx
0 S root 741 431 0 80 0 - 2297 - 18:01 pts/0 00:00:00 grep --color=auto nginx
[root@faa43c1fc202 ~]# ps -elf | grep jeff 
4 S jeff 1 0 0 80 0 - 2974 - 17:51 ? 00:00:00 /bin/bash /entrypoint.sh
4 S jeff 420 0 0 80 0 - 3007 - 17:52 pts/0 00:00:00 /bin/bash
0 S root 743 431 0 80 0 - 2297 - 18:01 pts/0 00:00:00 grep --color=auto jeff
[root@faa43c1fc202 ~]# ls /var/run/ondemand-nginx/jeff/ -lrt
total 0

```

I suspect this is causes by some resource constraint. Here’s steps to debug and try to get a strace for starting up nginx.

> [@Nginx Error: Address already in use](https://discourse.openondemand.org/t/nginx-error-address-already-in-use/1238/7):
>
> here’s my best guess as to what’s happening: The first nginx starts and crashes, but doesn’t release the socket file or zombies. (1) I would try to find out what the process is still using it. lsof will give you this. See if that process is still running or what’s going on with that. [jeff@518bd97864ee /]$ lsof /var/run/ondemand-nginx/jeff/passenger.sock COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nginx 379 jeff 6u unix 0x00000000ff78144c 0t0 2523864 /var/…

---

_[View the full topic](https://discourse.openondemand.org/t/getting-address-already-in-use-error/1435)._
