{"record":{"id":"10a314dd8ef23585","repo":"apache/beam","slug":"bad-symbol-v","errorCode":null,"errorMessage":"bad symbol %v","messagePattern":"bad symbol (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/serialize.go","lineNumber":273,"sourceCode":"\t\t}\n\n\t\tdata, err := jsonx.Marshal(u.Recv)\n\t\tif err != nil {\n\t\t\twrapped := errors.Wrapf(err, \"failed to marshal receiver %v\", u.Recv)\n\t\t\treturn nil, errors.WithContextf(wrapped, \"encoding structural DoFn %v\", u)\n\t\t}\n\t\treturn &v1pb.Fn{Type: typ, Opt: string(data)}, nil\n\n\tdefault:\n\t\treturn nil, errors.Errorf(\"failed to encode DoFn %v, missing fn\", u)\n\t}\n}\n\nfunc decodeFn(u *v1pb.Fn) (*graph.Fn, error) {\n\tif u.Dynfn != nil {\n\t\tgen, err := runtime.ResolveFunction(u.Dynfn.Gen, genFnType)\n\t\tif err != nil {\n\t\t\twrapped := errors.Wrapf(err, \"bad symbol %v\", u.Dynfn.Gen)\n\t\t\treturn nil, errors.WithContextf(wrapped, \"decoding dynamic DoFn %v\", u)\n\t\t}\n\n\t\tt, err := decodeType(u.Dynfn.Type)\n\t\tif err != nil {\n\t\t\twrapped := errors.Wrap(err, \"bad type\")\n\t\t\treturn nil, errors.WithContextf(wrapped, \"failed to decode dynamic DoFn %v\", u)\n\t\t}\n\t\treturn graph.NewFn(&graph.DynFn{\n\t\t\tName: u.Dynfn.Name,\n\t\t\tT:    t,\n\t\t\tData: u.Dynfn.Data,\n\t\t\tGen:  gen.(func(string, reflect.Type, []byte) reflectx.Func),\n\t\t})\n\t}\n\tif u.Fn != nil {\n\t\tfn, err := decodeUserFn(u.Fn)\n\t\tif err != nil {","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/serialize.go#L255-L291","documentation":"decodeFn, when reconstructing a dynamic DoFn on the worker, calls runtime.ResolveFunction with the encoded symbol name; failure is wrapped as \"bad symbol\". The symbol registered during pipeline construction could not be resolved in the worker binary's function registry.","triggerScenarios":"DecodeMultiEdge decoding a DynFn whose Gen symbol is absent from the worker's runtime registry — the generator function was not linked into the worker binary or its package wasn't imported.","commonSituations":"Cross-language/custom containers missing the package that registers the generator; refactored or renamed generator functions between submit and execution; worker built without the user package.","solutions":["Ensure the package defining the dynamic fn generator is imported (even with a blank import) by the worker main.","Verify the generator is registered with the same symbol at init via runtime.RegisterFunction.","Check for version mismatch between the job submission binary and the worker image.","Confirm the container image used by the runner includes the user's compiled code."],"exampleFix":"// before\n// worker main.go omits the package\n\n// after\nimport _ \"myproject/internal/dofngens\" // pulls in runtime.RegisterFunction calls","handlingStrategy":"validation","validationCode":"if _, ok := runtime.LoadFunction(genSymbol); !ok {\n    return fmt.Errorf(\"generator symbol %q not registered in this binary\", genSymbol)\n}","typeGuard":null,"tryCatchPattern":"gen, err := runtime.ResolveFunction(u.Dynfn.Gen, genFnType)\nif err != nil {\n    return fmt.Errorf(\"missing generator %q: ensure its package is imported by the worker: %w\", u.Dynfn.Gen, err)\n}","preventionTips":["Blank-import all packages registering dynamic fn generators from the worker main.","Register generators with stable symbol names via runtime.RegisterFunction at init.","Rebuild the worker container from the same commit as the submission."],"tags":["go","deserialization","worker","apache-beam"],"backgroundTag":"entity-not-found","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"}