{"record":{"id":"119fddb006412fb1","repo":"apache/beam","slug":"could-not-close-data-operations-client-v","errorCode":null,"errorMessage":"could not close data operations client: %v","messagePattern":"could not close data operations client: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"sdks/go/pkg/beam/io/bigtableio/bigtable.go","lineNumber":157,"sourceCode":"\ttable *bigtable.Table `json:\"-\"`\n\t// Type is the encoded schema type.\n\tType beam.EncodedType `json:\"type\"`\n}\n\nfunc (f *writeFn) Setup(ctx context.Context) error {\n\tvar err error\n\tf.client, err = bigtable.NewClient(ctx, f.Project, f.InstanceID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not create data operations client: %v\", err)\n\t}\n\n\tf.table = f.client.Open(f.TableName)\n\treturn nil\n}\n\nfunc (f *writeFn) Teardown() error {\n\tif err := f.client.Close(); err != nil {\n\t\treturn fmt.Errorf(\"could not close data operations client: %v\", err)\n\t}\n\treturn nil\n}\n\nfunc (f *writeFn) ProcessElement(ctx context.Context, key int, values func(*Mutation) bool) error {\n\n\tvar mutation Mutation\n\tfor values(&mutation) {\n\n\t\terr := validateMutation(mutation)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid bigtableio.Mutation: %s\", err)\n\t\t}\n\n\t\terr = f.table.Apply(ctx, mutation.RowKey, getBigtableMutation(mutation))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not apply mutation for row key='%s': %v\", mutation.RowKey, err)\n\t\t}","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/io/bigtableio/bigtable.go#L139-L175","documentation":"In writeFn.Teardown, the Bigtable client's Close() result is checked; a non-nil error is wrapped as \"could not close data operations client\". This happens after writing completes and usually indicates transport or gRPC shutdown issues.","triggerScenarios":"worker Teardown where f.client.Close() returns an error — typically gRPC connection teardown failures, lost network mid-job, or a client that was left in a bad state after earlier errors.","commonSituations":"Workers losing connectivity during shutdown; transient gRPC errors on Close; cascading failures after earlier Apply/Setup errors.","solutions":["Inspect prior worker logs — a failed Close after successful writes is usually benign/transient.","Check network stability between workers and Bigtable endpoints.","Retry the job if data was already written; verify no partial-write issues.","If persistent, upgrade the Beam/Google Cloud client libraries, as stale gRPC connections have been fixed over time."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := fn.Teardown(); err != nil {\n    if strings.Contains(err.Error(), \"close data operations client\") {\n        log.Printf(\"non-fatal client close error: %v\", err) // usually transient\n    }\n}","preventionTips":["Treat close errors after successful writes as transient; verify data completeness.","Keep Beam and google-cloud-go client libraries up to date.","Monitor worker network health during shutdown windows."],"tags":["bigtable","gcp","cleanup","grpc","go"],"backgroundTag":"network-request-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}