rancher-sandbox / rancher-desktop

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

No such file or directory #716

Open JohnPhilipPearson opened 3 years ago

JohnPhilipPearson commented 3 years ago

Pulling up an interactive session, it works but throws "No such file or directory"? nerdctl exec -it rdb redis-cli ash: cd: line 1: can't cd to /Users/username/Desktop/folder1/folder2/folder2/folder3: No such file or directory 127.0.0.1:6379>

jandubois commented 3 years ago

Is any of the directories a symlink to a place not under /Users/username?

I have the same issue because some of my folders are symlinks to an external SSD array, e.g.

$ ls -ld ~/suse
lrwxr-xr-x  1 jan  staff  26  7 Feb  2020 /Users/jan/suse -> /Volumes/ThunderBlade/suse

So if my current working directory is anywhere below that mountpoint I get the same error:

ash: cd: line 1: can't cd to /Users/jan/suse/lima: No such file or directory

This happens because only ~ is mounted into the VM, so you can't follow the symlinks inside because the target directories aren't mounted as well.

gereonvey commented 3 years ago

I'm having a problem as well with volumes.

$ cd ~
$ nerdctl run -it --rm -v $PWD:/data alpine
/ # ls /data
Library
/ # ls /data/Library/Caches/rancher-desktop/k3s/
/ # exit
$ ls $PWD
Applications
Desktop
Documents
Downloads
Library
Movies
Music
[ ... abbreviated ... ]

So the container only sees the ~/Library/Caches/rancher-desktop/k3s/ path. Everything outside this path leads to the "No such file or directory" error @JohnPhilipPearson mentioned above.

$ cd ~/Documents
$ nerdctl run -it --rm -v $PWD:/data alpine
ash: cd: line 1: can't cd to /Users/xxxxx/Documents: No such file or directory
FATA[0000] OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:59: mounting "/Users/xxxxx/Documents" to rootfs at "/data" caused: stat /Users/xxxxx/Documents: no such file or directory: unknown 
$ 

This is with Rancher Desktop v0.5 on macOS Big Sur 11.6, trying to replace Docker Desktop

phaneendra commented 3 years ago

Is any of the directories a symlink to a place not under /Users/username?

I have the same issue because some of my folders are symlinks to an external SSD array, e.g.

$ ls -ld ~/suse
lrwxr-xr-x  1 jan  staff  26  7 Feb  2020 /Users/jan/suse -> /Volumes/ThunderBlade/suse

So if my current working directory is anywhere below that mountpoint I get the same error:

ash: cd: line 1: can't cd to /Users/jan/suse/lima: No such file or directory

This happens because only ~ is mounted into the VM, so you can't follow the symlinks inside because the target directories aren't mounted as well.

I dont know if symlinks are a problem, since in my system I don't have symlinks but still fails with the same error

cjheppell commented 3 years ago

The same thing has been happening to me when my Mac wakes from sleep overnight. I'm guessing this is some weird state the VM gets into after waking up?

Running macOS Big Sur 11.6.

Resetting kubernetes in the Rancher Desktop GUI fixes this for me, but it seems I lose my docker image cache which is a shame.

image

I'm hoping to replace Docker desktop for Mac with Rancher Desktop, but having to do this every morning and lose my cache is really problematic.

EDIT: I've also got no symlinks to my directories on my filesystem (at least, not in the path where the error is occurring), so I don't think that's related.

ppiotrow commented 3 years ago

@cjheppell I have the same every morning and restart of Rancher Desktop helps. My simplified script (docker == alias for nerdctl).

docker run --rm  -p 8888:8888 -p 4040:4040 \
-e JUPYTER_ENABLE_LAB=yes \
-v "$(pwd)"/notebooks:/home/jovyan/work \
jupyter/pyspark-notebook:lab-3.0.16
ash: cd: line 1: can't cd to /Users/me/IdeaProjects/my-project: No such file or directory
FATA[0000] OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/Users/me/IdeaProjects/my-project/notebooks" to rootfs at "/home/jovyan/work" caused: stat /Users/me/IdeaProjects/my-project/notebooks: no such file or directory: unknown 
jandubois commented 3 years ago

