-
Notifications
You must be signed in to change notification settings - Fork 182
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
ssh error: <name> too long for Unix domain socket #1199
Comments
We had #949 before. Seems like hostnames can consist of up to 253 characters while Unix domain socket paths are limited to 108 characters (or 104 on MacOS). labgrid constructs custom ControlPaths using the hostname. I guess hashing the hostname should be okay. @Emantor You implemented the SSH connections, what do you think? |
Yep, sounds like a sound idea. |
I tried hashing today and that didn't help. The real problem is the length of the path that tempfile.mkdtemp returns :-( Trying to figure out if there's a way to shorten that up |
I don't think you can tell tempfile to make a shorter path. A suggestion I found elsewhere was to just put the socket in the cwd. I tried that and it worked for me. Here's the diff:
|
What does The directory name created in that directory should always be 15 characters long ( How long is the longest hostname in your case? |
On an Ubuntu 20.04 machine it returns
On my macbook pro it returns:
which is 48 characters. A typical fully qualified hostname for one of our exporter machines is 29 characters, for a total of 48+29 = 77 characters. The full socket path, however, comes out even longer, looking something like this:
that's 119 characters. |
Any update on this? |
No idea where
I guess there's not a lot we can do about this, apart from using a different parent directory, but creating control sockets in unexpected locations (that work on both platforms) is not really a nice solution. I'm a little hesitant. We've never advertised MacOS support, but we merged some PRs with minor fixes for MacOS. @jluebbe @Emantor What do you think about this? |
That suffix on the hostname seems to just be another quick of macOS. Other people have this same "path too long" problem on macOS and they seem to solve it by simply hard-coding things to use https://search.brave.com/search?q=macos+%22too+long+for+Unix+domain+socket%22 Specifically: https://docs.tarmak.io/known-issues/path-too-long.html |
We gave up on MacOS and switched to Linux. This seems like a general MacOS problem. Whoever came up with that temp file path did not consider the limitation on unix domain socket path length. |
My corporate network has some long usernames and hostnames and the default settings for ssh uses a
ControlPath
that includes those long names. This can result in socket names that are too long which gives the error in the title of this issue. I found the solution to this which is to setControlPath=~/.ssh/master-socket/%C
but changing my.ssh/config
file does not change the behavior of labgrid. Somewhere in the labgrid code, I guess, theControlPath
needs to be changed to use%C
The text was updated successfully, but these errors were encountered: