{"record":{"id":"af1db5b855eaefa3","repo":"juicedata/juicefs","slug":"failed-to-get-log-path-v","errorCode":null,"errorMessage":"failed to get log path: %v","messagePattern":"failed to get log path: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/debug.go","lineNumber":416,"sourceCode":"\t\t\t\ttimeout = time.Duration(trace+5) * time.Second\n\t\t\t}\n\t\t\tif err := reqAndSaveMetric(name, metric, pprofOutDir, timeout); err != nil {\n\t\t\t\tlogger.Errorf(\"Failed to get and save metric %s: %v\", name, err)\n\t\t\t}\n\t\t}(name, metric)\n\t}\n\treturn nil\n}\n\nfunc collectLog(ctx *cli.Context, cmd string, requireRootPrivileges bool, currDir string, uid string) error {\n\tmountdByWinSystem := runtime.GOOS == \"windows\" && uid == \"S-1-5-18\" // https://learn.microsoft.com/en-us/windows/win32/secauthz/well-known-sids\n\tif !(strings.Contains(cmd, \"-d\") || strings.Contains(cmd, \"--background\")) && !mountdByWinSystem {\n\t\tlogger.Warnf(\"The juicefs mount by foreground, the log will not be collected\")\n\t\treturn nil\n\t}\n\tlogPath, err := getLogPath(cmd)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get log path: %v\", err)\n\t}\n\tlimit := ctx.Uint64(\"limit\")\n\tretLogPath := filepath.Join(currDir, \"juicefs.log\")\n\n\tif runtime.GOOS == \"windows\" {\n\t\t// check powershell is installed\n\t\t_, err = exec.LookPath(\"powershell\")\n\t\tif err != nil {\n\t\t\tlogger.Warnf(\"Powershell is not installed, the log will not be collected\")\n\t\t\treturn nil\n\t\t}\n\n\t\tcopyArgs := []string{\"powershell\", \"-Command\", fmt.Sprintf(\"Get-Content -Tail %d %s > %s\", limit, logPath, retLogPath)}\n\t\tlogger.Infof(\"The last %d lines of %q will be collected\", limit, logPath)\n\t\ttimeoutCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\t\tdefer cancel()\n\t\treturn exec.CommandContext(timeoutCtx, copyArgs[0], copyArgs[1:]...).Run()\n\t} else {","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/debug.go#L398-L434","documentation":"Returned by collectLog during `juicefs debug` when the log file path of the mount process cannot be determined (reading the process command line / log config failed). It prevents collecting the wrong or no log file for the target mount.","triggerScenarios":"Thrown at cmd/debug.go:416 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the mount process is running with an accessible --log path","Re-run `juicefs debug` with sufficient privileges to inspect the process"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}