apache/beam · error

not found. Register DoFns and functions with the…

Error message

%v not found. Register DoFns and functions with the beam/register package.

What it means

vet's disabledResolver intentionally fails every symbol lookup with this message so reflection-based resolution surfaces as a clear error. It means the vet runner encountered a DoFn or function that was never registered with the beam/register package and so cannot be resolved statically.

Solutions

  1. Register the named symbol in an init() via beam/register (e.g. register.DoFn2x0[...](&MyDoFn{})).
  2. Replace anonymous closures with named, registered function types.
  3. Check the error message for the exact symbol name and register precisely that.
  4. Remove dynamic dispatch that cannot be statically registered.

Example fix

// before
func main() {
	beam.Init()
	beam.ParDo(scope, &myDoFn{}, col) // not registered
}
// after
func init() {
	register.DoFn2x0[int, func(int)](&myDoFn{})
}
func main() {
	beam.Init()
	beam.ParDo(scope, &myDoFn{}, col)
}
Defensive patterns

Strategy: validation

Validate before calling

func allRegistered() error {
	// every DoFn must be registered in an init() via beam/register
	if myDoFnAddr == 0 {
		return errors.New("myDoFn not registered")
	}
	return nil
}

Try / catch

if _, err := vet.Execute(ctx, p); err != nil {
	if strings.Contains(err.Error(), "not found. Register DoFns") {
		// add the missing register.DoFn2x0/register.Function1x1 init entry
	}
}

Prevention

When it happens

Trigger: Running a pipeline through vet.Evaluate/Execute where symbol resolution calls p.Sym2Addr(name) for a symbol absent from the register package — typically an unregistered DoFn or an inline closure.

Common situations: Refactoring a DoFn and dropping its init() registration; using anonymous closures or generic helpers instead of registered types; adding a new function to a pipeline without registering it.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/23616b8a060ee150. Report an issue: GitHub.

Appendix: source

Thrown at sdks/go/pkg/beam/runners/vet/vet.go:58

	"github.com/apache/beam/sdks/v2/go/pkg/beam/core/funcx"
	"github.com/apache/beam/sdks/v2/go/pkg/beam/core/graph"
	"github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime"
	"github.com/apache/beam/sdks/v2/go/pkg/beam/core/runtime/exec"
	"github.com/apache/beam/sdks/v2/go/pkg/beam/core/typex"
	"github.com/apache/beam/sdks/v2/go/pkg/beam/core/util/reflectx"
	"github.com/apache/beam/sdks/v2/go/pkg/beam/internal/errors"
)

func init() {
	beam.RegisterRunner("vet", Execute)
}

// We want clear failures when looking up symbols so we can tell if something has been
// registered properly or not.
type disabledResolver bool

func (p disabledResolver) Sym2Addr(name string) (uintptr, error) {
	return 0, errors.Errorf("%v not found. Register DoFns and functions with the beam/register package.", name)
}

// Execute evaluates the pipeline on whether it can run without reflection.
func Execute(ctx context.Context, p *beam.Pipeline) (beam.PipelineResult, error) {
	e, err := Evaluate(ctx, p)
	if err != nil {
		return nil, errors.WithContext(err, "validating pipeline with vet runner")
	}
	if !e.Performant() {
		e.summary()
		e.Generate("main")
		e.diag("*/\n")
		err := errors.Errorf("pipeline is not performant, see diagnostic summary:\n%s\n%s", e.d.String(), string(e.Bytes()))
		err = errors.WithContext(err, "validating pipeline with vet runner")
		return nil, errors.SetTopLevelMsg(err, "pipeline is not performant")
	}
	// Pipeline nas no further tasks.
	return nil, nil

View on GitHub (pinned to 12126d8942)