{"record":{"id":"d23de880d5376fd7","repo":"pulumi/pulumi","slug":"unmarshaling-replacement-trigger-w-d23de8","errorCode":null,"errorMessage":"unmarshaling replacement trigger: %w","messagePattern":"unmarshaling replacement trigger: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdk/go/pulumi/provider.go","lineNumber":160,"sourceCode":"\t\thooks.BeforeDelete = makeStubHooks(binding.GetBeforeDelete())\n\t\thooks.AfterDelete = makeStubHooks(binding.GetAfterDelete())\n\t\thooks.OnError = makeStubErrorHooks(binding.GetOnError())\n\t}\n\n\tvar replacementTrigger Input\n\tif rt := req.GetReplacementTrigger(); rt != nil {\n\t\tpv, err := plugin.UnmarshalPropertyValue(\n\t\t\tresource.PropertyKey(\"replacementTrigger\"),\n\t\t\trt,\n\t\t\tplugin.MarshalOptions{\n\t\t\t\tKeepSecrets:      true,\n\t\t\t\tKeepResources:    true,\n\t\t\t\tKeepUnknowns:     req.GetDryRun(),\n\t\t\t\tKeepOutputValues: true,\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unmarshaling replacement trigger: %w\", err)\n\t\t}\n\n\t\tif pv != nil && !pv.IsNull() { // null = explicitly unset\n\t\t\tm, err := unmarshalPropertyMap(pulumiCtx, resource.PropertyMap{\n\t\t\t\tresource.PropertyKey(\"replacementTrigger\"): *pv,\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"unmarshaling replacement trigger: %w\", err)\n\t\t\t}\n\t\t\treplacementTrigger = m[\"replacementTrigger\"]\n\t\t}\n\t}\n\n\topts := resourceOption(func(ro *resourceOptions) {\n\t\tro.Aliases = aliases\n\t\tif len(dependencies) > 0 {\n\t\t\tro.DependsOn = append(ro.DependsOn, resourceDependencySet(dependencies))\n\t\t}","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/sdk/go/pulumi/provider.go#L142-L178","documentation":"When constructing a component, the SDK may unmarshal a 'replacement trigger' value from the request's aliases/options using plugin.UnmarshalProperties (sdk/go/pulumi/provider.go:160). Failure to decode that property map aborts Construct with 'unmarshaling replacement trigger'.","triggerScenarios":"plugin.UnmarshalProperties on the replacement-trigger protobuf value returns an error (options KeepResources/KeepUnknowns/KeepOutputValues apply).","commonSituations":"A replacement trigger containing secret or output-value encodings the SDK cannot decode, or a malformed property map produced by a mismatched engine/SDK version.","solutions":["Check the wrapped error for the specific property that failed to decode","Align engine and sdk/go versions (replacement-trigger encoding changed across releases)","Verify the caller passing replacement triggers marshals them with plugin.MarshalProperties","Simplify the replacement trigger to plain values (strings/numbers) if custom encodings are unnecessary"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// ensure the replacement trigger value only contains marshal-safe primitives\nfunc safeTrigger(v interface{}) error {\n\tswitch v.(type) {\n\tcase nil, string, int, float64, bool:\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported trigger type %T\", v)\n\t}\n}","typeGuard":null,"tryCatchPattern":"pv, err := plugin.UnmarshalProperties(raw, opts)\nif err != nil {\n\treturn nil, fmt.Errorf(\"unmarshaling replacement trigger: %w\", err)\n}","preventionTips":["Use scalar values (versions, hashes) for replacement triggers","Avoid embedding secrets/assets in trigger values","Keep engine and SDK versions in sync"],"tags":["go","serialization","aliases"],"backgroundTag":"property-unmarshal-failed","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}