{"record":{"id":"de8776db927a835b","repo":"apache/beam","slug":"invalid-input-id-format","errorCode":null,"errorMessage":"invalid input ID format","messagePattern":"invalid input ID format","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/translate.go","lineNumber":905,"sourceCode":"\tfor i := 0; i < len(ret); i++ {\n\t\tif key, ok := ordered[i]; ok {\n\t\t\tret[i] = m[key]\n\t\t} else {\n\t\t\tret[i] = m[unordered[k]]\n\t\t\tk++\n\t\t}\n\t}\n\treturn ret\n}\n\n// inputIdToIndex converts a local input ID for a transform into an index. Use\n// this to avoid relying on format details for input IDs.\n//\n// Currently, expects IDs in the format \"iN\" where N is the index. If the ID is\n// in an invalid form, returns an error.\nfunc inputIdToIndex(id string) (int, error) {\n\tif !strings.HasPrefix(id, \"i\") {\n\t\treturn 0, errors.New(\"invalid input ID format\")\n\t}\n\treturn strconv.Atoi(strings.TrimPrefix(id, \"i\"))\n}\n\n// indexToInputId converts an index into a local input ID for a transform. Use\n// this to avoid relying on format details for input IDs.\nfunc indexToInputId(i int) string {\n\treturn \"i\" + strconv.Itoa(i)\n}\n\nfunc unmarshalPort(data []byte) (Port, string, error) {\n\tvar port fnpb.RemoteGrpcPort\n\tif err := proto.Unmarshal(data, &port); err != nil {\n\t\treturn Port{}, \"\", err\n\t}\n\treturn Port{\n\t\tURL: port.GetApiServiceDescriptor().GetUrl(),\n\t}, port.CoderId, nil","sourceCodeStart":887,"sourceCodeEnd":923,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/translate.go#L887-L923","documentation":"inputIdToIndex parses a transform's local input ID, which must be in the form \"iN\" where N is a numeric index (e.g. \"i0\", \"i2\"). If the ID lacks the \"i\" prefix the format contract is broken and this error is returned instead of guessing an index.","triggerScenarios":"unmarshalKeyedValues encounters a state/keyed-value spec whose input ID does not start with 'i' — e.g. malformed or hand-edited pipeline proto, or an ID produced by a different numbering convention.","commonSituations":"Pipelines marshaled by incompatible or buggy runner/SDK versions whose local input naming differs; hand-crafted or corrupted model pipeline protos; tests feeding invalid IDs.","solutions":["Fix the source of the pipeline proto so local input IDs follow the \"iN\" convention.","Regenerate/re-marshal the pipeline with the same Beam version on both sides.","If IDs come from external tooling, rename them to the \"iN\" form before unmarshaling."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"func validInputID(id string) bool { return strings.HasPrefix(id, \"i\") && func() bool { _, err := strconv.Atoi(id[1:]); return err == nil }() }","typeGuard":"func isIndexedInputID(id string) bool { return len(id) > 1 && id[0] == 'i' }","tryCatchPattern":"idx, err := inputIdToIndex(id)\nif err != nil {\n    return fmt.Errorf(\"unexpected local input id %q in state spec: %w\", id, err)\n}","preventionTips":["Pin the same Beam version on SDK and runner/harness sides","Never hand-edit local input IDs in pipeline protos","Add round-trip marshal/unmarshal tests covering input ID formats"],"tags":["go","apache-beam","exec","translate","pipeline-proto"],"backgroundTag":"invalid-identifier-format","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"}