{"record":{"id":"70ece3fb07b73938","repo":"apache/beam","slug":"error-connecting-to-job-server-at-v-v","errorCode":null,"errorMessage":"error connecting to job server at %v: %v","messagePattern":"error connecting to job server at (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/cmd/prism/prism.go","lineNumber":77,"sourceCode":"\t\t},\n\t\t*jobManagerEndpoint)\n\tif err != nil {\n\t\tlog.Fatalf(\"error creating job server: %v\", err)\n\t}\n\tif *serveHTTP {\n\t\tif err := prism.CreateWebServer(ctx, cli, prism.Options{Port: *webPort}); err != nil {\n\t\t\tlog.Fatalf(\"error creating web server: %v\", err)\n\t\t}\n\t}\n\t// Block main thread forever to keep main from exiting.\n\t<-ctx.Done()\n}\n\nfunc makeJobClient(ctx context.Context, opts prism.Options, endpoint string) (jobpb.JobServiceClient, error) {\n\tif endpoint != \"\" {\n\t\tclientConn, err := grpc.DialContext(ctx, endpoint, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error connecting to job server at %v: %v\", endpoint, err)\n\t\t}\n\t\treturn jobpb.NewJobServiceClient(clientConn), nil\n\t}\n\tcli, err := prism.CreateJobServer(ctx, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating local job server: %v\", err)\n\t}\n\treturn cli, nil\n}\n","sourceCodeStart":59,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/cmd/prism/prism.go#L59-L87","documentation":"prism's makeJobClient connects to the Beam job service endpoint given via --endpoint. When grpc.DialContext with WithBlock fails (endpoint unreachable, DNS failure, TLS/context timeout), the command wraps the cause in \"error connecting to job server at %v: %v\" and exits. With no endpoint, prism instead starts its own in-process job server.","triggerScenarios":"Running `go run ./sdks/go/cmd/prism --endpoint <addr>` where <addr> is not listening (prism/job server not started), wrong host/port, the endpoint only bound to a different interface, or the context deadline expires before the gRPC connection becomes ready.","commonSituations":"Pointing --endpoint at a server that was never started or already exited; typos in host:port or stale container/k8s service address; firewall/network policy blocking the port; submitting from outside Docker to a server bound inside a container (use host.docker.internal / published ports); --endpoint set while intending in-process prism (omit it to auto-create a local server).","solutions":["Verify the job server is running and the address matches: `nc -vz <host> <port>` or `grpcurl` the endpoint before submitting.","If no external server is needed, drop the --endpoint flag so prism creates its own local job server via prism.CreateJobServer.","Fix interface/binding mismatch: bind the server on 0.0.0.0 (or the reachable host) and use the published container port when submitting from the host.","Check the wrapped cause in the message for the root error (connection refused vs. context deadline) and increase the deadline if the server is slow to accept."],"exampleFix":"// before\n$ prism --endpoint localhost:8073 // nothing listening\n// error connecting to job server at localhost:8073: ...\n\n// after\n$ prism serve --job-port 8073 &\n$ prism --endpoint localhost:8073 // or omit --endpoint entirely","handlingStrategy":"retry","validationCode":"// before dialing\nif timeout, err := net.DialTimeout(\"tcp\", endpoint, 2*time.Second); err != nil {\n    return fmt.Errorf(\"endpoint %s not reachable: %v\", endpoint, err)\n} else { timeout.Close() }","typeGuard":null,"tryCatchPattern":"cli, err := makeJobClient(ctx, opts, endpoint)\nif err != nil {\n    log.Fatalf(\"job server setup failed: %v\", err) // cause is wrapped; inspect %v chain\n}","preventionTips":["Start the job server before submitting and confirm the port with a TCP check.","Omit --endpoint to let prism create an in-process job server when you don't need an external one.","Match bind address to submission origin (0.0.0.0 + published ports for containers).","Read the wrapped cause after ': ' to distinguish refused vs. timeout vs. DNS failures."],"tags":["grpc","network","apache-beam","prism","connection"],"backgroundTag":"connection-refused","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}