{"record":{"id":"d01970bc592b20db","repo":"pulumi/pulumi","slug":"collect-state-migrations-w","errorCode":null,"errorMessage":"collect state migrations: %w","messagePattern":"collect state migrations: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resource/deploy/source_eval.go","lineNumber":2557,"sourceCode":"\t\tdefer rm.pendingStateMigrationsLock.Unlock()\n\n\t\tif pending, ok := rm.pendingStateMigrations[pendingKey]; ok {\n\t\t\tdelete(rm.pendingStateMigrations, pendingKey)\n\t\t\tstateMigrations = pending\n\t\t} else {\n\t\t\tstateMigrations, err = slice.MapError(req.StateMigrations, rm.wrapStateMigrationCallback)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t// We only need to save this for remote calls\n\t\t\tif remote && len(stateMigrations) > 0 {\n\t\t\t\trm.pendingStateMigrations[pendingKey] = stateMigrations\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"collect state migrations: %w\", err)\n\t}\n\n\t// We handle updating the providers map to include the providers field of the parent if\n\t// both the current resource and its parent is a component resource.\n\tfunc() {\n\t\t// Function exists to scope the lock\n\t\trm.componentProvidersLock.Lock()\n\t\tdefer rm.componentProvidersLock.Unlock()\n\t\tif parentsProviders, parentIsComponent := rm.componentProviders[parent]; !custom &&\n\t\t\tparent != \"\" && parentIsComponent {\n\t\t\tfor k, v := range parentsProviders {\n\t\t\t\tif opts.Providers == nil {\n\t\t\t\t\topts.Providers = map[string]string{}\n\t\t\t\t}\n\t\t\t\tif _, ok := opts.Providers[k]; !ok {\n\t\t\t\t\topts.Providers[k] = v\n\t\t\t\t}\n\t\t\t}","sourceCodeStart":2539,"sourceCodeEnd":2575,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/resource/deploy/source_eval.go#L2539-L2575","documentation":"State migrations registered by providers (for resource state upgrades) are collected in a locked closure during RegisterResource. If registration of pending state migrations fails, the error is wrapped as 'collect state migrations: %w'.","triggerScenarios":"RegisterResource where the resource's provider (or parent provider) supplies state migrations via GetStateMigrations/pendingStateMigrations and the collection closure returns an error (e.g. gRPC call to provider fails).","commonSituations":"Provider plugins implementing state migrations failing mid-handshake; provider version mismatch where migration metadata cannot be resolved; provider crash during registration.","solutions":["Upgrade or reinstall the provider plugin so migration metadata resolves","Check the provider's plugin logs for the underlying failure during registration","Pin a provider version known to support the state migrations for your stack"],"exampleFix":"pulumi plugin install resource myprov v2.1.0  # replace broken/missing plugin","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := registerStateMigrations(key); err != nil {\n    return nil, fmt.Errorf(\"collect state migrations: %w\", err)\n}","preventionTips":["Keep provider plugins installed and up to date","Pin provider versions with migrations available","Inspect provider logs on registration failures"],"tags":["go","pulumi-engine","state-migrations","providers"],"backgroundTag":"state-migration-registration-failed","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}