docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.43k stars 117 forks source link

hardlink of symlink doesn't work on shared filesystems #6593

Closed yamt closed 1 year ago

yamt commented 1 year ago

Expected behavior

a test script

#! /bin/sh

set -x
touch a
ln -s a b
ln -P b c
ln -L b d
#ln b e
ls -il

expected result (taken on overlay fs /tmp)

6c8c14d84337# /work/test.sh 
+ touch a
+ ln -s a b
+ ln -P b c
+ ln -L b d
+ ls -il
total 0
3691762 -rw-r--r-- 2 root root 0 Nov 25 08:13 a
3691767 lrwxrwxrwx 2 root root 1 Nov 25 08:13 b -> a
3691767 lrwxrwxrwx 2 root root 1 Nov 25 08:13 c -> a
3691762 -rw-r--r-- 2 root root 0 Nov 25 08:13 d
6c8c14d84337# 

Actual behavior

with "Use gRPC FUSE for file sharing", ln command fails with EIO. linkat syscall failed. but for some reasons a hardlink to the symlink target is created in the underlying filesystem. (the underlying filesystem is case-sensitive apfs, if it matters.)

6c8c14d84337# /work/test.sh
+ touch a
+ ln -s a b
+ ln -P b c
ln: failed to create hard link 'c' => 'b': Input/output error
+ ln -L b d
+ ls -il
total 0
222293 -rw-r--r-- 3 root root 0 Nov 25 08:13 a
222294 lrwxr-xr-x 1 root root 1 Nov 25 08:13 b -> a
222293 -rw-r--r-- 3 root root 0 Nov 25 08:13 c
222293 -rw-r--r-- 3 root root 0 Nov 25 08:13 d
6c8c14d84337# 

without "Use gRPC FUSE for file sharing", it looks similar. but a bit worse about cache inconsintency.

469fa803ef95# /work/test.sh 
+ touch a
+ ln -s a b
+ ln -P b c
ln: failed to create hard link 'c' => 'b': Input/output error
+ ln -L b d
+ ls -il
ls: cannot access 'c': No such file or directory
total 0
222299 -rw-r--r-- 3 root root 0 Nov 25 08:16 a
222300 lrwxrwxrwx 1 root root 1 Nov 25 08:16 b -> a
     ? -????????? ? ?    ?    ?            ? c
222299 -rw-r--r-- 3 root root 0 Nov 25 08:16 d
469fa803ef95# 

Information

100% reproducible for me. i don't know if it's a new problem or not. i happened to have noticed it today.

Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0014: are the backend processes running?
[PASS] DD0007: is the backend responding?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[PASS] DD0012: is the VM networking working?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0019: is the com.docker.vmnetd process responding?
[PASS] DD0033: does the host have Internet access?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[PASS] DD0017: can a VM be started?
[PASS] DD0016: is the LinuxKit VM running?
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0032: do Docker networks overlap with host IPs?
No fatal errors detected.

Steps to reproduce the behavior

see above.

yamt commented 1 year ago

i don't know if it's a new problem or not. i happened to have noticed it today.

it seems that this is not new: https://github.com/docker/for-mac/issues/3553

docker-robott commented 1 year ago

There hasn't been any activity on this issue for a long time. If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment. If not, this issue will be closed in 30 days.

Prevent issues from auto-closing with a /lifecycle frozen comment.

/lifecycle stale

docker-robott commented 1 year ago

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked