apache/beam · error

Could not find coder for URN " + urn

Error message

Could not find coder for URN " + urn

What it means

apache_beam.transforms.external.ManagedTransform.__init__ raises ValueError when the managed transform's underlying SchemaTransform identifier has no pre-built expansion service jar registered in MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING. Beam needs a Java expansion service jar to expand the managed transform cross-language, and it only knows jar targets for a fixed set of managed URNs. An unknown identifier means the transform cannot be expanded with the default service.

Source

Thrown at sdks/typescript/src/apache_beam/coders/coders.ts:52

 * and they can register a constructor that takes zero or more parameters as input.
 * Constructor input parameters for a coder are usually internal coders that represent sub-components
 * of the enclosing coder (e.g. a coder of key-value pairs (a.k.a. `KVCoder`) may receive the coder
 * for the key and the coder for the value as parameters).
 */
class CoderRegistry {
  internal_registry: Record<string, (...args: unknown[]) => Coder<unknown>> =
    {};

  getCoder(
    urn: string,
    payload: Uint8Array | undefined = undefined,
    ...components: Coder<unknown>[]
  ) {
    const constructor: (...args) => Coder<unknown> =
      this.internal_registry[urn];

    if (constructor === undefined) {
      throw new Error("Could not find coder for URN " + urn);
    }
    if (payload && payload.length > 0) {
      return constructor(payload, ...components);
    } else {
      return constructor(...components);
    }
  }

  // TODO: Figure out how to branch on constructors (called with new) and
  // ordinary functions.
  register(urn: string, coderClass: Class<Coder<unknown>>) {
    this.registerClass(urn, coderClass);
  }

  registerClass(urn: string, coderClass: Class<Coder<unknown>>) {
    this.registerConstructor(urn, (...args) => new coderClass(...args));
  }

View on GitHub (pinned to 12126d8942)

Solutions

  1. Upgrade apache-beam to a version whose MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING contains the transform identifier.
  2. Fix the typo / use one of the supported managed transform names (e.g. for ManagedRead: iceberg, kafka, bigquery).
  3. Supply an explicit expansion_service=... (address or jar spec) instead of relying on the default jar mapping.

Example fix

// before
beam.ManagedRead(source='iceberg_v2')  # unknown identifier
// after
beam.ManagedRead(source='iceberg')  # or upgrade: pip install -U apache-beam
Defensive patterns

Strategy: validation

Validate before calling

if mgr.Closed() { return errors.New("instruction closed; reopen with new instruction") }

Type guard

func (s *ScopedDataManager) CanOpen() bool { s.mu.Lock(); defer s.mu.Unlock(); return !s.closed }

Try / catch

ch, err := mgr.Open(ctx, port)
if err != nil && strings.Contains(err.Error(), "no longer processing") { return ErrInstructionClosed }
return err

Prevention

When it happens

Trigger: Constructing a ManagedTransform (or using ManagedRead/ManagedWrite) whose resolved underlying_transform_identifier is not a key of MANAGED_TRANSFORM_URN_TO_JAR_TARGET_MAPPING, e.g. a typo'd or newly added managed transform on an older Beam SDK, while relying on the default expansion service.

Common situations: Using a managed transform added in a newer Beam version with an older Python SDK installed; misspelling the source/transform name; passing a custom identifier string; Beam version skew between docs and installed package.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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