{"record":{"id":"85c710d1922e1839","repo":"dagger/dagger","slug":"service-stop-called","errorCode":null,"errorMessage":"service stop called","messagePattern":"service stop called","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/service.go","lineNumber":1203,"sourceCode":"\tif err != nil {\n\t\treturn err\n\t}\n\tsvcs, err := query.Services(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get services: %w\", err)\n\t}\n\tbk, err := query.Engine(ctx)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get engine client: %w\", err)\n\t}\n\n\tupstream, err := svcs.StartResult(svcCtx, svc.TunnelUpstream, svc.TunnelUpstream.Self().TunnelUpstream.Self() != nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"start upstream: %w\", err)\n\t}\n\tconst bindHost = \"0.0.0.0\"\n\tconst dialHost = \"127.0.0.1\"\n\tstopErr := errors.New(\"service stop called\")\n\tupstreamExitedErr := errors.New(\"upstream exited\")\n\n\tclosers := make([]func() error, len(svc.TunnelPorts))\n\tports := make([]Port, len(svc.TunnelPorts))\n\n\tfor i, forward := range svc.TunnelPorts {\n\t\tvar frontend int\n\t\tif forward.Frontend != nil {\n\t\t\tfrontend = *forward.Frontend\n\t\t} else {\n\t\t\tfrontend = 0 // allow OS to choose\n\t\t}\n\t\tres, closeListener, err := bk.ListenHostToContainer(\n\t\t\tsvcCtx,\n\t\t\tfmt.Sprintf(\"%s:%d\", bindHost, frontend),\n\t\t\tforward.Protocol.Network(),\n\t\t\tfmt.Sprintf(\"%s:%d\", upstream.Host, forward.Backend),\n\t\t)","sourceCodeStart":1185,"sourceCodeEnd":1221,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/service.go#L1185-L1221","documentation":"Sentinel error used as the deliberate cancellation cause when the tunnel's Stop is invoked: shutdown(stopErr) cancels svcCtx, and Wait distinguishes an intentional stop from a crash by checking errors.Is(cause, stopErr). It is a control-flow marker, not an operational failure.","triggerScenarios":"Thrown at core/service.go:1203 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No action needed — this indicates an intentional Stop, and Wait returns nil for it","If seen unexpectedly, audit callers of running.Stop for premature shutdowns","Check that application shutdown ordering is intentional"],"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"}