{"record":{"id":"ca4ce47764a78367","repo":"apache/beam","slug":"prism-v-didn-t-get-control-connection-to-v-after-v","errorCode":null,"errorMessage":"prism %v didn't get control connection to %v after %v","messagePattern":"prism (.+?) didn't get control connection to (.+?) after (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/prism/internal/execute.go","lineNumber":67,"sourceCode":"\t// environments, and start up docker containers, but\n\t// here, we only want and need the go one, operating\n\t// in loopback mode.\n\tenvs := j.Pipeline.GetComponents().GetEnvironments()\n\twks := map[string]*worker.W{}\n\tfor envID := range envs {\n\t\twk := j.MakeWorker(envID)\n\t\twks[envID] = wk\n\t\tif err := runEnvironment(j.RootCtx, j, envID, wk); err != nil {\n\t\t\tj.Failed(fmt.Errorf(\"failed to start environment %v for job %v: %w\", envID, j, err))\n\t\t\treturn\n\t\t}\n\t\t// Check for connection succeeding after we've created the environment successfully.\n\t\ttimeout := 1 * time.Minute\n\t\ttime.AfterFunc(timeout, func() {\n\t\t\tif wk.Connected() || wk.Stopped() {\n\t\t\t\treturn\n\t\t\t}\n\t\t\terr := fmt.Errorf(\"prism %v didn't get control connection to %v after %v\", wk, wk.Endpoint(), timeout)\n\t\t\tj.Failed(err)\n\t\t\tj.CancelFn(err)\n\t\t})\n\t}\n\n\t// When this function exits, we cancel the context to clear\n\t// any related job resources.\n\tdefer func() {\n\t\tj.CancelFn(fmt.Errorf(\"runPipeline returned, cleaning up\"))\n\t\tj.WaitForCleanUp()\n\t}()\n\n\t// Add this defer function to capture and log panics.\n\tdefer func() {\n\t\tif e := recover(); e != nil {\n\t\t\tj.Failed(fmt.Errorf(\"pipeline panicked: %v\\nStacktrace: %s\", e, string(debug.Stack())))\n\t\t}\n\t}()","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/execute.go#L49-L85","documentation":"After environments start, RunPipeline schedules a 1-minute timeout that checks whether the worker connected to prism's control endpoint. If the worker is neither Connected nor Stopped by then, the job is failed and cancelled with this error naming the worker and its endpoint.","triggerScenarios":"The SDK harness container/process started but never established the control RPC connection within 60 seconds — wrong endpoint advertised, harness crash after start, or network/firewall blocking the port.","commonSituations":"Harness image version mismatched with pipeline, container booting slowly or crashing, prism endpoint unreachable from inside Docker (e.g. localhost vs host address), or heavy startup delays.","solutions":["Check harness container logs (`docker logs <container>`) for startup crashes","Ensure the prism job endpoint is reachable from the container (use host gateway address, not localhost)","Verify SDK harness image version matches the pipeline's SDK version","Confirm no firewall blocks the control port; restart prism if the port is stale"],"exampleFix":"// before: prism advertises localhost inside container\n// after: bind endpoint to a docker-reachable address\nprism --address 0.0.0.0:8073 --endpoint host.docker.internal:8073","handlingStrategy":"validation","validationCode":"conn, err := net.DialTimeout(\"tcp\", endpoint, 5*time.Second)\nif err != nil {\n  return fmt.Errorf(\"control endpoint %s unreachable before submit: %w\", endpoint, err)\n}\nconn.Close()","typeGuard":null,"tryCatchPattern":"if strings.Contains(err.Error(), \"didn't get control connection\") {\n  // check harness logs and endpoint reachability, then retry\n}","preventionTips":["Advertise docker-reachable endpoints (host.docker.internal, not localhost)","Ensure harness container image version matches the SDK"],"tags":["go","beam","prism-runner","timeout","worker-connection"],"backgroundTag":"request-timeout","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}