{"record":{"id":"6e54f295978e6657","repo":"juicedata/juicefs","slug":"parent-directory-s-of-mount-point-s-does-not-exi","errorCode":null,"errorMessage":"Parent directory %s of mount point %s does not exist","messagePattern":"Parent directory (.+?) of mount point (.+?) does not exist","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/winfsp/winfs.go","lineNumber":1183,"sourceCode":"\tmountVolumeName := filepath.VolumeName(conf.Mountpoint)\n\tmountPointIsDrive := isDriveByVolumeName(conf.Mountpoint)\n\tif mountPointIsDrive {\n\t\tconf.Mountpoint = mountVolumeName\n\t}\n\n\tif !mountPointIsDrive && mountAsNetworkDrive {\n\t\treturn fmt.Errorf(\"Cannot mount to a local directory when --as-local-volume is not set\")\n\t}\n\n\tif !mountPointIsDrive {\n\t\tif _, err := os.Stat(conf.Mountpoint); err == nil {\n\t\t\treturn fmt.Errorf(\"Mount point %s cannot be an existing folder\", conf.Mountpoint)\n\t\t}\n\n\t\t// the parent directory of the mount point must exist\n\t\tparentDir := filepath.Dir(conf.Mountpoint)\n\t\tif _, err := os.Stat(parentDir); os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"Parent directory %s of mount point %s does not exist\", parentDir, conf.Mountpoint)\n\t\t}\n\t}\n\n\tlogger.Debugf(\"mount point: %s, mountPointIsDrive: %v, options: %s\", conf.Mountpoint, mountPointIsDrive, options)\n\texitOk := host.Mount(conf.Mountpoint, []string{\"-o\", options})\n\tif exitOk {\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"juicefs mount command exit with error, please check the log for details\")\n}\n\nconst winfspSecurityDescriptor = \"D:P(A;;RPWPLC;;;WD)\"\n\nfunc updateWinFspRegService(winfspServiceName string, cmdLine string, alias string, logPath string, asNetworkDrive bool) error {\n\tregKeyPath := \"SOFTWARE\\\\WOW6432Node\\\\WinFsp\\\\Services\\\\\" + winfspServiceName\n\tk, err := registry.OpenKey(registry.LOCAL_MACHINE, regKeyPath, registry.ALL_ACCESS)\n\tif err != nil {","sourceCodeStart":1165,"sourceCodeEnd":1201,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/winfsp/winfs.go#L1165-L1201","documentation":"For a non-drive mountpoint that does not already exist, the immediate parent directory of the mount point must exist so WinFsp can create the mount point inside it. If os.Stat(parentDir) reports IsNotExist, the mount is aborted with this error.","triggerScenarios":"Mounting to a deep path (e.g. C:\\a\\b\\jfs) where C:\\a\\b does not exist; only the mountpoint itself is auto-created, not its ancestors.","commonSituations":"Typos in the parent path; using a fresh drive/root where intermediate directories were never created; scripts that only mkdir the leaf.","solutions":["Create the parent directory first: mkdir <parentDir> (or md C:\\a\\b).","Correct any typo in the mountpoint path.","In automation, pre-create all ancestor directories but not the final mount point.","Choose an existing parent (e.g. C:\\) for simple setups."],"exampleFix":"// shell\n# before\njuicefs mount sqlite3://test.db C:\\a\\b\\jfs --as-local-volume\n# after\nmkdir C:\\a\\b\njuicefs mount sqlite3://test.db C:\\a\\b\\jfs --as-local-volume","handlingStrategy":"validation","validationCode":"// PowerShell: ensure parent directory exists before mount\n$mp = 'C:\\a\\b\\jfs'\n$parent = Split-Path $mp -Parent\nif (-not (Test-Path $parent)) { New-Item -ItemType Directory -Path $parent | Out-Null }","typeGuard":null,"tryCatchPattern":"if err := runMount(); err != nil && strings.Contains(err.Error(), \"Parent directory\") {\n    os.MkdirAll(filepath.Dir(mp), 0755)\n    err = runMount()\n}","preventionTips":["Create all ancestor directories but not the final mount point.","Double-check drive/path spelling in scripts.","Use existing parents like C:\\ for simple setups.","Add a pre-mount step that mkdirs the parent only."],"tags":["windows","winfsp","mount","filesystem"],"backgroundTag":"directory-not-found","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}