habitat-sh / on-prem-builder

Scripts to stand up an on-premise Habitat Builder Depot
Apache License 2.0
41 stars 34 forks source link

builder-api-proxy crashes if IPV6 is disabled on the machine #207

Open drakoswraith opened 5 years ago

drakoswraith commented 5 years ago

I wasn't sure if this should go in an issue here or not, as it's somewhat a feature/documentation request than it is a bug. Also, if there's a more correct way to handle it in production, i'm interested... but wanted to be sure anybody else that ran into this had the info handy.

Summary:

If IPV6 is not enabled on the machine, the builder-api-proxy service will continuously fail until the user.toml file is manually updated to disable it in NginX. (minIO also reports the error, but does not crash).

Fix:

Because it must be manually added to the user.toml, it is an additional step to be remembered anytime the install.sh is run and the configuration changes. It would be helpful if a variable was in the bldr.env file to handle this.

Details:

This error will be see in the output

journalctl -fu hab-sup
...
builder-api-proxy.default(O): 2019/10/14 22:25:48 [emerg] 10892#0: socket() [::]:80 failed (97: Address family not supported by protocol)

Resolution: Add enabled_ipv6 = false to the nginx config

vi /hab/user/builder-api-proxy/config/user.toml
...
[nginx]
max_body_size = "2048m"
proxy_send_timeout = 180
proxy_read_timeout = 180
enable_gzip = true
enable_caching = true
enable_ipv6 = false
...