juicedata/juicefs · error

failed to get log path: %v

Error message

failed to get log path: %v

What it means

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.

Source

Thrown at cmd/debug.go:416

				timeout = time.Duration(trace+5) * time.Second
			}
			if err := reqAndSaveMetric(name, metric, pprofOutDir, timeout); err != nil {
				logger.Errorf("Failed to get and save metric %s: %v", name, err)
			}
		}(name, metric)
	}
	return nil
}

func collectLog(ctx *cli.Context, cmd string, requireRootPrivileges bool, currDir string, uid string) error {
	mountdByWinSystem := runtime.GOOS == "windows" && uid == "S-1-5-18" // https://learn.microsoft.com/en-us/windows/win32/secauthz/well-known-sids
	if !(strings.Contains(cmd, "-d") || strings.Contains(cmd, "--background")) && !mountdByWinSystem {
		logger.Warnf("The juicefs mount by foreground, the log will not be collected")
		return nil
	}
	logPath, err := getLogPath(cmd)
	if err != nil {
		return fmt.Errorf("failed to get log path: %v", err)
	}
	limit := ctx.Uint64("limit")
	retLogPath := filepath.Join(currDir, "juicefs.log")

	if runtime.GOOS == "windows" {
		// check powershell is installed
		_, err = exec.LookPath("powershell")
		if err != nil {
			logger.Warnf("Powershell is not installed, the log will not be collected")
			return nil
		}

		copyArgs := []string{"powershell", "-Command", fmt.Sprintf("Get-Content -Tail %d %s > %s", limit, logPath, retLogPath)}
		logger.Infof("The last %d lines of %q will be collected", limit, logPath)
		timeoutCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
		defer cancel()
		return exec.CommandContext(timeoutCtx, copyArgs[0], copyArgs[1:]...).Run()
	} else {

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Ensure the mount process is running with an accessible --log path
  2. Re-run `juicefs debug` with sufficient privileges to inspect the process
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at cmd/debug.go:416 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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