JanDeDobbeleer/oh-my-posh · warning

pulumi about output decode error

Error message

pulumi about output decode error

What it means

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).

Source

Thrown at src/segments/pulumi.go:177

	if p.Stack == "" {
		log.Error(fmt.Errorf("pulumi stack name is empty, use `fetch_stack` property to enable stack fetching"))
		return
	}

	aboutOutput, err := p.env.RunCommand("pulumi", "about", "--json")

	if err != nil {
		log.Error(fmt.Errorf("unable to get pulumi about output"))
		return
	}

	var about struct {
		Backend *Backend `json:"backend"`
	}

	err = json.Unmarshal([]byte(aboutOutput), &about)
	if err != nil {
		log.Error(fmt.Errorf("pulumi about output decode error"))
		return
	}

	if about.Backend == nil {
		log.Debug("pulumi about backend is not set")
		return
	}

	p.Backend = *about.Backend
}

View on GitHub (pinned to 0976794618)

Solutions

  1. Run `pulumi about --json | jq .` to verify the output is valid JSON with a backend key
  2. Upgrade or downgrade the pulumi CLI so its about JSON matches the expected schema
  3. Check for shell wrappers/aliases that add output around the pulumi command
  4. If backend info is not needed, disable fetch_about in the segment properties

Example fix

// before: pulumi 2.x output without backend field
{"config": ...}   // decode of backend fails
// after: upgrade CLI
$ pulumi version   # >= 3.x
$ pulumi about --json  # {"backend": {"url": ..., "user": ...}}
Defensive patterns

Strategy: try-catch

Validate before calling

const out = execFileSync("pulumi", ["about", "--json"], {encoding: "utf8"});
const about = JSON.parse(out);
if (!about.backend) console.warn("no backend in pulumi about output");

Type guard

function hasBackend(o) {
  return o && typeof o === "object" && o.backend !== null && typeof o.backend === "object";
}

Try / catch

try {
  const about = JSON.parse(out);
} catch (e) {
  // inspect raw `pulumi about --json` output; check CLI version
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of JanDeDobbeleer/oh-my-posh@0976794618 (2026-08-31). Data as JSON: /api/errors/bb8cfc431730ffc5. Report an issue: GitHub.