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

"Starting virtual machine" step fails due to SSH socket path being too long. #797

Open
az82 opened this issue Oct 14, 2021 · 34 comments
Open
Labels
area/config kind/bug Something isn't working platform/macos triage/next-candidate Discuss if it should be moved to "Next" milestone

Comments

@az82
Copy link

az82 commented Oct 14, 2021

Rancher Desktop shows the "Starting virtual machine" until timeout.

~/Library/Application\ Support/rancher-desktop/lima/0/ha.stderr.log contains the following lines:

{"level":"debug","msg":"stdout=\"\", stderr=\"unix_listener: path \\\"/Users/od.andreas.zitzelsberger/Library/Application Support/rancher-desktop/lima/0/ssh.sock.Rcl2KoI2X03Sbknt\\\" too long for Unix domain socket\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"unix_listener: path \\\"/Users/XXXXXXXXXXXXXXXXXXXXXXXX/Library/Application Support/rancher-desktop/lima/0/ssh.sock.Rcl2KoI2X03Sbknt\\\" too long for Unix domain socket\\r\\n\": exit status 255","time":"2021-10-14T15:28:04+02:00"}

with XXXXXXXXXXXXXXXXXXXXXXXX being my user name. Please note that the path /Users/XXXXXXXXXXXXXXXXXXXXXXXX/Library/Application Support/rancher-desktop/lima/0/ssh.sock.Rcl2KoI2X03Sbknt has 109 characters. The path length for Unix Domain Sockets is limited to 108 characters (Linux) or 104 characters (Mac). Unfortunately, my user name is managed and cannot be changed. While the user name is long, I believe it's length is not uncommon.

To Reproduce

  • Start Rancher Desktop on a Mac with a user name that has 21 characters or more.

Result
Rancher Desktop shows the "Starting virtual machine" until timeout.

Expected behaviour
Rancher Desktop starts up properly.

Screenshots
grafik

Setup (please complete the following information):

  • macOS 11.6
  • Rancher Desktop 0.6.0
  • Kubernetes 1.21.5
@gaktive gaktive added the kind/bug Something isn't working label Oct 14, 2021
@gaktive gaktive added this to the v0.7.0 milestone Oct 14, 2021
@jandubois
Copy link
Member

Once lima-vm/lima#335 is merged, and Lima in RD updated, it will be possible to replace the lima directory with a symlink to a different location with a shorter path.

RD should detect this situation automatically, and create an alternate directory and the symlink, e.g. ~/.rd-lima.

@jandubois jandubois removed their assignment Oct 14, 2021
@jandubois
Copy link
Member

Once lima-vm/lima#335 is merged, and Lima in RD updated, it will be possible to replace the lima directory with a symlink to a different location with a shorter path.

lima in RD has been updated, so it will be possible to work around this limitation in RD 0.7.0.

RD should detect this situation automatically, and create an alternate directory and the symlink, e.g. ~/.rd-lima.

I want to keep this bug report open because I think this should be handled automatically and not require intervention by the user.

@jandubois jandubois removed this from the v0.7.0 milestone Nov 25, 2021
@lreimer
Copy link

lreimer commented Dec 17, 2021

Just tried with 0.7.0 Release. Unfortunately still not working :(

time="2021-12-17T08:40:51+01:00" level=debug msg="interpreting argument \"/Users/mario-leander.reimer/Library/Application Support/rancher-desktop/lima/_config/0.yaml\" as a file path for instance \"0\""
time="2021-12-17T08:40:51+01:00" level=fatal msg="instance name \"0\" too long: \"/Users/mario-leander.reimer/Library/Application Support/rancher-desktop/lima/0/ssh.sock.1234567890123456\" must be less than UNIX_PATH_MAX=104 characers, but is 104"
2021-12-17T07:40:51.618Z: + limactl --debug start --tty=false /Users/mario-leander.reimer/Library/Application Support/rancher-desktop/lima/_config/0.yaml
2021-12-17T07:40:51.619Z: Error: /Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl exited with code 1
2021-12-17T07:40:51.619Z: Error starting lima: Error: /Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl exited with code 1
    at ChildProcess.<anonymous> (/Applications/Rancher Desktop.app/Contents/Resources/app.asar/dist/app/background.js:13:24844)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)

