pulumi/pulumi · error

normalizing read %s after state migration: %w

Error message

normalizing read %s after state migration: %w

What it means

When the engine normalizes a ReadResourceEvent during a migration-enabled deployment, it converts the event to state, runs rewriteStateMigrationState, and wraps any rewrite failure with the resource name. It signals that read normalization failed for that specific resource.

Source

Thrown at pkg/resource/deploy/state_migration_normalization.go:122

	case ContinueResourceImportEvent,
		ContinueResourceRefreshEvent,
		ContinueExtensionEvent,
		ContinueResourceDiffEvent:
		// Continuations contain engine-held state that was already normalized.
		return event, nil
	case RegisterResourceEvent:
		// Registrations are normalized later so migrations they carry can be applied first.
		return event, nil
	case ReadResourceEvent:
		state := &pkgresource.State{
			Inputs:       e.Properties(),
			Parent:       e.Parent(),
			Dependencies: e.Dependencies(),
			Provider:     e.Provider(),
		}
		rewritten, err := d.rewriteStateMigrationState(state)
		if err != nil {
			return nil, fmt.Errorf("normalizing read %s after state migration: %w", e.Name(), err)
		}
		if rewritten == state {
			return event, nil
		}
		return &normalizedReadResourceEvent{
			ReadResourceEvent: e,
			parent:            rewritten.Parent,
			provider:          rewritten.Provider,
			properties:        rewritten.Inputs,
			dependencies:      rewritten.Dependencies,
		}, nil
	case RegisterResourceOutputsEvent:
		state := &pkgresource.State{Outputs: e.Outputs()}
		rewritten, err := d.rewriteStateMigrationState(state)
		if err != nil {
			return nil, fmt.Errorf("normalizing outputs for %s after state migration: %w", e.URN(), err)
		}
		if rewritten == state {

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Fix the underlying rewrite error reported in the wrapped message (inspect the inner cause)
  2. Run pulumi stack export, repair the offending references, and pulumi stack import
  3. Re-run the refresh after state repair
Defensive patterns

Strategy: try-catch

Try / catch

rewritten, err := d.rewriteStateMigrationState(state)
if err != nil {
	return nil, fmt.Errorf("normalizing read %s after state migration: %w", e.Name(), err)
}

Prevention

When it happens

Trigger: A pulumi refresh (or import-style read) of a resource whose state requires migration rewriting, and the rewrite fails (e.g. malformed provider reference or URN fix failure) on that resource.

Common situations: Refresh over stacks created by old Pulumi versions whose stored references don't satisfy current migration rewrites; reads of resources renamed by a provider migration.

Related errors


AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31). Data as JSON: /api/errors/95520d26b963f7f6. Report an issue: GitHub.