{"record":{"id":"90640db362312c8e","repo":"multica-ai/multica","slug":"open-log-file-s-w","errorCode":null,"errorMessage":"open log file %s: %w","messagePattern":"open log file (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_daemon.go","lineNumber":603,"sourceCode":"\t}\n\n\t// Build child args: daemon start --foreground + forwarded flags.\n\targs := buildDaemonStartArgs(cmd)\n\n\t// Ensure daemon directory exists.\n\tdir := daemonDirForProfile(profile)\n\tif err := os.MkdirAll(dir, 0o755); err != nil {\n\t\treturn fmt.Errorf(\"create daemon directory: %w\", err)\n\t}\n\n\t// The child (foreground daemon) writes daemon.log itself through a\n\t// rotating writer; its inherited stdout/stderr only need to catch raw\n\t// crash output, which goes to a separate, non-rotated sink so it never\n\t// holds daemon.log open (see daemonStderrLogPathForProfile).\n\terrLogPath := daemonStderrLogPathForProfile(profile)\n\tlogFile, err := openBoundedErrLog(errLogPath)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"open log file %s: %w\", errLogPath, err)\n\t}\n\t// Where the daemon's structured logs actually land (rotated), for the\n\t// user-facing hints below.\n\tlogPath := daemonLogPathForProfile(profile)\n\n\t// Remember where both logs end now so an early-death report below can show\n\t// only what THIS startup attempt wrote, not stale history. The err-log\n\t// offset is taken after openBoundedErrLog, which may have rolled the file.\n\tvar logOffset int64\n\tif info, statErr := os.Stat(logPath); statErr == nil {\n\t\tlogOffset = info.Size()\n\t}\n\tvar errLogOffset int64\n\tif info, statErr := os.Stat(errLogPath); statErr == nil {\n\t\terrLogOffset = info.Size()\n\t}\n\n\tchild := exec.Command(exePath, args...)","sourceCodeStart":585,"sourceCodeEnd":621,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_daemon.go#L585-L621","documentation":"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.","triggerScenarios":"Thrown at server/cmd/multica/cmd_daemon.go:603 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the log file path is writable."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}