@jandubois
Copy link
Member

It should be possible to work around it now, even though it is not automatic.

I've just moved the lima home directory to ~/.rdlima:

$ mv ~/Library/Application\ Support/rancher-desktop/lima ~/.rdlima
$ ln -s ~/.rdlima ~/Library/Application\ Support/rancher-desktop/lima

Please try that and let me know if it fixes the issue for you!

Please keep the bug open though, because I think RD should do something like this automatically, but I don't know when we will get around to it.

@az82
Copy link
Author

az82 commented Dec 17, 2021

I can confirm that the work around works for me. Thanks!

@lreimer
Copy link

lreimer commented Dec 20, 2021

Updated to 0.7.1 to today. Tried the workaround. Unfortunately, it did not work for me. Crashed straight away, the relevant log files are empty.

@AndreiChenchik
Copy link

Just as a report:

time="2022-01-16T13:45:04+01:00" level=debug msg="interpreting argument \"/Volumes/External/Users/gumlooter/Library/Application Support/rancher-desktop/lima/_config/0.yaml\" as a file path for instance \"0\""
time="2022-01-16T13:45:04+01:00" level=fatal msg="instance name \"0\" too long: \"/Volumes/External/Users/gumlooter/Library/Application Support/rancher-desktop/lima/0/ssh.sock.1234567890123456\" must be less than UNIX_PATH_MAX=104 characers, but is 110"
2022-01-16T12:45:04.288Z: + limactl --debug start --tty=false /Volumes/External/Users/gumlooter/Library/Application Support/rancher-desktop/lima/_config/0.yaml
2022-01-16T12:45:04.290Z: Error: /Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl exited with code 1
2022-01-16T12:45:04.290Z: Error starting lima: Error: /Applications/Rancher Desktop.app/Contents/Resources/resources/darwin/lima/bin/limactl exited with code 1
    at ChildProcess.<anonymous> (/Applications/Rancher Desktop.app/Contents/Resources/app.asar/dist/app/background.js:1:8014)
    at ChildProcess.emit (node:events:394:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)

Had the same issue at 1.0.0-beta.1, workaround from @jandubois fixed that.

Thank you!

@giorgiocl
Copy link

I can confirm that I had the same issue that @AndreiChenchik with the 1.0.0-beta.1, but with the solution given by @jandubois all it's working now.!

Thanks !

@lreimer
Copy link

lreimer commented Jan 25, 2022

I have now also updated and tried the 1.0.0-beta.1 and can also confirm that the described solution / workaround works. Thanks!

@starcraft66
Copy link

Just ran into this and can confirm the symlink solution posted above works!

@jandubois jandubois added this to the Later milestone Jan 27, 2022
@jandubois jandubois added the triage/next-candidate Discuss if it should be moved to "Next" milestone label Jan 29, 2022
jsoref added a commit to jsoref/rancher-desktop that referenced this issue Jan 30, 2022
@gaktive gaktive removed the triage/next-candidate Discuss if it should be moved to "Next" milestone label Feb 8, 2022
@gaktive gaktive changed the title "Starting virtual machine" step fails due to SSH socket path being to long. "Starting virtual machine" step fails due to SSH socket path being too long. Feb 22, 2022
@gaktive gaktive modified the milestones: Later, Next Feb 22, 2022
@uvulpos
Copy link

uvulpos commented May 9, 2023

It should be possible to work around it now, even though it is not automatic.

I've just moved the lima home directory to ~/.rdlima:

$ mv ~/Library/Application\ Support/rancher-desktop/lima ~/.rdlima
$ ln -s ~/.rdlima ~/Library/Application\ Support/rancher-desktop/lima

Please try that and let me know if it fixes the issue for you!

