{"record":{"id":"b96e222027cf5b14","repo":"apache/beam","slug":"failed-to-create-data-client-on-v","errorCode":null,"errorMessage":"failed to create data client on %v","messagePattern":"failed to create data client on (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"sdks/go/pkg/beam/core/runtime/harness/datamgr.go","lineNumber":268,"sourceCode":"\t\tif !ec.Closed() {\n\t\t\tatomic.StoreUint32(&ec.closed, 1)\n\t\t\tclose(ec.ch)\n\t\t}\n\t}\n}\n\nfunc newDataChannel(ctx context.Context, port exec.Port) (*DataChannel, error) {\n\tctx, cancelFn := context.WithCancel(ctx)\n\tcc, err := dial(ctx, port.URL, \"data\", 15*time.Second)\n\tif err != nil {\n\t\tcancelFn()\n\t\treturn nil, errors.Wrapf(err, \"failed to connect to data service at %v\", port.URL)\n\t}\n\tclient, err := fnpb.NewBeamFnDataClient(cc).Data(ctx)\n\tif err != nil {\n\t\tcc.Close()\n\t\tcancelFn()\n\t\treturn nil, errors.Wrapf(err, \"failed to create data client on %v\", port.URL)\n\t}\n\treturn makeDataChannel(ctx, port.URL, client, func() {\n\t\tcc.Close()\n\t\tcancelFn()\n\t}), nil\n}\n\nfunc makeDataChannel(ctx context.Context, id string, client dataClient, cancelFn context.CancelFunc) *DataChannel {\n\tret := &DataChannel{\n\t\tid:                id,\n\t\tclient:            client,\n\t\twriters:           make(map[instructionID]map[string]*dataWriter),\n\t\ttimerWriters:      make(map[instructionID]map[timerKey]*timerWriter),\n\t\tchannels:          make(map[instructionID]*elementsChan),\n\t\tendedInstructions: make(map[instructionID]struct{}),\n\t\tcancelFn:          cancelFn,\n\t}\n\tgo ret.read(ctx)","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/harness/datamgr.go#L250-L286","documentation":"The gRPC connection to the data service was established, but creating the BeamFnData streaming client (NewBeamFnDataClient(cc).Data(ctx)) failed. This means the server did not accept or open the bidirectional data stream. Unlike 5221 the dial succeeded, so this points to a protocol or server-side rejection of the Data RPC.","triggerScenarios":"The remote endpoint at port.URL does not actually implement the BeamFnData gRPC service; gRPC server is shutting down or over capacity when the stream is requested; context canceled while establishing the stream; gRPC version/schema mismatch between SDK and runner.","commonSituations":"Pointing the harness at the wrong service port (e.g. logging port instead of data port); runner draining/restarting mid-bundle; version skew between Beam runner and Go SDK where the Data service definition changed; envoy/proxy intercepting gRPC and rejecting stream creation.","solutions":["Confirm port.URL points to the actual BeamFnData service endpoint and not another port","Align runner and Go SDK versions (same Beam release line) to avoid gRPC schema skew","Retry the bundle; a server under load or draining can transiently refuse stream creation","Inspect server logs for the Data RPC rejection to distinguish auth, capacity, or protocol issues"],"exampleFix":"// before\nclient, err := fnpb.NewBeamFnDataClient(cc).Data(ctx)\nif err != nil { cc.Close(); cancelFn(); return nil, errors.Wrapf(err, \"failed to create data client on %v\", port.URL) }\n// after\nclient, err := fnpb.NewBeamFnDataClient(cc).Data(ctx)\nif err != nil {\n  cc.Close(); cancelFn()\n  return nil, retryable(errors.Wrapf(err, \"failed to create data client on %v\", port.URL))\n}","handlingStrategy":"retry","validationCode":"resp, err := grpc_health_v1.NewHealthClient(cc).Check(ctx, &grpc_health_v1.HealthCheckRequest{})\nif err != nil || resp.Status != grpc_health_v1.HealthCheckResponse_SERVING {\n  return fmt.Errorf(\"data service not serving streams: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"client, err := fnpb.NewBeamFnDataClient(cc).Data(ctx)\nif err != nil {\n  if status, ok := status.FromError(err); ok && status.Code() == codes.Unavailable {\n    return retryWithBackoff(ctx, redialAndOpen, 3)\n  }\n  return err\n}","preventionTips":["Verify the port URL maps to the data (not logging/legacy) service","Retry transient Unavailable codes during runner drain/restart","Monitor runner logs for stream rejections","Pin matching Beam runner/SDK versions"],"tags":["go","apache-beam","grpc","stream"],"backgroundTag":"api-request-failed","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"}