{"record":{"id":"06a1f567d6d6c237","repo":"glanceapp/glance","slug":"loading-location-v","errorCode":null,"errorMessage":"loading location: %v","messagePattern":"loading location: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/widget-weather.go","lineNumber":205,"sourceCode":"\t\tarea = strings.ToLower(area)\n\n\t\tfor i := range responseJson.Results {\n\t\t\tif strings.ToLower(responseJson.Results[i].Area) == area {\n\t\t\t\tplace = &responseJson.Results[i]\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif place == nil {\n\t\t\treturn nil, fmt.Errorf(\"no place found for %s in %s\", location, area)\n\t\t}\n\t} else {\n\t\tplace = &responseJson.Results[0]\n\t}\n\n\tloc, err := time.LoadLocation(place.Timezone)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"loading location: %v\", err)\n\t}\n\n\tplace.location = loc\n\n\treturn place, nil\n}\n\nfunc fetchWeatherForOpenMeteoPlace(place *openMeteoPlaceResponseJson, units string) (*weather, error) {\n\tquery := url.Values{}\n\tvar temperatureUnit string\n\n\tif units == \"imperial\" {\n\t\ttemperatureUnit = \"fahrenheit\"\n\t} else {\n\t\ttemperatureUnit = \"celsius\"\n\t}\n\n\tquery.Add(\"latitude\", fmt.Sprintf(\"%f\", place.Latitude))","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget-weather.go#L187-L223","documentation":"After a geocoding match, time.LoadLocation(place.Timezone) failed: the IANA timezone string returned by Open-Meteo is not loadable by Go on this host. Weather timestamps cannot be rendered in local time without it.","triggerScenarios":"The geocoder returns an unusual or malformed timezone identifier, or the host lacks the tzdata database (minimal containers like distroless/scratch/alpine without tzdata installed) so even valid zones fail to load.","commonSituations":"Running Glance in a slim Docker image without the tzdata package; a rare place whose timezone string in Open-Meteo is not a valid IANA zone name.","solutions":["Install tzdata in the container (e.g. apk add tzdata / apt-get install tzdata) or ensure /usr/share/zoneinfo is present","As a fallback, run with the tzdata-embedded binary or set ZONEINFO to a zoneinfo.zip","If tzdata is present, report the place/timezone pair as an Open-Meteo data issue"],"exampleFix":"# before (Dockerfile)\nFROM alpine:3.20\n\n# after\nFROM alpine:3.20\nRUN apk add --no-cache tzdata","handlingStrategy":"validation","validationCode":"// Confirm the host can load IANA zones before depending on weather time labels\nfunc tzdataAvailable(sampleZone string) bool {\n    _, err := time.LoadLocation(sampleZone) // e.g. \"Europe/Amsterdam\"\n    return err == nil\n}","typeGuard":"func isLoadLocationErr(err error) bool {\n\treturn err != nil && strings.HasPrefix(err.Error(), \"loading location\")\n}","tryCatchPattern":"place, err := fetchOpenMeteoPlaceFromName(cfg.Location)\nif isLoadLocationErr(err) {\n    // environment problem (missing tzdata), not a config problem: fix the image, don't retry\n    return fmt.Errorf(\"host cannot load timezones — install tzdata: %w\", err)\n}","preventionTips":["Include tzdata in container images that render timezones","Smoke-test time.LoadLocation(\"UTC\") in deployment healthchecks","Embed tzdata (import _ \"time/tzdata\") if the binary must run on bare hosts"],"tags":["weather","timezone","tzdata","container","open-meteo"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}