diff --git a/packages/envd/internal/services/filesystem/dir.go b/packages/envd/internal/services/filesystem/dir.go index 31fc449164..ca33b6136c 100644 --- a/packages/envd/internal/services/filesystem/dir.go +++ b/packages/envd/internal/services/filesystem/dir.go @@ -2,6 +2,7 @@ package filesystem import ( "context" + "errors" "fmt" "os" "path" @@ -135,7 +136,7 @@ func checkIfDirectory(path string) error { // walkDir walks the directory tree starting from dirPath up to the specified depth (doesn't follow symlinks). func walkDir(requestedPath string, dirPath string, depth int) (entries []*rpc.EntryInfo, err error) { - err = filepath.WalkDir(dirPath, func(path string, entry os.DirEntry, err error) error { + err = filepath.WalkDir(dirPath, func(path string, _ os.DirEntry, err error) error { if err != nil { return err } @@ -157,7 +158,13 @@ func walkDir(requestedPath string, dirPath string, depth int) (entries []*rpc.En } entryInfo, err := entryInfo(path) - if entry == nil { + if err != nil { + var notFoundErr *connect.Error + if errors.As(err, ¬FoundErr) && notFoundErr.Code() == connect.CodeNotFound { + // Skip entries that don't exist anymore + return nil + } + return err } diff --git a/packages/envd/main.go b/packages/envd/main.go index 1e92317141..7636bfb6fc 100644 --- a/packages/envd/main.go +++ b/packages/envd/main.go @@ -43,7 +43,7 @@ const ( ) var ( - Version = "0.4.1" + Version = "0.4.2" commitSHA string