apache/beam · critical

unknown environment[ ]

Error message

unknown environment[%v]

What it means

stage.Execute dispatches bundle processing based on the stage's environment ID; when s.envID doesn't match any known environment kind (e.g. the expected SDK/worker environments), it creates this error, logs it, and panics — terminating execution since the stage cannot be run.

Solutions

  1. Check the pipeline's environment configuration in the submitted proto
  2. Use the default SDK environment (docker/Go SDK harness) prism supports
  3. Upgrade prism — support for additional environments is added over time
  4. Report the unhandled environment value as a bug with the pipeline proto
Defensive patterns

Strategy: validation

Validate before calling

supported := map[string]bool{"urn:beam:env:docker:v1": true, "urn:beam:env:process:v1": true}
if !supported[env.GetUrn()] {
    return fmt.Errorf("environment %v unsupported by prism", env.GetUrn())
}

Try / catch

// Execute panics here; recover at the pipeline boundary
defer func() {
    if r := recover(); r != nil {
        err = fmt.Errorf("stage env failure: %v", r)
    }
}()

Prevention

When it happens

Trigger: A stage's environment ID is not one prism recognizes, e.g. pipelines embedding custom or external environments, or an envID left unset by a graph-planning bug.

Common situations: Submitting pipelines whose environment was rewritten by another tool; using prism with environment types it doesn't support yet; internal regression in stage/env assignment during preprocessing.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at sdks/go/pkg/beam/runners/prism/internal/stage.go:182

			Input:                  input,
			EstimatedInputElements: estimatedElements,

			OutputData: initialState,
			HasTimers:  s.hasTimers,

			SinkToPCollection: s.SinkToPCollection,
			OutputCount:       len(s.outputs),
		}
		b.Init()

		s.prepareSides(b, rb.Watermark)

		slog.Debug("Execute: sdk worker transform(s)", "bundle", rb)
		defer b.Cleanup(wk)
		dataReady = b.ProcessOn(ctx, wk)
	default:
		err := fmt.Errorf("unknown environment[%v]", s.envID)
		slog.Error("Execute", "error", err)
		panic(err)
	}

	// Progress + split loop.
	previousIndex := int64(-2)
	previousTotalCount := int64(-2) // Total count of all pcollection elements.

	unsplit := true
	baseTick := s.baseProgTick.Load().(time.Duration)
	ticked := false
	progTick := time.NewTicker(baseTick)
	defer progTick.Stop()
	var dataFinished, bundleFinished bool
	// If we have no data outputs and timers, we still need to have progress & splits
	// while waiting for bundle completion.
	if b.OutputCount+len(b.HasTimers) == 0 {
		dataFinished = true

View on GitHub (pinned to 12126d8942)