GoogleCloudPlatform / cloud-sql-proxy

A utility for connecting securely to your Cloud SQL instances
Apache License 2.0
1.27k stars 346 forks source link

Include note about socket length when Unix socket fails to bind #970

Open enocom opened 2 years ago

enocom commented 2 years ago

This is a follow-on to https://github.com/GoogleCloudPlatform/cloudsql-proxy/issues/747 and a slight alternative to https://github.com/GoogleCloudPlatform/cloudsql-proxy/pull/960. When a Unix socket returns bind: invalid argument, we should include a note in the error message to check maximum socket length as a possible cause.

m4r1k commented 2 years ago

Strict double-checking around the length must be enforced. Follows the official Linux code reference and the reason why can't be more than 108 chars. https://github.com/torvalds/linux/blob/master/net/unix/af_unix.c#L291-L302