{"record":{"id":"9249c0b41ff5b52e","repo":"pulumi/pulumi","slug":"getting-autonaming-config-w-9249c0","errorCode":null,"errorMessage":"getting autonaming config: %w","messagePattern":"getting autonaming config: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/operations/up.go","lineNumber":239,"sourceCode":"\t\treplaceURNs := slice.Prealloc[string](len(replaces) + len(targetReplaces))\n\t\texcludeURNs := slice.Prealloc[string](len(excludes))\n\t\ttargetURNs = append(targetURNs, targets...)\n\t\texcludeURNs = append(excludeURNs, excludes...)\n\t\treplaceURNs = append(replaceURNs, replaces...)\n\n\t\tfor _, tr := range targetReplaces {\n\t\t\ttargetURNs = append(targetURNs, tr)\n\t\t\treplaceURNs = append(replaceURNs, tr)\n\t\t}\n\n\t\trefreshOption, err := getRefreshOption(proj, refresh)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tautonamer, err := autonaming.ParseAutonamingConfig(autonamingStackContext(proj, s), cfg.Config, decrypter)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"getting autonaming config: %w\", err)\n\t\t}\n\n\t\topts.Engine = engine.UpdateOptions{\n\t\t\tParallelDiff:              env.ParallelDiff.Value(),\n\t\t\tLocalPolicyPacks:          engine.MakeLocalPolicyPacks(policyPackPaths, policyPackConfigPaths),\n\t\t\tParallel:                  parallel,\n\t\t\tDebug:                     debug,\n\t\t\tRefresh:                   refreshOption,\n\t\t\tRefreshProgram:            runProgram,\n\t\t\tReplaceTargets:            deploy.NewUrnTargets(replaceURNs),\n\t\t\tUseLegacyDiff:             env.EnableLegacyDiff.Value(),\n\t\t\tUseLegacyRefreshDiff:      env.EnableLegacyRefreshDiff.Value(),\n\t\t\tDisableProviderPreview:    env.DisableProviderPreview.Value(),\n\t\t\tDisableResourceReferences: env.DisableResourceReferences.Value(),\n\t\t\tDisableOutputValues:       env.DisableOutputValues.Value(),\n\t\t\tShowSecrets:               showSecrets,\n\t\t\tTargets:                   deploy.NewUrnTargets(targetURNs),\n\t\t\tExcludes:                  deploy.NewUrnTargets(excludeURNs),","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/operations/up.go#L221-L257","documentation":"`pulumi up` parses the project's autonaming configuration (autonaming patterns/overrides scoped to the stack) into an autonamer before running the deployment. This error wraps a failure of autonaming.ParseAutonamingConfig, meaning the autonaming settings in the project or stack config could not be parsed or decrypted.","triggerScenarios":"Running `pulumi up` when autonaming config in Pulumi.yaml (or stack config overrides) has an invalid pattern, malformed value, or a secret value that the decrypter cannot decrypt.","commonSituations":"Miswritten autonaming pattern syntax in Pulumi.yaml, autonaming override keys in stack config that don't parse, or encrypted autonaming values with a wrong passphrase/secret provider.","solutions":["Review the `autonaming` section in Pulumi.yaml for syntax errors and fix the pattern","Inspect the wrapped inner error (%w) to identify the bad value or key","If autonaming overrides use secrets, verify PULUMI_CONFIG_PASSPHRASE / secrets provider","Remove or simplify the autonaming config temporarily to isolate the problem"],"exampleFix":"// before\n# Pulumi.yaml\nautonaming:\n  pattern: \"${name}-{{...invalid...}}\"\n// after\nautonaming:\n  pattern: \"${config::project}-${name}\"","handlingStrategy":"validation","validationCode":"// Ensure Pulumi.yaml autonaming block parses as valid YAML before up\nimport fs from 'fs';\nimport YAML from 'yaml';\nconst proj = YAML.parse(fs.readFileSync('Pulumi.yaml', 'utf8'));\nif (proj.autonaming && typeof proj.autonaming !== 'object') {\n  throw new Error('autonaming section malformed');\n}","typeGuard":"function hasValidAutonaming(proj) {\n  return !proj.autonaming ||\n    (typeof proj.autonaming === 'object' && typeof proj.autonaming.pattern === 'string');\n}","tryCatchPattern":"try {\n  execSync('pulumi up', { stdio: 'inherit' });\n} catch (e) {\n  if (String(e.message).includes('getting autonaming config')) {\n    console.error('Check the autonaming section of Pulumi.yaml:', e.message);\n  }\n  throw e;\n}","preventionTips":["Keep autonaming patterns to the documented syntax","Lint Pulumi.yaml with yamllint or schema validation","Verify secrets used in autonaming overrides decrypt correctly","Test autonaming changes with `pulumi preview` first"],"tags":["cli","autonaming","config"],"backgroundTag":"autonaming-config-parse-failed","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}