{"record":{"id":"ca38ffb50b01684e","repo":"dagger/dagger","slug":"service-exited-before-healthcheck","errorCode":null,"errorMessage":"service exited before healthcheck","messagePattern":"service exited before healthcheck","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/service.go","lineNumber":1092,"sourceCode":"\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn stopDueToDependencyExit(depErr)\n\t\tcase <-exited:\n\t\t\tif exitErr != nil {\n\t\t\t\tvar gwErr *gwpb.ExitError\n\t\t\t\tif errors.As(exitErr, &gwErr) {\n\t\t\t\t\t// Create ExecError with available service information\n\t\t\t\t\treturn &ExecError{\n\t\t\t\t\t\tErr:      telemetry.TrackOrigin(gwErr, span.SpanContext()),\n\t\t\t\t\t\tCmd:      meta.Args,\n\t\t\t\t\t\tExitCode: int(gwErr.ExitCode),\n\t\t\t\t\t\tStdout:   stdoutBuf.String(),\n\t\t\t\t\t\tStderr:   stderrBuf.String(),\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn exitErr\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"service exited before healthcheck\")\n\t\t}\n\t}\n}\n\nfunc convertResizeChannel(ctx context.Context, in <-chan bkgw.WinSize) <-chan executor.WinSize {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := make(chan executor.WinSize)\n\tgo func() {\n\t\tdefer close(out)\n\t\tfor {\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\treturn\n\t\t\tcase winSize := <-in:\n\t\t\t\tout <- executor.WinSize{\n\t\t\t\t\tRows: winSize.Rows,","sourceCodeStart":1074,"sourceCodeEnd":1110,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/service.go#L1074-L1110","documentation":"In startContainer's select loop the service process exited (exitErr == nil) before any health check completed, so it can never become healthy. Means the container terminated immediately after start — bad command, crash, or immediate exit.","triggerScenarios":"Thrown at core/service.go:1092 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the service's command/entrypoint and captured stdout/stderr buffers","Verify the service actually listens and stays alive","Fix the container image or command so the process runs until healthy"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}