multica-ai/multica · error

open log file

Error message

open log file %s: %w

What it means

CLI error in runDaemonBackground: opening the non-rotated stderr crash sink for the daemon child failed. This file only catches raw crash output (daemon.log is written by the child's own rotating writer), but without it the child can't be spawned; wrapped with 'open log file %s: %w' pointing at the offending path.

Solutions

  1. Check that the log file path is writable.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at server/cmd/multica/cmd_daemon.go:603 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/90640db362312c8e. Report an issue: GitHub.

Appendix: source

Thrown at server/cmd/multica/cmd_daemon.go:603

	}

	// Build child args: daemon start --foreground + forwarded flags.
	args := buildDaemonStartArgs(cmd)

	// Ensure daemon directory exists.
	dir := daemonDirForProfile(profile)
	if err := os.MkdirAll(dir, 0o755); err != nil {
		return fmt.Errorf("create daemon directory: %w", err)
	}

	// The child (foreground daemon) writes daemon.log itself through a
	// rotating writer; its inherited stdout/stderr only need to catch raw
	// crash output, which goes to a separate, non-rotated sink so it never
	// holds daemon.log open (see daemonStderrLogPathForProfile).
	errLogPath := daemonStderrLogPathForProfile(profile)
	logFile, err := openBoundedErrLog(errLogPath)
	if err != nil {
		return fmt.Errorf("open log file %s: %w", errLogPath, err)
	}
	// Where the daemon's structured logs actually land (rotated), for the
	// user-facing hints below.
	logPath := daemonLogPathForProfile(profile)

	// Remember where both logs end now so an early-death report below can show
	// only what THIS startup attempt wrote, not stale history. The err-log
	// offset is taken after openBoundedErrLog, which may have rolled the file.
	var logOffset int64
	if info, statErr := os.Stat(logPath); statErr == nil {
		logOffset = info.Size()
	}
	var errLogOffset int64
	if info, statErr := os.Stat(errLogPath); statErr == nil {
		errLogOffset = info.Size()
	}

	child := exec.Command(exePath, args...)

View on GitHub (pinned to 2c0912b6ec)