{"record":{"id":"95520d26b963f7f6","repo":"pulumi/pulumi","slug":"normalizing-read-s-after-state-migration-w","errorCode":null,"errorMessage":"normalizing read %s after state migration: %w","messagePattern":"normalizing read (.+?) after state migration: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resource/deploy/state_migration_normalization.go","lineNumber":122,"sourceCode":"\tcase ContinueResourceImportEvent,\n\t\tContinueResourceRefreshEvent,\n\t\tContinueExtensionEvent,\n\t\tContinueResourceDiffEvent:\n\t\t// Continuations contain engine-held state that was already normalized.\n\t\treturn event, nil\n\tcase RegisterResourceEvent:\n\t\t// Registrations are normalized later so migrations they carry can be applied first.\n\t\treturn event, nil\n\tcase ReadResourceEvent:\n\t\tstate := &pkgresource.State{\n\t\t\tInputs:       e.Properties(),\n\t\t\tParent:       e.Parent(),\n\t\t\tDependencies: e.Dependencies(),\n\t\t\tProvider:     e.Provider(),\n\t\t}\n\t\trewritten, err := d.rewriteStateMigrationState(state)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"normalizing read %s after state migration: %w\", e.Name(), err)\n\t\t}\n\t\tif rewritten == state {\n\t\t\treturn event, nil\n\t\t}\n\t\treturn &normalizedReadResourceEvent{\n\t\t\tReadResourceEvent: e,\n\t\t\tparent:            rewritten.Parent,\n\t\t\tprovider:          rewritten.Provider,\n\t\t\tproperties:        rewritten.Inputs,\n\t\t\tdependencies:      rewritten.Dependencies,\n\t\t}, nil\n\tcase RegisterResourceOutputsEvent:\n\t\tstate := &pkgresource.State{Outputs: e.Outputs()}\n\t\trewritten, err := d.rewriteStateMigrationState(state)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"normalizing outputs for %s after state migration: %w\", e.URN(), err)\n\t\t}\n\t\tif rewritten == state {","sourceCodeStart":104,"sourceCodeEnd":140,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/resource/deploy/state_migration_normalization.go#L104-L140","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Fix the underlying rewrite error reported in the wrapped message (inspect the inner cause)","Run pulumi stack export, repair the offending references, and pulumi stack import","Re-run the refresh after state repair"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"rewritten, err := d.rewriteStateMigrationState(state)\nif err != nil {\n\treturn nil, fmt.Errorf(\"normalizing read %s after state migration: %w\", e.Name(), err)\n}","preventionTips":["Repair state (export/import) before refreshing stacks that predate migrations","Upgrade Pulumi so built-in rewrites match your state's era"],"tags":["go","state-migration","refresh","read"],"backgroundTag":"state-migration-normalization-failed","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}