Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unix-socket maximal path length exceeded when cloudsql-proxy tries to open a unix socket in the directory specified by -dir parameter #747

Closed
Manan007224 opened this issue Apr 20, 2021 · 2 comments · Fixed by #766
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: docs Improvement to the documentation for an API.

Comments

@Manan007224
Copy link

Description

When we start cloudsql-proxy using unix sockets using this command

./cloud_sql_proxy -dir=/cloudsql -instances=INSTANCE_CONNECTION_NAME
-credential_file=PATH_TO_KEY_FILE &

cloudsql-proxy opens a unix socket in the path /cloudsql/INSTANCE_CONNECTION_NAME. However unix-socket paths have a path lenght limit dependent on the platform it runs. If the unix socket path length exceeds the limit cloudsql-proxy throws the following error :-
bind: invalid argument.

While this could be solved by overriding the -dir parameter and provinding an absolute path in the -instance parameter, the issue of unix socket path limit should be documented somewhere, so that the users are aware of this.

@Manan007224 Manan007224 added the type: docs Improvement to the documentation for an API. label Apr 20, 2021
@enocom enocom added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Apr 20, 2021
@enocom
Copy link
Member

enocom commented Apr 21, 2021

Thanks for the bug report @Manan007224. It seems like the proxy could return a better error, in addition to whatever documentation changes we make.

@enocom
Copy link
Member

enocom commented Apr 28, 2021

Here are some details about the unix socket path length. Adding this here for reference:

https://unix.stackexchange.com/a/367012/26069

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: docs Improvement to the documentation for an API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants