apereo/cas · warning
Unable to determine geolocation results for
Error message
Unable to determine geolocation results for [{}] What it means
IPGeoLocationService.locate(InetAddress) queries the configured IP geolocation backend for the client address. When the backend returns no usable result (null response or empty location fields), the service logs this warning and returns null, meaning no geolocation data could be derived for the address.
Solutions
- Configure CAS behind a proxy to forward the real client IP (X-Forwarded-For) and enable proxy IP resolution
- Test with a public, routable IP address to confirm the geolocation database works
- Update/refresh the geolocation database or license that maps IPs to locations
- Handle the null return gracefully in calling flows (adaptive/risk-based authentication) with a fallback policy
Example fix
// before (proxy IP seen by CAS) // no proxy header handling // after (forward real client IP) server.forward-headers-strategy=framework cas.authn.geo.ip.trustedProxyIps=10.0.0.5,10.0.0.6
Defensive patterns
Strategy: fallback
Validate before calling
if (address.isSiteLocalAddress() || address.isLoopbackAddress()) {
LOGGER.info("skipping geolocation for non-routable address");
} Try / catch
GeoLocationResponse loc = service.locate(address);
if (loc == null) {
loc = GeoLocationResponse.empty(); // or default policy
} Prevention
- Configure proxy header forwarding so real client IPs are geolocated
- Treat null geolocation as an expected outcome in risk-based rules
- Keep the IP geolocation database/licensing current
When it happens
Trigger: locate(address) called with a private/loopback/unroutable IP (127.0.0.1, 10.x, 192.168.x) or a public IP missing from the geolocation database, so the geoLocation fields (state, country, zip) are absent.
Common situations: Local development where all client IPs are localhost; reverse-proxy setups where CAS sees the proxy IP instead of the client IP; incomplete or unlicensed IP database that lacks the queried address.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- No authentication event has been recorded; CAS cannot…
- Invalid cookie Required remote address does not match
- Geo-locating an address by latitude/longitude
AI-assisted analysis of apereo/cas@e7288fc434 (2026-09-08).
Data as JSON: /api/errors/ad70300fd5fcb368.
Report an issue: GitHub.
Appendix: source
Thrown at support/cas-server-support-geolocation-ip/src/main/java/org/apereo/cas/support/geo/ip/IPGeoLocationService.java:44
public GeoLocationResponse locate(final InetAddress address) {
val geolocation = api.lookupIpGeolocation(LookupIpGeolocationRequest.builder()
.ip(address.getHostAddress()).lang(Language.EN).build());
LOGGER.debug("Geolocation results for [{}] are [{}]", address.getHostAddress(), geolocation);
if (geolocation.data().location() != null) {
val location = new GeoLocationResponse();
val geoLocation = geolocation.data().location();
return location
.setLatitude(Double.parseDouble(StringUtils.defaultIfBlank(geoLocation.latitude(), "0.0")))
.setLongitude(Double.parseDouble(StringUtils.defaultIfBlank(geoLocation.longitude(), "0.0")))
.addAddress(geoLocation.city())
.addAddress(geoLocation.stateProv())
.addAddress(geoLocation.countryNameOfficial())
.addAddress(geoLocation.countryCode2())
.addAddress(geoLocation.countryCode3())
.addAddress(geoLocation.zipcode());
}
LOGGER.warn("Unable to determine geolocation results for [{}]", address.getHostAddress());
return null;
}
@Override
public GeoLocationResponse locate(final Double latitude, final Double longitude) {
return null;
}
}
View on GitHub (pinned to e7288fc434)