{"record":{"id":"411d1433489cb0ef","repo":"pulumi/pulumi","slug":"internal-error-creating-renderer-w-411d14","errorCode":null,"errorMessage":"internal error: creating renderer: %w","messagePattern":"internal error: creating renderer: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/esc/cli/env_get.go","lineNumber":131,"sourceCode":"\n\t\t\tif defOnly {\n\t\t\t\tfmt.Fprint(get.env.esc.stdout, data.Definition)\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tvar markdown bytes.Buffer\n\t\t\tif err := envGetTemplate.Execute(&markdown, data); err != nil {\n\t\t\t\treturn fmt.Errorf(\"internal error: rendering: %w\", err)\n\t\t\t}\n\n\t\t\tif !cmdutil.InteractiveTerminal() {\n\t\t\t\tfmt.Fprint(get.env.esc.stdout, markdown.String())\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\trenderer, err := style.Glamour(get.env.esc.stdout, glamour.WithWordWrap(0))\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"internal error: creating renderer: %w\", err)\n\t\t\t}\n\t\t\trendered, err := renderer.Render(markdown.String())\n\t\t\tif err != nil {\n\t\t\t\trendered = markdown.String()\n\t\t\t}\n\t\t\tfmt.Fprint(get.env.esc.stdout, rendered)\n\t\t\treturn nil\n\t\t},\n\t}\n\n\tcmd.Flags().BoolVar(\n\t\t&defOnly, \"definition\", false,\n\t\t\"Set to print just the definition.\")\n\tcmd.Flags().StringVar(\n\t\t&value, \"value\", \"\",\n\t\t\"Set to print just the value in the given format. May be 'dotenv', 'json', 'detailed', 'shell' or 'string'\")\n\tcmd.Flags().BoolVar(\n\t\t&showSecrets, \"show-secrets\", false,","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/esc/cli/env_get.go#L113-L149","documentation":"For interactive terminals the CLI renders the markdown report with the glamour library via `style.Glamour`. If the renderer cannot be constructed (e.g. terminal capability/style setup failure), the command fails with `internal error: creating renderer: %w`. Like error 273, this indicates an environment/CLI problem rather than bad user input.","triggerScenarios":"`style.Glamour(get.env.esc.stdout, glamour.WithWordWrap(0))` returns an error during an interactive `pulumi env get` run — typically misconfigured TERM, missing terminfo, or a broken glamour/auto-detection of terminal width.","commonSituations":"Running inside odd terminal emulators, CI wrappers that fake a TTY, minimal containers lacking terminfo entries, or with exotic `TERM` values.","solutions":["Set a standard `TERM` value (e.g. `export TERM=xterm-256color`) or unset a bogus one.","Redirect output to a file/pipe so the non-interactive markdown path is used.","Upgrade the CLI; if it persists, file a bug since rendering failures fall back only for Render, not renderer creation."],"exampleFix":"// before\nTERM=vt100x pulumi env get my-org/my-env\n// after\nTERM=xterm-256color pulumi env get my-org/my-env","handlingStrategy":"fallback","validationCode":"// shell\nif [ -t 1 ] && [ -z \"$TERM\" -o \"$TERM\" = \"dumb\" ]; then\n  echo \"unset/odd TERM; forcing non-interactive-safe output\" >&2\nfi","typeGuard":null,"tryCatchPattern":"// shell\npulumi env get \"$ENV_REF\" || pulumi env get \"$ENV_REF\" --value json","preventionTips":["Set a widely available TERM such as xterm-256color in containers and CI.","Pipe or redirect output in automation so the glamour path is skipped.","Keep the CLI current so terminal-detection fixes are picked up."],"tags":["cli","esc","terminal","glamour","internal-error"],"backgroundTag":"terminal-renderer-init-failed","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}