{"record":{"id":"0bd08658894d9d4c","repo":"pulumi/pulumi","slug":"unexpected-unknown-property-value-for-q-0bd086","errorCode":null,"errorMessage":"unexpected unknown property value for %q","messagePattern":"unexpected unknown property value for %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdk/go/common/resource/plugin/rpc.go","lineNumber":192,"sourceCode":"\t} else if v.IsAsset() {\n\t\tif opts.RejectAssets {\n\t\t\treturn nil, fmt.Errorf(\"unexpected Asset property value for %q\", key)\n\t\t}\n\t\treturn MarshalAsset(v.AssetValue(), opts)\n\t} else if v.IsArchive() {\n\t\tif opts.RejectAssets {\n\t\t\treturn nil, fmt.Errorf(\"unexpected Asset Archive property value for %q\", key)\n\t\t}\n\t\treturn MarshalArchive(v.ArchiveValue(), opts)\n\t} else if v.IsObject() {\n\t\tobj, err := MarshalProperties(v.ObjectValue(), opts)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn MarshalStruct(obj, opts), nil\n\t} else if v.IsComputed() {\n\t\tif opts.RejectUnknowns {\n\t\t\treturn nil, fmt.Errorf(\"unexpected unknown property value for %q\", key)\n\t\t} else if opts.KeepUnknowns {\n\t\t\tif opts.KeepOutputValues && opts.UpgradeToOutputValues {\n\t\t\t\toutput := resource.NewProperty(resource.PropertyMap{\n\t\t\t\t\tresource.SigKey: resource.NewProperty(resource.OutputValueSig),\n\t\t\t\t})\n\t\t\t\treturn MarshalPropertyValue(key, output, opts)\n\t\t\t}\n\t\t\treturn marshalUnknownProperty(v.Input().Element, opts), nil\n\t\t}\n\t\treturn nil, nil // return nil and the caller will ignore it.\n\t} else if v.IsOutput() {\n\t\tif !opts.KeepOutputValues {\n\t\t\tresult := v.OutputValue().Element\n\t\t\tif !v.OutputValue().Known {\n\t\t\t\t// Unknown outputs are marshaled the same as Computed.\n\t\t\t\tresult = resource.MakeComputed(resource.NewProperty(\"\"))\n\t\t\t}\n\t\t\tif v.OutputValue().Secret {","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/sdk/go/common/resource/plugin/rpc.go#L174-L210","documentation":"During RPC marshaling of a Pulumi property value (MarshalPropertyValue), the value is a Computed/unknown, and MarshalOptions.RejectUnknowns is set, so the marshaler refuses to serialize it and returns this error naming the property key. The Pulumi engine normally swallows unknowns (returns nil), but RejectUnknowns is used by callers that require fully-resolved values, e.g. when a provider must never send unresolved outputs across the wire.","triggerScenarios":"Calling MarshalProperties/MarshalPropertyValue with MarshalOptions{RejectUnknowns: true} on a PropertyMap that contains resource.MakeComputed(...) values, or an OutputValue with Known=false while KeepUnknowns is false. Typical call sites: check/Update RPCs configured to reject unknowns, or provider/plugin code that manually marshals inputs containing unresolved outputs.","commonSituations":"A developer passes a resource output (still unknown during preview) into a config bag or provider argument that is marshaled with strict options; an SDK upgrade changes default marshal options so unknowns that were previously dropped now fail; custom provider code builds inputs from outputs of resources not yet created (preview phase).","solutions":["Remove RejectUnknowns from the MarshalOptions, or set KeepUnknowns: true so unknowns are serialized as sentinel values instead of erroring.","Wait until the upstream output is known (move the logic out of preview, or run during update instead) before marshaling.","Substitute a concrete value or placeholder for the computed property before marshaling (e.g. resource.NewProperty(defaultValue)).","Filter the PropertyMap to drop Computed values before calling MarshalProperties."],"exampleFix":"// before\nprops := resource.NewPropertyMapFromMap(map[string]interface{}{\"bucket\": bucket.BucketName()}) // output, unknown in preview\nout, err := plugin.MarshalProperties(props, plugin.MarshalOptions{RejectUnknowns: true})\n// after\nout, err := plugin.MarshalProperties(props, plugin.MarshalOptions{KeepUnknowns: true})","handlingStrategy":"validation","validationCode":"// Drop or flag unknowns before marshaling\nfunc stripUnknowns(m resource.PropertyMap) resource.PropertyMap {\n\tout := resource.PropertyMap{}\n\tfor k, v := range m {\n\t\tif !v.IsComputed() && !(v.IsOutput() && !v.OutputValue().Known) {\n\t\t\tout[k] = v\n\t\t}\n\t}\n\treturn out\n}\n// if len(out) != len(m): an unknown was present — resolve it or use KeepUnknowns:true","typeGuard":"func isUnknown(v resource.PropertyValue) bool {\n\treturn v.IsComputed() || (v.IsOutput() && !v.OutputValue().Known)\n}","tryCatchPattern":null,"preventionTips":["Never enable RejectUnknowns on marshal paths that can run during preview, when outputs are unresolved.","Prefer KeepUnknowns: true so unknowns round-trip as sentinels instead of failing.","Check properties with IsComputed/OutputValue().Known before marshaling strict payloads.","Add a unit test that round-trips a map containing MakeComputed to catch option regressions."],"tags":["go","pulumi-engine","rpc-marshaling","unknown-value"],"backgroundTag":"unknown-property-value","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}