Open xiaoyanjia-94 opened 3 months ago
It's more like a bug (or maybe by design, IDK) of NFS server, because it returns OK for mount request with a regular file as the dirpath here.
error log:
2024/06/07 18:01:31.704360 juicefs[94967]
We will leave this issue as it is for now, because it is not simple and is only encountered in a very specific scenario.
When the 1.txt file already exists in the DST NFS directory,juicefs sync error happened。
JuiceFS version: 1.2.0-rc1+2024-06-03.f5bf1d03e88 ----cmd/sync.go ---- The bug may occur here 375 store, err := object.CreateStorage(name, endpoint, accessKey, secretKey, token) 376 if name == "nfs" && err != nil { 377 p := u.Path 378 for err != nil && strings.Contains(err.Error(), "MNT3ERR_NOENT") { 379 p = filepath.Dir(p) 380 store, err = object.CreateStorage(name, u.Host+p, accessKey, secretKey, token) 381 } 382 if err == nil { 383 store = object.WithPrefix(store, u.Path[len(p):]) 384 } 385 }
When the 1.txt file already exists in the destination NFS directory, line 375 does not return an MNT3ERR_NOTDIR error as expected. Instead, it returns nil and the go-nfs-client proceeds to mount the NFS storage client normally, even in an abnormal situation. Subsequently, an error arises during the data copying process.