{"record":{"id":"522fcad7ecb4a645","repo":"dagger/dagger","slug":"tunnel-start-error-w","errorCode":null,"errorMessage":"tunnel start error: %w","messagePattern":"tunnel start error: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/service.go","lineNumber":1174,"sourceCode":"\treturn len(p), nil\n}\n\nfunc (mwc multiWriteCloser) Close() error {\n\tvar errs error\n\tfor _, wc := range mwc {\n\t\terrs = errors.Join(errs, wc.Close())\n\t}\n\treturn errs\n}\n\nfunc (svc *Service) startTunnel(ctx context.Context, running *RunningService, _ ServiceStartOpts) (rerr error) {\n\tif running == nil {\n\t\treturn fmt.Errorf(\"running service is nil\")\n\t}\n\tsvcCtx, stop := context.WithCancelCause(context.WithoutCancel(ctx))\n\tdefer func() {\n\t\tif rerr != nil {\n\t\t\tstop(fmt.Errorf(\"tunnel start error: %w\", rerr))\n\t\t}\n\t}()\n\n\tclientMetadata, err := engine.ClientMetadataFromContext(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tsvcCtx = engine.ContextWithClientMetadata(svcCtx, clientMetadata)\n\n\tquery, err := CurrentQuery(ctx)\n\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)","sourceCodeStart":1156,"sourceCodeEnd":1192,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/service.go#L1156-L1192","documentation":"startTunnel wraps any startup failure into the cancellation cause of its detached service context, so waiters see the tunnel startup error when the context is cancelled. It is an error-propagation mechanism: the original rerr is preserved as the context cause.","triggerScenarios":"Thrown at core/service.go:1174 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped rerr to find which tunnel startup step failed","Check the tunnel upstream service's availability and reachability","Retry after fixing the underlying start failure"],"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"}