# nginx: \[emerg\] getpwnam("nginx") failed

**URL:** <https://forum.ansible.com/t/nginx-emerg-getpwnam-nginx-failed/29814>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [March 3, 2019, 10:00pm UTC](https://forum.ansible.com/t/nginx-emerg-getpwnam-nginx-failed/29814 "2019-03-03T22:00:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![AFAHOUNKO\_Danny](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@AFAHOUNKO\_Danny](https://forum.ansible.com/u/AFAHOUNKO_Danny)\
**Post date:** [March 3, 2019, 10:00pm UTC](https://forum.ansible.com/t/nginx-emerg-getpwnam-nginx-failed/29814/1 "2019-03-03T22:00:53Z")

</div>

Hello,  
Build awx project is failing with nginx error.  
I have pulled the lasted version of the code.

awx\_1 | (changed: True)  
awx\_1 | 2019-03-03 21:57:18,845 DEBUG awx.main.dispatch publish awx.main.tasks.apply\_cluster\_membership\_policies(dd4a973d-9f25-40c5-bf97-5ac4a8dd0105, queue=awx\_private\_queue)  
awx\_1 | 2019-03-03 21:57:18,871 DEBUG awx.main.dispatch publish awx.main.tasks.apply\_cluster\_membership\_policies(f4776581-043d-4706-b7cc-5b1bcf61cdf0, queue=awx\_private\_queue)  
awx\_1 | Creating instance group tower  
awx\_1 | (changed: True)  
awx\_1 | 21:57:19 system | daphne.1 started (pid=249)  
awx\_1 | 21:57:19 system | runworker.1 started (pid=247)  
awx\_1 | 21:57:19 system | nginx.1 started (pid=245)  
awx\_1 | 21:57:19 system | receiver.1 started (pid=256)  
awx\_1 | 21:57:19 system | dispatcher.1 started (pid=253)  
awx\_1 | 21:57:19 system | uwsgi.1 started (pid=262)  
awx\_1 | 21:57:19 system | jupyter.1 started (pid=265)  
awx\_1 | 21:57:19 nginx.1 | nginx -g “daemon off;”  
awx\_1 | 21:57:19 nginx.1 | nginx: [emerg] getpwnam(“nginx”) failed  
awx\_1 | 21:57:19 nginx.1 | make: \*\*\* [nginx] Error 1  
awx\_1 | 21:57:19 system | nginx.1 stopped (rc=2)  
awx\_1 | 21:57:19 system | sending SIGTERM to runworker.1 (pid 247)  
awx\_1 | 21:57:19 system | sending SIGTERM to daphne.1 (pid 249)  
awx\_1 | 21:57:19 system | sending SIGTERM to dispatcher.1 (pid 253)  
awx\_1 | 21:57:19 system | sending SIGTERM to receiver.1 (pid 256)  
awx\_1 | 21:57:19 system | sending SIGTERM to uwsgi.1 (pid 262)  
awx\_1 | 21:57:19 system | sending SIGTERM to jupyter.1 (pid 265)  
awx\_1 | 21:57:19 runworker.1 | make: \*\*\* wait: No child processes. Stop.  
awx\_1 | 21:57:19 runworker.1 | make: \*\*\* Waiting for unfinished jobs…  
awx\_1 | 21:57:19 runworker.1 | make: \*\*\* wait: No child processes. Stop.  
awx\_1 | 21:57:19 dispatcher.1 | make: \*\*\* [dispatcher] Terminated  
awx\_1 | 21:57:19 jupyter.1 | make: \*\*\* [jupyter] Terminated  
awx\_1 | 21:57:19 receiver.1 | make: \*\*\* [receiver] Terminated  
awx\_1 | 21:57:19 daphne.1 | make: \*\*\* [daphne] Terminated  
awx\_1 | 21:57:19 system | runworker.1 stopped (rc=2)  
awx\_1 | 21:57:19 system | dispatcher.1 stopped (rc=-15)  
awx\_1 | 21:57:19 system | jupyter.1 stopped (rc=-15)  
awx\_1 | 21:57:19 uwsgi.1 | make: \*\*\* [collectstatic] Terminated  
awx\_1 | 21:57:19 system | uwsgi.1 stopped (rc=-15)  
awx\_1 | 21:57:19 system | receiver.1 stopped (rc=-15)  
awx\_1 | 21:57:19 system | daphne.1 stopped (rc=-15)  
tools\_awx\_1 exited with code 2

---

<div class="post-metadata">

**Author:** ![James\_D\_Ladd\_Jr](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@James\_D\_Ladd\_Jr](https://forum.ansible.com/u/James_D_Ladd_Jr)\
**Post date:** [March 4, 2019, 5:11pm UTC](https://forum.ansible.com/t/nginx-emerg-getpwnam-nginx-failed/29814/2 "2019-03-04T17:11:35Z")

</div>

Hi Danny,

I feel like I've seen this before. If I remember correctly, this error:

> nginx: [emerg] getpwnam("nginx")

was due to the fact that my user wasn't a member of the docker group. Can you tell us what command you're calling to get this output? Also, can you run `id` to determine if your user is a member of the docker group?

---

<div class="post-metadata">

**Author:** ![AFAHOUNKO\_Danny](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@AFAHOUNKO\_Danny](https://forum.ansible.com/u/AFAHOUNKO_Danny)\
**Post date:** [March 4, 2019, 8:17pm UTC](https://forum.ansible.com/t/nginx-emerg-getpwnam-nginx-failed/29814/3 "2019-03-04T20:17:57Z")

</div>

Hello Jim,

Thanks for your inputs.

I was doing the awx building

# make docker-compose-build

# make docker-compose

This is where the error occurred.

Best regards.

---

<div class="post-metadata">

**Author:** ![James\_D\_Ladd\_Jr](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@James\_D\_Ladd\_Jr](https://forum.ansible.com/u/James_D_Ladd_Jr)\
**Post date:** [March 5, 2019, 1:43am UTC](https://forum.ansible.com/t/nginx-emerg-getpwnam-nginx-failed/29814/4 "2019-03-05T01:43:32Z")

</div>

Okay, can you confirm whether or not you're a member of the docker group? (Again, `id` will show you this).

-Jim

---

<div class="post-metadata">

**Author:** ![Michael\_Alexander](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@Michael\_Alexander](https://forum.ansible.com/u/Michael_Alexander)\
**Post date:** [March 7, 2019, 7:02pm UTC](https://forum.ansible.com/t/nginx-emerg-getpwnam-nginx-failed/29814/5 "2019-03-07T19:02:43Z")

</div>

Hello friends,

I have the same problem and my user root is member of the docker group.

$id

uid=0(root) gid=0(root) groups=0(root),994(docker) context=unconfined\_u:unconfined\_r:unconfined\_t:s0-s0:c0.c1023

---

<div class="post-metadata">

**Author:** ![James\_D\_Ladd\_Jr](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@James\_D\_Ladd\_Jr](https://forum.ansible.com/u/James_D_Ladd_Jr)\
**Post date:** [March 7, 2019, 9:37pm UTC](https://forum.ansible.com/t/nginx-emerg-getpwnam-nginx-failed/29814/6 "2019-03-07T21:37:00Z")

</div>

It's been a while since I've run into this, but I think that in order to get things to work I both needed to be a regular user and needed the regular user to be a member of the docker group. Can you try running this as a regular user?

-Jim

---

<div class="post-metadata">

**Author:** ![Michael\_Alexander](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@Michael\_Alexander](https://forum.ansible.com/u/Michael_Alexander)\
**Post date:** [March 8, 2019, 6:59pm UTC](https://forum.ansible.com/t/nginx-emerg-getpwnam-nginx-failed/29814/7 "2019-03-08T18:59:06Z")

</div>

Hello Jim

Thanks for yor help. I got it but I have a doubt, When I try to enter to localhost:8043 as the contributing page said [https://github.com/ansible/awx/blob/devel/CONTRIBUTING.md](https://github.com/ansible/awx/blob/devel/CONTRIBUTING.md)  
I get a 400 bad request but I could get the web interface in the port 8013. Why I doing bad?

- Michael

---

<div class="post-metadata">

**Author:** ![James\_D\_Ladd\_Jr](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@James\_D\_Ladd\_Jr](https://forum.ansible.com/u/James_D_Ladd_Jr)\
**Post date:** [March 8, 2019, 7:13pm UTC](https://forum.ansible.com/t/nginx-emerg-getpwnam-nginx-failed/29814/8 "2019-03-08T19:13:47Z")

</div>

Have you created the superuser? (See [1]). The username / password will be whatever you enter when you run `awx-manage createsuperuser`

[1] [https://github.com/ansible/awx/blob/devel/CONTRIBUTING.md#create-an-admin-user](https://github.com/ansible/awx/blob/devel/CONTRIBUTING.md#create-an-admin-user)

---

<div class="post-metadata">

**Author:** ![James\_D\_Ladd\_Jr](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@James\_D\_Ladd\_Jr](https://forum.ansible.com/u/James_D_Ladd_Jr)\
**Post date:** [March 8, 2019, 7:28pm UTC](https://forum.ansible.com/t/nginx-emerg-getpwnam-nginx-failed/29814/9 "2019-03-08T19:28:14Z")

</div>

> Thanks for your help. I tried it using a regular user and I finally got  
> it.

Great!

> But I'm not sure why when I enter to localhost:8043 I get a 400 bad  
> request and when I enter to localhost:8013 I get the awx login screen but  
> the credentials are not admin/password.

8043 maps to a secure connection, while 8013 maps to an insecure connection. When specifying a port, you have to make sure that you use the correct protocol as well. So, the two options are:

[https://localhost:8043](https://localhost:8043) (secure)  
[http://localhost:8013](http://localhost:8013) (insecure)

Both are supported:  
[https://github.com/ansible/awx/blob/devel/tools/docker-compose/nginx.vh.default.conf#L17](https://github.com/ansible/awx/blob/devel/tools/docker-compose/nginx.vh.default.conf#L17)  
[https://github.com/ansible/awx/blob/devel/tools/docker-compose/nginx.vh.default.conf#L65](https://github.com/ansible/awx/blob/devel/tools/docker-compose/nginx.vh.default.conf#L65)

I just confirmed that I'm able to use both in my environment.

-Jim

---

<div class="post-metadata">

**Author:** ![Michael\_Alexander](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@Michael\_Alexander](https://forum.ansible.com/u/Michael_Alexander)\
**Post date:** [March 8, 2019, 8:05pm UTC](https://forum.ansible.com/t/nginx-emerg-getpwnam-nginx-failed/29814/10 "2019-03-08T20:05:39Z")

</div>

Hello Jim,

Thanks a lot.I forgot to create the admin user. And you are right the port 8043 is for secure connection.  
Finally I could get a development awx.

-Michael

---

<div class="post-metadata">

**Author:** ![James\_D\_Ladd\_Jr](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@James\_D\_Ladd\_Jr](https://forum.ansible.com/u/James_D_Ladd_Jr)\
**Post date:** [March 8, 2019, 8:14pm UTC](https://forum.ansible.com/t/nginx-emerg-getpwnam-nginx-failed/29814/11 "2019-03-08T20:14:37Z")

</div>

\o/
