{"record":{"id":"73b365f412afe17c","repo":"apache/beam","slug":"unknown-paneinfo-encoding-0x-encoding-tostring-16","errorCode":null,"errorMessage":"Unknown PaneInfo encoding 0x\" + encoding.toString(16)","messagePattern":"Unknown PaneInfo encoding 0x\" \\+ encoding\\.toString\\(16\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/typescript/src/apache_beam/coders/required_coders.ts","lineNumber":610,"sourceCode":"          isLast: isLast,\n          index: onlyIndex,\n          onTimeIndex: timing === Timing.EARLY ? -1 : onlyIndex,\n          timing: timing,\n        };\n\n      case PaneInfoEncoding.TWO_INDICES:\n        // Both pane index and non-speculative index included\n        const paneIndex = reader.int32();\n        const nonSpeculativeIndex = reader.int32();\n        return {\n          isFirst: isFirst,\n          isLast: isLast,\n          index: paneIndex,\n          onTimeIndex: nonSpeculativeIndex,\n          timing: timing,\n        };\n      default:\n        throw new Error(\"Unknown PaneInfo encoding 0x\" + encoding.toString(16));\n    }\n  }\n\n  encode(value: PaneInfo, writer: Writer, context: Context) {\n    // low 4 bits are used regardless of encoding\n    const low4 =\n      (value.isFirst ? 0b000000001 : 0) |\n      (value.isLast ? 0b00000010 : 0) |\n      (PaneInfoCoder.encodeTiming(value.timing) << 2);\n\n    const encodingNibble: PaneInfoEncoding =\n      PaneInfoCoder.chooseEncoding(value);\n    writeRawByte(low4 | (encodingNibble << 4), writer);\n\n    switch (encodingNibble) {\n      case PaneInfoEncoding.NO_INDEX:\n        // the header byte contains all the info\n        return;","sourceCodeStart":592,"sourceCodeEnd":628,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/typescript/src/apache_beam/coders/required_coders.ts#L592-L628","documentation":"During to_runner_api_transform, coder protos from the expanded components are merged into the pipeline context. If an expanded coder id collides with an existing coder id in the context but the two protos are not equivalent, RuntimeError is raised to prevent silently overwriting a different coder under the same id. Equivalent coders are tolerated; distinct coders are not.","triggerScenarios":"An ExternalTransform's expansion returns components containing a coder id (not namespaced with the external namespace) that already exists in the pipeline's coder registry but with a different proto definition.","commonSituations":"Multiple external expansions of differently configured transforms producing colliding ids; Beam version skew where coder proto encoding changed; reusing the same coder id across separately expanded transforms.","solutions":["Upgrade apache-beam so coder id namespaces/proto definitions are consistent between SDK and expansion service.","Ensure the expansion service jar version matches the SDK version.","If authoring a custom external transform, namespace your coder ids (prefix with the external namespace) to avoid collisions."],"exampleFix":"// before\n# expansion returns coder id 'coder1' differing from pipeline's 'coder1'\n// after\n# use a matching SDK/expansion-service version, or id like 'external_1-coder1'","handlingStrategy":"try-catch","validationCode":"# before expanding, ensure no conflicting coder ids:\nfor cid in expanded_components.coders:\n    if cid in context.coders: check_equivalent(context.coders._id_to_proto[cid], proto)","typeGuard":"def coder_ids_safe(components, context, ns: str) -> bool:\n    return all(cid.startswith(ns) or cid not in context.coders for cid in components.coders)","tryCatchPattern":"try:\n    result = p | external_transform\nexcept RuntimeError as e:\n    if 'Re-used coder id' in str(e):\n        logger.error('Coder id collision across expansions: %s', e)\n    raise","preventionTips":["Use identical SDK and expansion service jar versions","Avoid mixing expansions from different Beam versions in one pipeline","Namespace custom coder ids when authoring external transforms"],"tags":["python","apache-beam","coder","runner-api","cross-language"],"backgroundTag":"internal-invariant-violation","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"}