{"record":{"id":"85a9d57ec03752d6","repo":"apache/beam","slug":"worker-id-s-read-from-context-metadata-but-not-registered-in","errorCode":null,"errorMessage":"worker_id: '%s' read from context metadata but not registered in worker pool","messagePattern":"worker_id: '(.+?)' read from context metadata but not registered in worker pool","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/prism/internal/worker/worker.go","lineNumber":817,"sourceCode":"\t\tmw.logger.Error(err.Error())\n\t\treturn nil\n\t}\n\treturn w.MonitoringMetadata(ctx, unknownIDs)\n}\n\nfunc (mw *MultiplexW) workerFromMetadataCtx(ctx context.Context) (*W, error) {\n\tmw.mu.Lock()\n\tdefer mw.mu.Unlock()\n\tid, err := grpcx.ReadWorkerID(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif id == \"\" {\n\t\treturn nil, fmt.Errorf(\"worker_id read from context metadata is an empty string\")\n\t}\n\tw, ok := mw.pool[id]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"worker_id: '%s' read from context metadata but not registered in worker pool\", id)\n\t}\n\treturn w, nil\n}\n\nfunc (mw *MultiplexW) delete(w *W) {\n\tmw.mu.Lock()\n\tdefer mw.mu.Unlock()\n\tdelete(mw.pool, w.ID)\n}\n\n// WaitForCleanUp waits until all resources relevant to the job are cleaned up.\nfunc (mw *MultiplexW) WaitForCleanUp(id string) {\n\tmw.mu.Lock()\n\twg := mw.wg[id]\n\tmw.mu.Unlock()\n\tif wg == nil {\n\t\treturn\n\t}","sourceCodeStart":799,"sourceCodeEnd":835,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/worker/worker.go#L799-L835","documentation":"Error returned by MultiplexW.workerFromMetadataCtx when the worker_id read from gRPC context metadata is non-empty but no worker with that id exists in mw.pool. This means the SDK harness is reusing or replaying an id from a worker that has already been deleted/deregistered, or requests are hitting a different runner instance.","triggerScenarios":"Thrown at sdks/go/pkg/beam/runners/prism/internal/worker/worker.go:817 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure all requests from one SDK harness go to the same runner process that registered its worker","Check that the worker hasn't been deregistered (e.g. after failure) before issuing further requests"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}