{"record":{"id":"74c27af1c6603bc7","repo":"JanDeDobbeleer/oh-my-posh","slug":"unknown-pulumi-spec-file-format","errorCode":null,"errorMessage":"unknown pulumi spec file format","messagePattern":"unknown pulumi spec file format","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/segments/pulumi.go","lineNumber":131,"sourceCode":"\t\t}\n\t}\n\n\tif kind == \"\" {\n\t\treturn fmt.Errorf(\"no pulumi spec file found\")\n\t}\n\n\tvar pulumiFileSpec pulumiFileSpec\n\tvar err error\n\n\tpulumiFile := p.env.FileContent(fileName)\n\n\tswitch kind {\n\tcase YAML:\n\t\terr = yaml.Unmarshal([]byte(pulumiFile), &pulumiFileSpec)\n\tcase JSON:\n\t\terr = json.Unmarshal([]byte(pulumiFile), &pulumiFileSpec)\n\tdefault:\n\t\terr = fmt.Errorf(\"unknown pulumi spec file format\")\n\t}\n\n\tif err != nil {\n\t\tlog.Error(err)\n\t\treturn nil\n\t}\n\n\tp.Name = pulumiFileSpec.Name\n\n\tp.workspaceSHA1 = p.sha1HexString(p.env.Pwd() + path.Separator() + fileName)\n\n\treturn nil\n}\n\nfunc (p *Pulumi) sha1HexString(s string) string {\n\th := sha1.New()\n\n\t_, err := h.Write([]byte(s))","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/segments/pulumi.go#L113-L149","documentation":"The oh-my-posh pulumi segment reads the Pulumi project spec file (Pulumi.yaml or Pulumi.json) in the current directory to extract the project name. It decides how to parse the file based on the file extension (yaml/json). This error is thrown in the default branch of that switch when the located spec file has an extension the segment does not recognize, so it cannot deserialize the project name.","triggerScenarios":"A spec file matching the pulumi project layout but with an extension other than .yaml or .json exists in the working directory (the loop in getProjectName picks the last file from the [Pulumi.yaml, Pulumi.json] list present, so kind can only be 'yaml' or 'json'; in practice this branch fires only if a non-standard file is matched by HasFiles or the extension case differs, e.g. Pulumi.YAML on a case-sensitive filesystem).","commonSituations":"Case-mismatched filenames (Pulumi.YAML) on Linux, custom spec filenames picked up by the segment, or future Pulumi formats the segment does not support yet. The segment logs the error and returns nil from getProjectName, so Enabled returns false and the segment silently disappears.","solutions":["Rename the spec file to Pulumi.yaml or Pulumi.json (exact lowercase extension)","Verify only the standard Pulumi.yaml/Pulumi.json files exist in the project root","Check the logged error in the prompt debug output (oh-my-posh debug) to confirm which file was matched"],"exampleFix":"// before: file named Pulumi.YAML on Linux\n$ mv Pulumi.YAML Pulumi.yaml\n// after: segment detects kind == \"yaml\" and parses the project name","handlingStrategy":"validation","validationCode":"if !fileExists(\"Pulumi.yaml\") && !fileExists(\"Pulumi.json\") {\n    // segment will be disabled; don't rely on pulumi data in the template\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the spec file named exactly Pulumi.yaml or Pulumi.json with a lowercase extension","Avoid renaming project spec files to other extensions","Use `oh-my-posh debug` to check segment errors when a segment silently disappears"],"tags":["go","pulumi","config-parsing","prompt-segment"],"backgroundTag":"unsupported-file-format","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}