20735: Workaround nginx/glibc/docker issue.
authorTom Clegg <tom@curii.com>
Wed, 16 Aug 2023 13:04:18 +0000 (09:04 -0400)
committerTom Clegg <tom@curii.com>
Wed, 16 Aug 2023 13:04:18 +0000 (09:04 -0400)
Docker writes both "::1 localhost" and "127.0.0.1 localhost" in
/etc/hosts even when not enabling IPv6 [1], causing glibc to resolve
"localhost" to two identical IP addresses 127.0.0.1 and 127.0.0.1 [2],
causing nginx to error out on "listen localhost:45123;" [3]:

[emerg] a duplicate listen 127.0.0.1:45123 in /tmp/nginx.conf:29

[1] https://github.com/moby/moby/issues/35954#issuecomment-498406618
("you should be testing with IPv6 enabled")

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=14969 (open since
2012-12-17)

[2] https://trac.nginx.org/nginx/ticket/2400 (workaround added
2022-11-23)

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

lib/boot/cmd.go

index 6740993dab709f65858c6c8c1796d83b25838bd3..dc5c43180e111b2e4d655f9a8d76149a25567e2d 100644 (file)
@@ -67,7 +67,7 @@ func (bcmd bootCommand) run(ctx context.Context, prog string, args []string, std
        flags.StringVar(&super.ConfigPath, "config", "/etc/arvados/config.yml", "arvados config file `path`")
        flags.StringVar(&super.SourcePath, "source", ".", "arvados source tree `directory`")
        flags.StringVar(&super.ClusterType, "type", "production", "cluster `type`: development, test, or production")
-       flags.StringVar(&super.ListenHost, "listen-host", "localhost", "host name or interface address for internal services whose InternalURLs are not configured")
+       flags.StringVar(&super.ListenHost, "listen-host", "127.0.0.1", "host name or interface address for internal services whose InternalURLs are not configured")
        flags.StringVar(&super.ControllerAddr, "controller-address", ":0", "desired controller address, `host:port` or `:port`")
        // Default for -workbench2-source is where `arvados-server
        // install` puts its checkout.