{"record":{"id":"5674115b6fd8785b","repo":"mvanhorn/last30days-skill","slug":"engine-subprocess-exited-with-code-d","errorCode":null,"errorMessage":"engine: subprocess exited with code %d","messagePattern":"engine: subprocess exited with code (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp/internal/engine/run.go","lineNumber":111,"sourceCode":"\n\terr = cmd.Run()\n\tres := &RunResult{\n\t\tStdout:   stdout.Bytes(),\n\t\tStderr:   stderr.Bytes(),\n\t\tExitCode: 0,\n\t\tTimedOut: errors.Is(subCtx.Err(), context.DeadlineExceeded),\n\t}\n\tif err == nil {\n\t\treturn res, nil\n\t}\n\n\tvar exitErr *exec.ExitError\n\tif errors.As(err, &exitErr) {\n\t\tres.ExitCode = exitErr.ExitCode()\n\t\tif res.TimedOut {\n\t\t\treturn res, fmt.Errorf(\"engine: subprocess exceeded %s timeout\", timeout)\n\t\t}\n\t\treturn res, fmt.Errorf(\"engine: subprocess exited with code %d\", res.ExitCode)\n\t}\n\treturn res, fmt.Errorf(\"engine: subprocess failed to start: %w\", err)\n}\n\n// resolvePython returns an absolute path to the interpreter or an error\n// naming the install URL. If the caller supplied a path we trust it - tests\n// rely on this to inject a stub. Otherwise we look up python3 on PATH.\nfunc resolvePython(override string) (string, error) {\n\tif override != \"\" {\n\t\treturn override, nil\n\t}\n\tpath, err := exec.LookPath(DefaultPythonBinary)\n\tif err == nil {\n\t\treturn path, nil\n\t}\n\treturn \"\", fmt.Errorf(\n\t\t\"engine: %s not found on PATH (need Python %s+, install from %s; current GOOS=%s)\",\n\t\tDefaultPythonBinary, MinPythonVersion, PythonInstallURL, runtime.GOOS,","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/mvanhorn/last30days-skill/blob/c7460f6114449ddfe6ea3fc2f23c3d910c0e740c/mcp/internal/engine/run.go#L93-L129","documentation":"Error \"engine: subprocess exited with code %d\" thrown in mvanhorn/last30days-skill.","triggerScenarios":"Fires when the last30days.py subprocess exits with a non-zero status. Inspect the captured stderr from the engine for the underlying Python error (missing keys, bad flags, source failures).","commonSituations":"See trigger scenarios.","solutions":["Read the subprocess stderr in the RunResult for the underlying Python error and fix that root cause.","Run last30days.py directly with the same arguments to reproduce and debug the non-zero exit.","Check that required API keys/config for the requested sources are present in the environment."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c7460f6114449ddfe6ea3fc2f23c3d910c0e740c","analyzedAt":"2026-08-15T03:34:49.540Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}