{"record":{"id":"f564d6eb8014466a","repo":"pulumi/pulumi","slug":"s-must-be-of-type-string","errorCode":null,"errorMessage":"'%s' must be of type string","messagePattern":"'(.+?)' must be of type string","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resource/deploy/providers/registry.go","lineNumber":322,"sourceCode":"}\n\n// GetProviderParameterization fetches and parses a provider parameterization from the given property map. If the\n// parameterization property is not present, this function returns nil.\nfunc GetProviderParameterization(\n\tname tokens.Package, inputs resource.PropertyMap,\n) (*workspace.Parameterization, error) {\n\tinternalInputs, err := getInternal(inputs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tparameter, ok := internalInputs[parameterizationKey]\n\tif !ok {\n\t\treturn nil, nil\n\t}\n\n\tif !parameter.IsString() {\n\t\treturn nil, fmt.Errorf(\"'%s' must be of type string\", parameterizationKey)\n\t}\n\tbytes, err := base64.StdEncoding.DecodeString(parameter.StringValue())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not decode base64 parameter value: %w\", err)\n\t}\n\n\tversion, ok := inputs[\"version\"]\n\tif !ok {\n\t\treturn nil, errors.New(\"must have a 'version' field\")\n\t}\n\tif !version.IsString() {\n\t\treturn nil, errors.New(\"must have a 'version' field of type string\")\n\t}\n\tsv, err := semver.Parse(version.StringValue())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not parse provider version: %w\", err)\n\t}\n","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/resource/deploy/providers/registry.go#L304-L340","documentation":"GetProviderParameterization reads '__internal.parameterization', a base64-encoded string encoding the provider's parameterization spec, and requires it to be a string. The engine throws this when the value is a non-string type, since the base64 payload can only be carried as a string.","triggerScenarios":"__internal.parameterization is a number, bool, array, or object in the provider's inputs, typically from corrupted or hand-modified state.","commonSituations":"Hand-edited state; tooling or migrations that re-encoded the base64 blob into another type; custom parameterized-provider code writing raw objects instead of encoding to base64.","solutions":["Restore __internal.parameterization to its base64 string form (as written when the provider was created) via stack export/import","Remove the parameterization key only if the provider truly is not parameterized — otherwise recreate the provider resource","Regenerate the base64 value from the correct parameterization spec and write it back as a string","Upgrade the CLI/provider if a version mismatch rewrote state incorrectly"],"exampleFix":"// before\n\"__internal\": { \"parameterization\": { \"name\": \"aws\", \"version\": \"1.0.0\" } }\n// after\n\"__internal\": { \"parameterization\": \"eyJuYW1lIjoiYXdzIiwidmVyc2lvbiI6IjEuMC4wIn0=\" }","handlingStrategy":"type-guard","validationCode":"if p, ok := internalInputs[\"parameterization\"]; ok && !p.IsString() {\n\treturn fmt.Errorf(\"parameterization must be a base64 string, got %s\", p.TypeString())\n}","typeGuard":"func isBase64String(v resource.PropertyValue) bool {\n\tif !v.IsString() { return false }\n\t_, err := base64.StdEncoding.DecodeString(v.StringValue())\n\treturn err == nil\n}","tryCatchPattern":null,"preventionTips":["Never hand-edit the base64 parameterization blob; recreate the provider instead","Use base64.StdEncoding.EncodeToString to build the value, never ad-hoc encodings","Keep parameterized providers managed by the engine so __internal stays consistent"],"tags":["pulumi","state-validation","base64","parameterization","type-error"],"backgroundTag":"provider-state-type-mismatch","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}