Non-zero return code on Reload NGINX

Hey guys,

I usually look into an issue for an hour or longer before posting. But I have got to run so I figured I’d see if anyone had any hints meanwhile.

I usually configure the environments one at a time as I deploy them, this time I did something different where I configured them all up front, encrypted the vaults, then ran vagrant up.

I’m getting this error:

RUNNING HANDLER [common : reload nginx] ****************************************
System info:
  Ansible 2.4.0.0; Vagrant 2.0.1; Darwin
  Trellis at "Vendor h5bp Nginx configs"
---------------------------------------------------
non-zero return code
nginx: [emerg] open() "/etc/nginx/h5bp-server-configs/mime.types" failed (2:
No such file or directory) in /etc/nginx/nginx.conf:59
nginx: configuration file /etc/nginx/nginx.conf test failed
fatal: [default]: FAILED! => {"changed": true, "cmd": ["nginx", "-t"], "delta": "0:00:00.014286", "end": "2018-03-31 02:06:32.802755", "failed": true, "rc": 1, "start": "2018-03-31 02:06:32.788469", "stderr_lines": ["nginx: [emerg] open() \"/etc/nginx/h5bp-server-configs/mime.types\" failed (2: No such file or directory) in /etc/nginx/nginx.conf:59", "nginx: configuration file /etc/nginx/nginx.conf test failed"], "stdout": "", "stdout_lines": []}

I actually noticed I had an A Record setup as wwww. (4 W’s), so I fixed that.
Vagrant Destroy
Vagrant Up

Still the same error. If anyone can point me in the right direction, that’d be awesome. Thanks.

Perhaps the latest merge broke something?

2 Likes

Thanks for reporting @masoninthesis

Proposed fix in https://github.com/roots/trellis/pull/974

4 Likes

I have similar issue, at “Add support for includes.d on all sites” instead “Vendor h5bp Nginx configs”:

RUNNING HANDLER [common : reload nginx] ****************************************
System info:
  Ansible 2.4.0.0; Darwin
  Trellis at "Add support for includes.d on all sites"
---------------------------------------------------
non-zero return code
nginx: [emerg] open() "/etc/nginx/h5bp/mime.types" failed (2: No such file or
directory) in /etc/nginx/nginx.conf:60
nginx: configuration file /etc/nginx/nginx.conf test failed
fatal: [185.14.185.42]: FAILED! => {"changed": true, "cmd": ["nginx", "-t"], "delta": "0:00:00.014367", "end": "2018-03-31 16:41:21.541530", "failed": true, "rc": 1, "start": "2018-03-31 16:41:21.527163", "stderr_lines": ["nginx: [emerg] open() \"/etc/nginx/h5bp/mime.types\" failed (2: No such file or directory) in /etc/nginx/nginx.conf:60", "nginx: configuration file /etc/nginx/nginx.conf test failed"], "stdout": "", "stdout_lines": []}

I’ve changed roles/nginx/templates/nginx.conf.j2 line 78 to

 include       h5bp/mime.types;

And I’ve added mime.types file to the same directory. The problem persists. :sweat::roll_eyes:

My changelog includes until pull #966

1 Like

Worked for me. Thanks dude!