{"record":{"id":"c93237c632dc7e27","repo":"pulumi/pulumi","slug":"s-error-dynamic-stored-step-error-surfaced-from","errorCode":null,"errorMessage":"s.error (dynamic stored step error, surfaced from view step)","messagePattern":"s\\.error \\(dynamic stored step error, surfaced from view step\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resource/deploy/step.go","lineNumber":2611,"sourceCode":"\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (s *ViewStep) IsUntargeted() bool { return false }\n\nfunc (s *ViewStep) ResultOp() display.StepOp {\n\treturn s.resultOp\n}\n\nfunc (s *ViewStep) Apply() (resource.Status, StepCompleteFunc, error) {\n\t// ViewStep is a special step that that represents an operation for a view resource.\n\t// It doesn't actually do anything in Apply. It's used to flow the step through the\n\t// system for display in the UI and so the result of the operation is recorded\n\t// in the state.\n\n\tif s.error != \"\" {\n\t\treturn s.status, nil, errors.New(s.error)\n\t}\n\n\t// When the view step is for a replacement, we need to ensure that the old resource is marked pending delete.\n\tif s.op == OpCreateReplacement && s.old != nil {\n\t\ts.old.Lock.Lock()\n\t\ts.old.Delete = true\n\t\ts.old.Lock.Unlock()\n\t}\n\n\treturn s.status, nil, nil\n}\n\nfunc (s *ViewStep) Fail() {\n\t// Nothing to do here.\n}\n\nfunc (s *ViewStep) Skip() {\n\t// Nothing to do here.","sourceCodeStart":2593,"sourceCodeEnd":2629,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/resource/deploy/step.go#L2593-L2629","documentation":"ViewStep is a bookkeeping step representing an operation on a view resource; it performs no work in Apply but replays a stored status and error so the operation shows correctly in the UI and state. If the step carries a non-empty s.error string, Apply surfaces it verbatim as the step's failure.","triggerScenarios":"A view step was constructed with s.error set (the actual underlying operation on the view resource failed elsewhere); replaying/processing the step in Apply returns errors.New(s.error).","commonSituations":"Any child/view resource operation failure propagated to its view step — e.g. a failed create/update of a sub-resource surfaced during UI display or state recording; debugging this requires looking at the original underlying step error logged earlier.","solutions":["Look earlier in the deployment output/logs for the original underlying error that populated this view step's error string.","Fix the root cause on the actual view/child resource (permissions, config, provider error).","Re-run the operation with --debug to see the originating step that failed.","If the error string is empty-but-set incorrectly in state, refresh the stack to reconcile."],"exampleFix":"// before: diagnosing the view step error directly\n// after: run with debug to find the root step\npulumi up --debug --logtostderr -v=9","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await deploy.up();\n} catch (e) {\n  // ViewStep errors are propagated from the underlying operation;\n  // re-run with debug and inspect the earlier root-cause error.\n  console.error('view step surfaced:', e.message);\n  throw e;\n}","preventionTips":["Fix the root-cause operation error — this message is only a replay of it.","Run deployments with --debug when view-step errors appear to capture the original failure.","Keep engine and provider versions aligned to avoid view/state recording mismatches."],"tags":["view-step","ui","error-propagation","pulumi-deploy"],"backgroundTag":"propagated-step-error","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}