{"record":{"id":"71590e95a9b6533a","repo":"juicedata/juicefs","slug":"printsid-command-is-only-supported-on-windows","errorCode":null,"errorMessage":"printsid command is only supported on Windows","messagePattern":"printsid command is only supported on Windows","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/printsid.go","lineNumber":23,"sourceCode":"\t\"runtime\"\n\n\t\"github.com/juicedata/juicefs/pkg/utils\"\n\t\"github.com/urfave/cli/v2\"\n)\n\nfunc cmdPrintSID() *cli.Command {\n\treturn &cli.Command{\n\t\tName:     \"printsid\",\n\t\tCategory: \"TOOL\",\n\t\tAction:   printSID,\n\t\tUsage:    \"Show SID info and the convected UID/GID for the current user.\",\n\t\tHidden:   true,\n\t}\n}\n\nfunc printSID(ctx *cli.Context) error {\n\tif runtime.GOOS != \"windows\" {\n\t\treturn fmt.Errorf(\"printsid command is only supported on Windows\")\n\t}\n\n\tuserSid := utils.GetCurrentUserSIDStr()\n\tgroupSid := utils.GetCurrentUserGroupSIDStr()\n\tfmt.Printf(\"Current User SID: %s, UID: %d\\n\", userSid, utils.GetCurrentUID())\n\tfmt.Printf(\"Current Group SID: %s, GID: %d\\n\", groupSid, utils.GetCurrentGID())\n\n\treturn nil\n}\n","sourceCodeStart":5,"sourceCodeEnd":33,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/printsid.go#L5-L33","documentation":"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.","triggerScenarios":"Running `juicefs printsid` (a hidden command) on Linux or macOS; the first statement in printSID returns this error whenever runtime.GOOS != \"windows\".","commonSituations":"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.","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."],"exampleFix":"// before (script)\njuicefs printsid\n// after (script)\nif [[ \"$OSTYPE\" == msys* || \"$OS\" == \"Windows_NT\" ]]; then juicefs printsid; else id; fi","handlingStrategy":"validation","validationCode":"// guard scripts: only call printsid on Windows\nif [ \"$(uname -s)\" = \"Linux\" ]; then id; else juicefs printsid; fi","typeGuard":null,"tryCatchPattern":"out, err := exec.Command(\"juicefs\", \"printsid\").Output()\nif err != nil && strings.Contains(err.Error(), \"only supported on Windows\") {\n    // fall back to POSIX id/whoami or skip the step on non-Windows\n    return nil // platform not applicable\n}","preventionTips":["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."],"tags":["windows","platform","cli","sid"],"backgroundTag":"unsupported-platform","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"}