juicedata/juicefs · error
printsid command is only supported on Windows
Error message
printsid command is only supported on Windows
What it means
The hidden 'printsid' CLI command prints the current Windows user/group SIDs alongside UID/GID. Its only purpose is Windows SID mapping, so it explicitly refuses to run on any other OS via a runtime.GOOS check. The command itself is fine; it is simply unsupported on the platform you invoked it from.
Source
Thrown at cmd/printsid.go:23
"runtime"
"github.com/juicedata/juicefs/pkg/utils"
"github.com/urfave/cli/v2"
)
func cmdPrintSID() *cli.Command {
return &cli.Command{
Name: "printsid",
Category: "TOOL",
Action: printSID,
Usage: "Show SID info and the convected UID/GID for the current user.",
Hidden: true,
}
}
func printSID(ctx *cli.Context) error {
if runtime.GOOS != "windows" {
return fmt.Errorf("printsid command is only supported on Windows")
}
userSid := utils.GetCurrentUserSIDStr()
groupSid := utils.GetCurrentUserGroupSIDStr()
fmt.Printf("Current User SID: %s, UID: %d\n", userSid, utils.GetCurrentUID())
fmt.Printf("Current Group SID: %s, GID: %d\n", groupSid, utils.GetCurrentGID())
return nil
}
View on GitHub (pinned to c9a67b23e8)
Solutions
- Run the command on a Windows machine (or a Windows container/VM), where it prints the user and group SIDs.
- On Linux/macOS there is no SID concept; use `id -u` / `id -g` (or `id`) for UID/GID instead.
- Guard any automation with a platform check so printsid is only invoked on Windows.
Example fix
// before (script) juicefs printsid // after (script) if [[ "$OSTYPE" == msys* || "$OS" == "Windows_NT" ]]; then juicefs printsid; else id; fi
Defensive patterns
Strategy: validation
Validate before calling
// guard scripts: only call printsid on Windows if [ "$(uname -s)" = "Linux" ]; then id; else juicefs printsid; fi
Try / catch
out, err := exec.Command("juicefs", "printsid").Output()
if err != nil && strings.Contains(err.Error(), "only supported on Windows") {
// fall back to POSIX id/whoami or skip the step on non-Windows
return nil // platform not applicable
} Prevention
- Mark printsid steps as Windows-only in CI (runs-on: windows) and conditionally execute.
- Document platform support in internal runbooks before including hidden commands in scripts.
- Use runtime.GOOS checks in automation code before invoking the command.
When it happens
Trigger: Running `juicefs printsid` (a hidden command) on Linux or macOS; the first statement in printSID returns this error whenever runtime.GOOS != "windows".
Common situations: Following Windows-specific documentation or a support script on a Linux/macOS machine; CI runners on Linux executing a cross-platform test script that unconditionally calls printsid; probing hidden commands discovered via binary strings.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- restore command requires Administrator or elevated privilege
- OS %s is not supported
- invalid uid %d for sid %s
- Cannot mount to a local directory when --as-local-volume is
- Unsupported ByteMultiple " + sMultiple
AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06).
Data as JSON: /api/errors/71590e95a9b6533a.
Report an issue: GitHub.