I think this may be caused by an ssh timeout, which would break the sshfs connection that implements the mounted directories. This would have the same root cause as #853.

gereonvey commented 2 years ago

Same happens here after a long time (hours) of inactivity (with regards to RD :-) ). I'm not aware of my laptop sleeping during that time.

$ nerdctl run --rm -it --volume ${PWD}:/usr/src/app --workdir /usr/src/app susedoc/ci:latest /bin/bash -c "daps -d DC-InterestingTopicHere pdf --draft"
ash: cd: line 1: can't cd to /Users/me/Documents/git/repodir: No such file or directory
FATA[0000] OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/Users/me/Documents/git/repodir" to rootfs at "/usr/src/app" caused: stat /Users/me/Documents/git/repodir: no such file or directory: unknown 

RD 0.6.1

cjheppell commented 2 years ago

I've since swapped to using colima instead of rancher desktop, as I don't always need a Kubernetes environment - just Docker, and minikube works well with colima using the docker driver.

Interestingly, I'm not hitting this issue at all even though it seems rancher-desktop is using lima under the covers.

Perhaps there's some difference in how rancher desktop is using lima versus colima?

Lima info ``` $ limactl info { "version": "0.7.4", "defaultTemplate": { "arch": "x86_64", "images": [ { "location": "~/Downloads/impish-server-cloudimg-amd64.img", "arch": "x86_64" }, { "location": "~/Downloads/impish-server-cloudimg-arm64.img", "arch": "aarch64" }, { "location": "https://cloud-images.ubuntu.com/impish/current/impish-server-cloudimg-amd64.img", "arch": "x86_64" }, { "location": "https://cloud-images.ubuntu.com/impish/current/impish-server-cloudimg-arm64.img", "arch": "aarch64" } ], "cpus": 4, "memory": "4GiB", "disk": "100GiB", "mounts": [ { "location": "~" }, { "location": "/tmp/lima", "writable": true } ], "ssh": { "loadDotSSHPubKeys": true, "forwardAgent": false }, "firmware": {}, "video": { "display": "none" }, "containerd": { "system": false, "user": true, "archives": [ { "location": "https://github.com/containerd/nerdctl/releases/download/v0.14.0/nerdctl-full-0.14.0-linux-amd64.tar.gz", "arch": "x86_64", "digest": "sha256:3423cb589bb5058ff9ed55f6823adec1299fe2e576612fc6f706fe07eddd398b" }, { "location": "https://github.com/containerd/nerdctl/releases/download/v0.14.0/nerdctl-full-0.14.0-linux-arm64.tar.gz", "arch": "aarch64", "digest": "sha256:32898576fa89392d1af8c21ff3854c0f54d2c66c0de87598be813f25051366e5" } ] }, "network": {}, "useHostResolver": true, "propagateProxyEnv": true }, "limaHome": "/Users/chris.heppell/.lima" } ```
MatthewJSalerno commented 2 years ago

Resetting kubernetes in the Rancher Desktop GUI fixes this for me

Restarting Rancher Desktop seems to get me past this issue. I'm not sure if this impacts caches since I'm on day 2 of testing this thing out.

dlouzan commented 2 years ago

Got this also recently, anytime the laptop goes to sleep overnight with a running compose setup. The containers show on a nerdctl ps but no access to them is possible, until restarting rancher desktop.

corrydiehl commented 2 years ago

Confirmed, after a period of inactivity or laptop sleep mode, nerdctl build errors with "no such file or directory". Restarting Rancher Desktop resolves it but is obviously not the intended behavior.

starcraft66 commented 2 years ago

