{"record":{"id":"fae8db535952734a","repo":"juicedata/juicefs","slug":"failed-to-update-winfsp-service-registry-s","errorCode":null,"errorMessage":"Failed to update WinFsp service registry: %s","messagePattern":"Failed to update WinFsp service registry: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/winfsp/winfs.go","lineNumber":1438,"sourceCode":"\t\t\t\tcmds = append(cmds, fmt.Sprintf(\"%v\", val))\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tcmds = append(cmds, \"--alias\", \"\\\"%1\\\"\") // We put %1 here since it will be replaced by WinFsp with the alias\n\n\tif !hasCacheDir && defaultCacheDir != \"\" {\n\t\tcmds = append(cmds, \"--cache-dir\", \"\\\"\"+defaultCacheDir+\"\\\"\")\n\t}\n\n\tlogger.Debug(\"Command line for juicefs service: \", strings.Join(cmds, \" \"))\n\n\tcmdLine := strings.Join(cmds, \" \")\n\n\twinfspServiceName := \"juicefs-\" + alias\n\tif err := updateWinFspRegService(winfspServiceName, cmdLine, alias, logPath, asNetworkDrive); err != nil {\n\t\treturn fmt.Errorf(\"Failed to update WinFsp service registry: %s\", err)\n\t}\n\n\t// We need to use the \"net use\" for some users who have enabled the 'net use /persistent:yes' option for\n\t// auto-reconnecting after reboot.\n\twinFspBinPath := getWinFspBinPath()\n\tmountByNetUse := os.Getenv(\"JFS_WIN_MOUNT_VIA\") != \"winfsp-launchctl\"\n\tif !asNetworkDrive {\n\t\tmountByNetUse = false\n\t}\n\n\tif winFspBinPath == \"\" && !mountByNetUse {\n\t\treturn fmt.Errorf(`Cannot find WinFsp installation path from registry, please make sure WinFsp is installed correctly.`)\n\t}\n\n\tif !mountByNetUse {\n\t\twinfspLauncher := \"launchctl-x64.exe\"\n\t\tlogger.Debugf(\"WinFsp Bin Path: %s\", winFspBinPath)\n\t\tif winFspBinPath != \"\" {","sourceCodeStart":1420,"sourceCodeEnd":1456,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/winfsp/winfs.go#L1420-L1456","documentation":"Top-level wrapper error thrown by the mount-as-service flow when updateWinFspRegService (which performs all the registry writes of errors 750–755) returns any failure. It propagates the underlying cause, indicating the WinFsp launch service could not be registered or updated, so the mount cannot proceed via launchctl.","triggerScenarios":"Any failure inside updateWinFspRegService: os.Executable() error, any SetStringValue/SetDWordValue/DeleteValue failure on the WinFsp Services registry key (permissions, missing WinFsp, corrupt hive).","commonSituations":"Non-elevated shells; missing or broken WinFsp installation; antivirus or policy blocking registry modifications.","solutions":["Read the wrapped cause in the message and address it (most often: run elevated as Administrator).","Verify WinFsp is correctly installed and its registry hive is present; reinstall if needed.","Retry the mount; transient registry contention resolves on retry.","As an alternative, mount without service registration (interactive mount) if service-mode is not required."],"exampleFix":"// before\n> juicefs mount redis://... X:\n// Failed to update WinFsp service registry: Failed to set registry key: Access is denied.\n// after (elevated)\n> Start-Process juicefs -ArgumentList 'mount','redis://...','X:' -Verb RunAs","handlingStrategy":"try-catch","validationCode":"// precheck: WinFsp installed + writable registry\nif _, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\\WOW6432Node\\WinFsp`, registry.QUERY_VALUE); err != nil { return errors.New(\"WinFsp missing/corrupt\") }","typeGuard":null,"tryCatchPattern":"err := mountViaWinFsp(...)\nvar cause string\nif err != nil { cause = err.Error(); switch { case strings.Contains(cause, \"Access is denied\"): /* elevate */; case strings.Contains(cause, \"Cannot find WinFsp\"): /* reinstall WinFsp */ } }","preventionTips":["Verify WinFsp installation before service-mode mounts","Use elevated shells for service registration","Parse the wrapped cause from the error message to route fixes"],"tags":["windows","winfsp","registry","service"],"backgroundTag":"permission-denied","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}