juicedata/juicefs · error

failed to create system info file %s: %v

Error message

failed to create system info file %s: %v

What it means

Returned by collectSysInfo during `juicefs debug` when the system-info.log output file cannot be created in the collection directory. It wraps the os.Create error (permissions, missing parent directory).

Source

Thrown at cmd/debug.go:456

		}
		copyArgs = append(copyArgs, "/bin/sh", "-c", fmt.Sprintf("tail -n %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()
	}
}

func collectSysInfo(ctx *cli.Context, currDir string) error {
	sysInfo := utils.GetSysInfo()
	result := fmt.Sprintf(`Platform: 
%s %s
%s`, runtime.GOOS, runtime.GOARCH, sysInfo)

	sysPath := filepath.Join(currDir, "system-info.log")
	sysFile, err := os.Create(sysPath)
	if err != nil {
		return fmt.Errorf("failed to create system info file %s: %v", sysPath, err)
	}
	defer closeFile(sysFile)
	if _, err = sysFile.WriteString(result); err != nil {
		return fmt.Errorf("failed to write system info file %s: %v", sysPath, err)
	}

	fmt.Printf("\n%s\n", result)
	return nil
}

func collectSpecialFile(ctx *cli.Context, amp string, currDir string, requireRootPrivileges bool, wg *sync.WaitGroup) error {
	prefixed := true
	configName := ".jfs.config"
	_ = utils.WithTimeout(context.TODO(), func(context.Context) error {
		if !utils.Exists(filepath.Join(amp, configName)) {
			configName = ".config"
			prefixed = false
		}

View on GitHub (pinned to c9a67b23e8)

Solutions

  1. Use a writable output directory for `juicefs debug`
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at cmd/debug.go:456 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/88597c06a41c8b25. Report an issue: GitHub.