{"record":{"id":"0aa7b3775083128d","repo":"JanDeDobbeleer/oh-my-posh","slug":"missing-brewfather-user-id-user-id","errorCode":null,"errorMessage":"missing Brewfather user id (user_id)","messagePattern":"missing Brewfather user id \\(user_id\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/segments/brewfather.go","lineNumber":192,"sourceCode":"\tcase BFStatusBrewing:\n\t\treturn bf.options.String(BFBrewingStatusIcon, \"\\uF7DE\")\n\tcase BFStatusFermenting:\n\t\treturn bf.options.String(BFFermentingStatusIcon, \"\\uF499\")\n\tcase BFStatusConditioning:\n\t\treturn bf.options.String(BFConditioningStatusIcon, \"\\uE372\")\n\tcase BFStatusCompleted:\n\t\treturn bf.options.String(BFCompletedStatusIcon, \"\\uF7A5\")\n\tcase BFStatusArchived:\n\t\treturn bf.options.String(BFArchivedStatusIcon, \"\\uF187\")\n\tdefault:\n\t\treturn \"\"\n\t}\n}\n\nfunc (bf *Brewfather) getResult() (*Batch, error) {\n\tuserID := bf.options.Template(BFUserID, \"\", bf)\n\tif userID == \"\" {\n\t\treturn nil, errors.New(\"missing Brewfather user id (user_id)\")\n\t}\n\n\tapiKey := bf.options.Template(APIKey, \"\", bf)\n\tif apiKey == \"\" {\n\t\treturn nil, errors.New(\"missing Brewfather api key (api_key)\")\n\t}\n\n\tbatchID := bf.options.Template(BFBatchID, \"\", bf)\n\tif batchID == \"\" {\n\t\treturn nil, errors.New(\"missing Brewfather batch id (batch_id)\")\n\t}\n\n\tauthString := fmt.Sprintf(\"%s:%s\", userID, apiKey)\n\tauthStringb64 := base64.StdEncoding.EncodeToString([]byte(authString))\n\tauthHeader := fmt.Sprintf(\"Basic %s\", authStringb64)\n\tbatchURL := fmt.Sprintf(\"https://api.brewfather.app/v1/batches/%s\", batchID)\n\tbatchReadingsURL := fmt.Sprintf(\"https://api.brewfather.app/v1/batches/%s/readings\", batchID)\n","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/JanDeDobbeleer/oh-my-posh/blob/0976794618c5ed95de0985dded50de1b4dc914cb/src/segments/brewfather.go#L174-L210","documentation":"The brewfather segment queries the Brewfather API with HTTP Basic auth built from a user id and API key. getResult renders the `user_id` template option first; when it resolves to an empty string it cannot authenticate, so this error is returned and the segment disables itself.","triggerScenarios":"The segment's `user_id` template property is absent from the theme config, or its template renders to an empty string (e.g. referencing an unset variable/environment template).","commonSituations":"Copying a brewfather segment block from a theme example without filling in user_id; the Brewfather account's user id not found in Brewfather app Settings > API; template typos like `{{ .UserId }}` that render empty.","solutions":["Add the Brewfather user id from Brewfather app > Settings > Success/Streaming APIs to the segment's user_id property in your theme config.","Verify the template renders non-empty: if user_id uses template syntax (e.g. {{ .Env.BF_USER_ID }}), make sure that env variable is actually set.","If you don't use Brewfather, remove the brewfather segment from the theme."],"exampleFix":"// before - option missing\n{\n  \"type\": \"brewfather\",\n  \"properties\": { \"api_key\": \"xxx\", \"batch_id\": \"abc\" }\n}\n\n// after\n{\n  \"type\": \"brewfather\",\n  \"properties\": { \"user_id\": \"myUserId\", \"api_key\": \"xxx\", \"batch_id\": \"abc\" }\n}","handlingStrategy":"validation","validationCode":"// check the theme config before rendering\nif config.Brewfather.UserID == \"\" {\n    // user_id property missing - segment will not render\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy the user_id from Brewfather app > Settings > API when adding the segment","If user_id uses a template (e.g. {{ .Env.BF_USER_ID }}), verify the env var is set","Keep user_id, api_key and batch_id together - all three are required"],"tags":["brewfather","config","segment","api-key"],"backgroundTag":"missing-api-key","analyzedSha":"0976794618c5ed95de0985dded50de1b4dc914cb","analyzedAt":"2026-08-31T23:41:19.708Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}