{"record":{"id":"e3e339338f18ac40","repo":"apache/beam","slug":"error-creating-local-job-server-v","errorCode":null,"errorMessage":"error creating local job server: %v","messagePattern":"error creating local job server: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/cmd/prism/prism.go","lineNumber":83,"sourceCode":"\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":65,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/cmd/prism/prism.go#L65-L87","documentation":"This error wraps a failure from prism.CreateJobServer when makeJobClient in the prism CLI tries to start an in-process local Beam job server for the Go SDK harness. The local job server (which serves the JobService gRPC API to the pipeline runner) failed to create or start, so the CLI cannot hand back a JobServiceClient. The wrapped %v carries the underlying cause, typically a network bind failure.","triggerScenarios":"Calling prism's main pipeline entry which invokes makeJobClient with an empty/local endpoint, and CreateJobServer fails to listen on the loopback port or fails to start the gRPC server.","commonSituations":"Port exhaustion or a port already in use on the machine; firewall/SELinux blocking loopback binds; restricted container environments without loopback networking; a corrupted or unsupported environment option passed via opts.","solutions":["Read the wrapped %v cause; if it is an address-in-use error, free the port or let the server pick an ephemeral port.","Check that loopback networking works in your environment (container/sandbox restrictions often block local listeners).","Re-run with fewer custom opts or upgrade the Beam Go SDK to get fixes in CreateJobServer.","Verify no security software (firewall, SELinux, AppArmor) is preventing binding to 127.0.0.1."],"exampleFix":"// before\ncli, err := prism.CreateJobServer(ctx, opts)\nif err != nil {\n\treturn nil, fmt.Errorf(\"error creating local job server: %v\", err)\n}\n// after\ncli, err := prism.CreateJobServer(ctx, opts)\nif err != nil {\n\treturn nil, fmt.Errorf(\"error creating local job server (endpoint=%v): %w\", endpoint, err)\n}","handlingStrategy":"try-catch","validationCode":"if ln, err := net.Listen(\"tcp\", \"127.0.0.1:0\"); err != nil { return fmt.Errorf(\"cannot bind local listener: %w\", err) } else { ln.Close() }","typeGuard":null,"tryCatchPattern":"cli, err := prism.CreateJobServer(ctx, opts)\nif err != nil {\n\tvar nerr net.Error\n\tif errors.As(err, &nerr) { log.Printf(\"network problem starting job server: %v\", nerr) }\n\treturn nil, err\n}","preventionTips":["Test loopback binding in CI containers before running Beam Go pipelines.","Avoid hardcoding ports; use ephemeral ports for the local job server.","Check container/network sandbox policies that forbid local listeners."],"tags":["go","beam","grpc","job-server"],"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"}