{"record":{"id":"bb8cfc431730ffc5","repo":"JanDeDobbeleer/oh-my-posh","slug":"pulumi-about-output-decode-error","errorCode":null,"errorMessage":"pulumi about output decode error","messagePattern":"pulumi about output decode error","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/segments/pulumi.go","lineNumber":177,"sourceCode":"\tif p.Stack == \"\" {\n\t\tlog.Error(fmt.Errorf(\"pulumi stack name is empty, use `fetch_stack` property to enable stack fetching\"))\n\t\treturn\n\t}\n\n\taboutOutput, err := p.env.RunCommand(\"pulumi\", \"about\", \"--json\")\n\n\tif err != nil {\n\t\tlog.Error(fmt.Errorf(\"unable to get pulumi about output\"))\n\t\treturn\n\t}\n\n\tvar about struct {\n\t\tBackend *Backend `json:\"backend\"`\n\t}\n\n\terr = json.Unmarshal([]byte(aboutOutput), &about)\n\tif err != nil {\n\t\tlog.Error(fmt.Errorf(\"pulumi about output decode error\"))\n\t\treturn\n\t}\n\n\tif about.Backend == nil {\n\t\tlog.Debug(\"pulumi about backend is not set\")\n\t\treturn\n\t}\n\n\tp.Backend = *about.Backend\n}\n","sourceCodeStart":159,"sourceCodeEnd":188,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/segments/pulumi.go#L159-L188","documentation":"The segment ran `pulumi about --json` successfully but the output could not be deserialized into the expected structure containing a `backend` object. This error is thrown by json.Unmarshal failing, meaning the command printed something that is not valid JSON of the expected shape (the raw error is swallowed and replaced by this generic message).","triggerScenarios":"pulumi prints a human-readable message or warning before the JSON, the CLI version emits a different JSON schema, or the output is truncated/localized. Any drift between pulumi's `about --json` output and the segment's expected `{\"backend\": {\"url\": ..., \"user\": ...}}` shape triggers this.","commonSituations":"Older or newer pulumi CLI versions whose JSON schema changed, pulumi writing progress/warning lines to stdout, or a shell wrapper around pulumi that pollutes output.","solutions":["Run `pulumi about --json | jq .` to verify the output is valid JSON with a backend key","Upgrade or downgrade the pulumi CLI so its about JSON matches the expected schema","Check for shell wrappers/aliases that add output around the pulumi command","If backend info is not needed, disable fetch_about in the segment properties"],"exampleFix":"// before: pulumi 2.x output without backend field\n{\"config\": ...}   // decode of backend fails\n// after: upgrade CLI\n$ pulumi version   # >= 3.x\n$ pulumi about --json  # {\"backend\": {\"url\": ..., \"user\": ...}}","handlingStrategy":"try-catch","validationCode":"const out = execFileSync(\"pulumi\", [\"about\", \"--json\"], {encoding: \"utf8\"});\nconst about = JSON.parse(out);\nif (!about.backend) console.warn(\"no backend in pulumi about output\");","typeGuard":"function hasBackend(o) {\n  return o && typeof o === \"object\" && o.backend !== null && typeof o.backend === \"object\";\n}","tryCatchPattern":"try {\n  const about = JSON.parse(out);\n} catch (e) {\n  // inspect raw `pulumi about --json` output; check CLI version\n}","preventionTips":["Pin/upgrade the pulumi CLI so its JSON schema matches what the segment expects","Remove shell wrappers/aliases that add output around pulumi commands","Sanity-check `pulumi about --json | jq .` after CLI upgrades"],"tags":["go","pulumi","json-decode","cli-version"],"backgroundTag":"unexpected-cli-output","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}