rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
6.04k stars 285 forks source link

User's home path with space crashes buildkitd #7332

Open educhoko91 opened 3 months ago

educhoko91 commented 3 months ago

Actual Behavior

Rancher Desktop cannot start on Windows if the user's home path has spaces. It creates a wrong configuration for buildkitd

log_file=/mnt/c/Users/Eduardo Liendo/AppData/Local/rancher-desktop/logs/buildkitd.log

Causing to buildkitd to exit with code 1.

Steps to Reproduce

User must have a path with spaces, Ex: C:\Users\Eduardo Liendo\ After the update to 1.15 Rancher Desktop will not start

Result

It shows this error message image With the following log: [Symbol(child-process.command)]: 'wsl.exe --distribution rancher-desktop --exec /usr/local/bin/wsl-proxy -debug false' } 2024-08-09T18:40:07.771Z: Registered distributions: Ubuntu,rancher-desktop,rancher-desktop-data 2024-08-09T18:40:08.263Z: Registered distributions: Ubuntu,rancher-desktop,rancher-desktop-data 2024-08-09T18:40:08.746Z: Registered distributions: Ubuntu,rancher-desktop,rancher-desktop-data 2024-08-09T18:40:08.746Z: data distro already registered 2024-08-09T18:40:22.146Z: Failed to convert 'C:\Users\EDUARD~1\AppData\Local\Temp\rd-resolver.conf-XXXXXXKTL8XL\resolver.conf' to a wsl path, retry #1 2024-08-09T18:40:44.447Z: WSL: executing: /usr/local/bin/wsl-service --ifnotstarted buildkitd start: Error: wsl.exe exited with code 1 The wsl-exec.log contains this log: wsl-exec.log

This is the generated buildkit config: buildkitd.txt

Expected Behavior

This line on buildkitd config should be escaped log_file=/mnt/c/Users/Eduardo Liendo/AppData/Local/rancher-desktop/logs/buildkitd.log

like this: log_file=/mnt/c/Users/Eduardo\\ Liendo/AppData/Local/rancher-desktop/logs/buildkitd.log`

Additional Information

Workaround:

Create a file in C:\Users\Eduardo Liendo\AppData\Local\rancher-desktop\provisioning

With the following script: sed -i '$c\log_file=/mnt/c/Users/Eduardo\\ Liendo/AppData/Local/rancher-desktop/logs/buildkitd.log' /etc/conf.d/buildkitd

Rancher Desktop Version

1.15

Rancher Desktop K8s Version

1.30

Which container engine are you using?

containerd (nerdctl)

What operating system are you using?

Windows

Operating System / Build Version

Windows 10

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

None

Windows User Only

No

jandubois commented 3 months ago

Investigate together with #7323, as both issues will be related to quoting.