Please keep the bug open though, because I think RD should do something like this automatically, but I don't know when we will get around to it.

I already tried the workaround and also as @anthonyrea described, but it still does not work. And I also reproduced the same issue on another company laptop (both MacOS). Would be glad, if it was possible to have a deeper look and integrate a fix into rancher. But its strage that at the end there is like a 1234567890123456 String. If you could remove that some people would already have access to it

@ericpromislow
Copy link
Contributor

Possible zero-config solution in branch 797-handle-alternative-limapath

@jwieder
Copy link

jwieder commented Aug 9, 2023

This is still occurring in intel macos w/ rancher dektop v1.9.1.

Before the "fix": nonsense length error caused by inclusion of a 16 character string "1234567890123456".
After the "fix": XXX/.rdlima/lima/lima.yaml: no such file or directory

AFAICT no file lima.yaml is created by Rancher Desktop in my local whether I create symlink directories before installing rancher, after installing rancher but before runtime, or after runtime.

downgrading to earlier version 1.6.2 & attempting the same fix from #3716 results in the same error.

@Garma00
Copy link

Garma00 commented Sep 19, 2023

Hi, Reset kubernetes button inside the Troubleshooting section worked for me (mac m1)

@MrR0807
Copy link

MrR0807 commented Oct 27, 2023

Still occurs on 1.10.0.

@arjccpaul
Copy link

It should be possible to work around it now, even though it is not automatic.
$ mv ~/Library/Application\ Support/rancher-desktop/lima ~/.rdlima
$ ln -s ~/.rdlima ~/Library/Application\ Support/rancher-desktop/lima

Yes it's really a Awesome solution, its worked for me thank you ### @jandubois

@reslys
Copy link

reslys commented Mar 28, 2024

I'm still experiencing the same issue on Mac Intel today, this solution worked for me #797 (comment). Will leave a comment here to see if there are any updates to this issue.

@daleksan-s1
Copy link

The link name (found in the source) is lima-rd, not rdlima

@gunamata gunamata added the triage/next-candidate Discuss if it should be moved to "Next" milestone label Jun 7, 2024
@tgruenen
Copy link

I had some trouble with #797 (comment), so I post here all my steps. I hope this will help you.

Reset Rancher Desktop: "Troubleshooting / Factory Reset", close Rancher Desktop or run the following steps before you
start Rancher Desktop!

rm -r ~/.rdlima
rm -r ~/Library/Application\ Support/rancher-desktop
mkdir ~/.rdlima
mkdir ~/Library/Application\ Support/rancher-desktop
ln -s ~/.rdlima ~/Library/Application\ Support/rancher-desktop/lima

Restart Rancher Desktop
Check Rancher Desktop logs
Check some context

kubectl config get-contexts
CURRENT   NAME                                                               CLUSTER                                                            AUTHINFO                                                           NAMESPACE
*         rancher-desktop                                                    rancher-desktop                                                    rancher-desktop                           
 
kubectl config use-context rancher-desktop
 
docker context ls
NAME                DESCRIPTION                               DOCKER ENDPOINT                                      ERROR
default *           Current DOCKER_HOST based configuration   unix:///Users/<username>/.rd/docker.sock

Restart Rancher Desktop

docker context ls
NAME              DESCRIPTION                               DOCKER ENDPOINT                                      ERROR
default *         Current DOCKER_HOST based configuration   unix:///Users/<username>/.rd/docker.sock  
rancher-desktop   Rancher Desktop moby context              unix:///Users/<username>/.rd/docker.sock  
Warning: DOCKER_HOST environment variable overrides the active context. To use a context, either set the global --context flag, or unset DOCKER_HOST environment variable.

Docker default context can be set by export environment variable
DOCKER_HOST=unix:///Users//.rd/docker.sock

reopen shell

So have fun

@lagonzalezr
Copy link

lagonzalezr commented Jun 21, 2024

It should be possible to work around it now, even though it is not automatic.

