config: Improve error message when test socket creation fails
When Gitaly starts up, it will verify that it can indeed create Unix
sockets in its runtime directory. This check is required because Unix
systems have strict limits on Unix socket path lengths due to struct sockaddr_un
's sun_path
is a capped character array. On macOS this
limit is at 104 characters, while Linux has a limit of 108 characters,
both of which are easy to exceed.
But while we do have these sanity checks in place, the error message we
return is really hard for an administrator to interpret because all it
talks about is an invalid argument
passed to bind(3P). So ultimately,
the administrator likely won't make the connection between the runtime
directory being too long and an invalid argument
.
Improve this error message by catching EINVAL returned by net.Listen()
and providing a readable error message that explicitly tells the admin
that the issue is most likely that the path is too long and that the
runtime directory should be changed.
Part of gitlab-development-kit#1480 (closed).