juicedata/juicefs · error

Failed to update WinFsp service registry: %s

Error message

Failed to update WinFsp service registry: %s

What it means

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.

Source

Thrown at pkg/winfsp/winfs.go:1438

				cmds = append(cmds, fmt.Sprintf("%v", val))
			}
			break
		}
	}

	cmds = append(cmds, "--alias", "\"%1\"") // We put %1 here since it will be replaced by WinFsp with the alias

	if !hasCacheDir && defaultCacheDir != "" {
		cmds = append(cmds, "--cache-dir", "\""+defaultCacheDir+"\"")
	}

	logger.Debug("Command line for juicefs service: ", strings.Join(cmds, " "))

	cmdLine := strings.Join(cmds, " ")

	winfspServiceName := "juicefs-" + alias
	if err := updateWinFspRegService(winfspServiceName, cmdLine, alias, logPath, asNetworkDrive); err != nil {
		return fmt.Errorf("Failed to update WinFsp service registry: %s", err)
	}

	// We need to use the "net use" for some users who have enabled the 'net use /persistent:yes' option for
	// auto-reconnecting after reboot.
	winFspBinPath := getWinFspBinPath()
	mountByNetUse := os.Getenv("JFS_WIN_MOUNT_VIA") != "winfsp-launchctl"
	if !asNetworkDrive {
		mountByNetUse = false
	}

	if winFspBinPath == "" && !mountByNetUse {
		return fmt.Errorf(`Cannot find WinFsp installation path from registry, please make sure WinFsp is installed correctly.`)
	}

	if !mountByNetUse {
		winfspLauncher := "launchctl-x64.exe"
		logger.Debugf("WinFsp Bin Path: %s", winFspBinPath)
		if winFspBinPath != "" {

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Read the wrapped cause in the message and address it (most often: run elevated as Administrator).
  2. Verify WinFsp is correctly installed and its registry hive is present; reinstall if needed.
  3. Retry the mount; transient registry contention resolves on retry.
  4. As an alternative, mount without service registration (interactive mount) if service-mode is not required.

Example fix

// before
> juicefs mount redis://... X:
// Failed to update WinFsp service registry: Failed to set registry key: Access is denied.
// after (elevated)
> Start-Process juicefs -ArgumentList 'mount','redis://...','X:' -Verb RunAs
Defensive patterns

Strategy: try-catch

Validate before calling

// precheck: WinFsp installed + writable registry
if _, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\WOW6432Node\WinFsp`, registry.QUERY_VALUE); err != nil { return errors.New("WinFsp missing/corrupt") }

Try / catch

err := mountViaWinFsp(...)
var cause string
if err != nil { cause = err.Error(); switch { case strings.Contains(cause, "Access is denied"): /* elevate */; case strings.Contains(cause, "Cannot find WinFsp"): /* reinstall WinFsp */ } }

Prevention

When it happens

Trigger: Any failure inside updateWinFspRegService: os.Executable() error, any SetStringValue/SetDWordValue/DeleteValue failure on the WinFsp Services registry key (permissions, missing WinFsp, corrupt hive).

Common situations: Non-elevated shells; missing or broken WinFsp installation; antivirus or policy blocking registry modifications.

Understand the failure class

Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.

Related errors


AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06). Data as JSON: /api/errors/fae8db535952734a. Report an issue: GitHub.