I've just moved the lima home directory to ~/.rdlima:

$ mv ~/Library/Application\ Support/rancher-desktop/lima ~/.rdlima
$ ln -s ~/.rdlima ~/Library/Application\ Support/rancher-desktop/lima

Please try that and let me know if it fixes the issue for you!

Please keep the bug open though, because I think RD should do something like this automatically, but I don't know when we will get around to it.

this fixed my issue today running on M3 rancher Version 1.14.2, thank you!!

@itsmartinhi
Copy link

not gonna lie, the fact that this issue still persists is kinda rough.

It should be possible to work around it now, even though it is not automatic.

I've just moved the lima home directory to ~/.rdlima:

$ mv ~/Library/Application\ Support/rancher-desktop/lima ~/.rdlima
$ ln -s ~/.rdlima ~/Library/Application\ Support/rancher-desktop/lima

Please try that and let me know if it fixes the issue for you!

Please keep the bug open though, because I think RD should do something like this automatically, but I don't know when we will get around to it.

But the workaround still works just fine

@cassdeckard
Copy link

I want to keep this bug report open because I think this should be handled automatically and not require intervention by the user.

Two and a half years later and users still have to find this thread and then apply the manual fix in order to get Rancher Desktop running on their machine if their username is longer than 21 characters. In my org, everyone's username is [email protected] so anyone whose name isn't something short like "Li Ngo" is affected by this.

@sinewalker
Copy link

sinewalker commented Jul 9, 2024

Hi, Reset kubernetes button inside the Troubleshooting section worked for me (mac m1)

Following an upgrade to Rancher 1.14.1, I encountered a similar issue. The workaround to move lima did not resolve. Resetting k8s (and deleting the containers) worked. I'm not currently using k8s so this was okay for me, but might be a show-stopper for anyone who does?

My username is 3 characters, so I think that my problem might be different (I was not seeing the error about the Unix path limit).

@jandubois
Copy link
Member

Two and a half years later and users still have to find this thread and then apply the manual fix in order to get Rancher Desktop running on their machine if their username is longer than 21 characters.

Unfortunately true. 😞 The problem is that we have a huge number of open issues, so problems with a simple workaround don't get prioritized.

@jandubois
Copy link
Member

I think that my problem might be different

@sinewalker Please create a new issue with sufficient details to investigate rather than commenting on an unrelated issue! Thanks!

@eudinnou
Copy link

eudinnou commented Jul 16, 2024

Unfortunately I also have a long name, and I'm struggling with this issue for 2 days already.

The fix that @jandubois posted works at first, but after I change the k8s resources, I'm getting an error once it tries to restart:

error="failed to execute `ssh -O exit -p 61483 127.0.0.1`,
out=\\"Control socket connect(/Users/[my_very_long_name]/.rdlima/0/ssh.sock): No such file or directory\\\\r\\\\n\\"

Do you maybe have any tips for this one? I would like to avoid changing my name because of this 😅
Thanks!

using: Version 1.14.2 (1.14.2)

@eudinnou
Copy link

eudinnou commented Jul 16, 2024

so apparently the issue for me was because the value of the ram was too high, 64GB, I now allocated 48GB and works 🤯

@saikrishna130
Copy link

saikrishna130 commented Sep 5, 2024

It should be possible to work around it now, even though it is not automatic.

I've just moved the lima home directory to ~/.rdlima:

$ mv ~/Library/Application\ Support/rancher-desktop/lima ~/.rdlima
$ ln -s ~/.rdlima ~/Library/Application\ Support/rancher-desktop/lima

Please try that and let me know if it fixes the issue for you!

Please keep the bug open though, because I think RD should do something like this automatically, but I don't know when we will get around to it.

I had to keep the rancher-desktop open and in terminal run both the mentioned commands. then open RD and Troubleshooting then click on reset Kubernetes. Ta-da!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/bug Something isn't working platform/macos triage/next-candidate Discuss if it should be moved to "Next" milestone
Projects
None yet