{"record":{"id":"6a08fef797965356","repo":"glanceapp/glance","slug":"no-place-found-for-s-in-s","errorCode":null,"errorMessage":"no place found for %s in %s","messagePattern":"no place found for (.+?) in (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/widget-weather.go","lineNumber":197,"sourceCode":"\n\tif len(responseJson.Results) == 0 {\n\t\treturn nil, fmt.Errorf(\"no places found for %s\", location)\n\t}\n\n\tvar place *openMeteoPlaceResponseJson\n\n\tif area != \"\" {\n\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","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget-weather.go#L179-L215","documentation":"The geocoder returned results for the base name, but none whose Area matched the qualifier the user supplied (e.g. 'Springfield, Missouri' when all matches are in other states/countries). After the area-filter loop, place is still nil, so the widget refuses to guess.","triggerScenarios":"An area-qualified location where the lowercase area never equals any Results[i].Area: wrong area name, wrong separator, or a genuinely absent combination.","commonSituations":"Users write 'City, State' with a state the geocoder lists under a different string ('Missouri' vs 'MO'), or use abbreviations the API does not return, or pick a city not present in that area at all.","solutions":["Query the API with the base name and inspect the area field of each result to see the exact expected string","Match the area spelling to what the geocoder returns (full state/country name, not abbreviation)","Drop the qualifier if the unqualified first result is the right place"],"exampleFix":"# before\nlocation: Portland, OR\n\n# after\nlocation: Portland, Oregon","handlingStrategy":"validation","validationCode":"// Verify an area-qualified location has a matching result before deploy\nfunc areaQualifierMatches(name, area string) bool {\n    u := fmt.Sprintf(\"https://geocoding-api.open-meteo.com/v1/search?name=%s&count=20&language=en&format=json\", url.QueryEscape(name))\n    resp, err := http.Get(u)\n    if err != nil { return false }\n    defer resp.Body.Close()\n    var r struct{ Results []struct{ Area string `json:\"admin1\"` } `json:\"results\"` }\n    _ = json.NewDecoder(resp.Body).Decode(&r)\n    for _, res := range r.Results {\n        if strings.EqualFold(res.Area, area) { return true }\n    }\n    return false\n}","typeGuard":"func isNoPlaceInArea(err error) bool {\n\treturn err != nil && strings.HasPrefix(err.Error(), \"no place found for\")\n}","tryCatchPattern":"place, err := fetchOpenMeteoPlaceFromName(cfg.Location)\nif isNoPlaceInArea(err) {\n    return fmt.Errorf(\"location %q does not match geocoder areas: %w\", cfg.Location, err)\n}","preventionTips":["Use the exact area spelling the geocoder returns (usually the full admin1 name, not abbreviations)","Drop the qualifier when the first unqualified result is already correct"],"tags":["weather","geocoding","config","open-meteo"],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}