Running into this on my M1 macbook after it goes to sleep with its (presumably) aggressive power management. Restarting rancher desktop gets me back up and running but it's still annoying to have to wait a minute.

juce commented 2 years ago

Seeing it on both M1 Macbook Air and on Intel Macbook Pro. Restarting Rancher Desktop works, but is there an alternative way? (so that lima vm and kubernetes both keep running) Thanks.

mrballcb commented 2 years ago

I wanted to comment that most of the time, docker commands work fine after waking up the laptop in the morning. For me, the issue is that after a few hours of use, it stops. I was in the middle of running an ansible command in a container and the docker daemon on the other end of the socket just went away. The /var/run/docker.sock symlink is still there and pointing to the correct socket, but nothing is responding on that socket any longer.

khalo-sa commented 2 years ago

I've since swapped to using colima instead of rancher desktop, as I don't always need a Kubernetes environment - just Docker, and minikube works well with colima using the docker driver.

Interestingly, I'm not hitting this issue at all even though it seems rancher-desktop is using lima under the covers.

Perhaps there's some difference in how rancher desktop is using lima versus colima?

Lima info

Same for me: Facing no problems when running Colima while both, Colima and Rancher Desktop, use a Lima VM. Would definitely look in that direction for the source of the problem.

juce commented 2 years ago

fwiw, not seeing this issue with 1.0.1 so far. Looking good... Nevermind, spoke too soon. Still happening.

codecraft21 commented 2 years ago

Similar issue on WSLg, Windows 11, Rancher Desktop 1.1.1, nerdctl 0.17.0

$ nerdctl run -ti --rm -v $PWD:/root -w /root alpine/httpie https://httpbin.org/gzip
FATA[0000] failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/mnt/wslg/rancher-desktop/run/nerdctl-tmp.1751566901/input.1809479351" to rootfs at "/root" caused: stat /mnt/wslg/rancher-desktop/run/nerdctl-tmp.1751566901/input.1809479351: no such file or directory: unknown
KebbleyTea commented 2 years ago

I have same issue as @codecraft21, but also running a build shows similar issue error as others, but on Windows. Tried wiping it out, no luck there.

WSLG Rancher Desktop 1.2.0

nerdctl build .
[+] Building 0.0s (0/0)
error: could not find /mnt/wslg/rancher-desktop/run/nerdctl-tmp.3861506014/input.2779671521: stat /mnt/wslg/rancher-desktop/run/nerdctl-tmp.3861506014/input.2779671521: no such file or directory

Weirdly, it does exist.

sudo ls -al /mnt/wslg/rancher-desktop/run/nerdctl-tmp.3861506014/input.2779671521
total 8
drwxr-xr-x 2 dev dev 4096 Mar 23 23:23 .
drwx------ 3 dev dev   60 Mar 23 23:23 ..
-rw-r--r-- 1 dev dev   78 Mar 23 23:24 Dockerfile

One thing I did spot, was by me chown -R dev:dev /mnt/wslg/rancher-desktop/ I was able to progress further, but now I'm hitting other issues

nerdctl build .
2022/03/24 00:18:52 Error parsing arguments: Got unexpected euid 1000
[+] Building 0.1s (2/2) FINISHED
 => [internal] load build definition from Dockerfile                                                                                              0.0s
 => => transferring dockerfile: 2B                                                                                                                0.0s 
 => CANCELED [internal] load .dockerignore                                                                                                        0.0s 
error: failed to solve: failed to read dockerfile: open /tmp/buildkit-mount694379677/Dockerfile: no such file or directory

If this is completely unrelated to actual issue at hand please disregard, just thought error looked similar and thought would share the chown part

briansorahan commented 1 year ago

I'm getting this error when I run nerdctl and my cwd is the filesystem I created under /Volumes (on mac m1). I do all my dev in this volume because it's a case-sensitive filesystem, so would need to figure out how to get it mounted into the VM to be able to use nerdctl in my workflow Any help is much appreciated!