{"record":{"id":"ad70300fd5fcb368","repo":"apereo/cas","slug":"unable-to-determine-geolocation-results-for","errorCode":null,"errorMessage":"Unable to determine geolocation results for [{}]","messagePattern":"Unable to determine geolocation results for \\[(.+?)\\]","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"support/cas-server-support-geolocation-ip/src/main/java/org/apereo/cas/support/geo/ip/IPGeoLocationService.java","lineNumber":44,"sourceCode":"    public GeoLocationResponse locate(final InetAddress address) {\n        val geolocation = api.lookupIpGeolocation(LookupIpGeolocationRequest.builder()\n            .ip(address.getHostAddress()).lang(Language.EN).build());\n\n        LOGGER.debug(\"Geolocation results for [{}] are [{}]\", address.getHostAddress(), geolocation);\n        if (geolocation.data().location() != null) {\n            val location = new GeoLocationResponse();\n            val geoLocation = geolocation.data().location();\n            return location\n                .setLatitude(Double.parseDouble(StringUtils.defaultIfBlank(geoLocation.latitude(), \"0.0\")))\n                .setLongitude(Double.parseDouble(StringUtils.defaultIfBlank(geoLocation.longitude(), \"0.0\")))\n                .addAddress(geoLocation.city())\n                .addAddress(geoLocation.stateProv())\n                .addAddress(geoLocation.countryNameOfficial())\n                .addAddress(geoLocation.countryCode2())\n                .addAddress(geoLocation.countryCode3())\n                .addAddress(geoLocation.zipcode());\n        }\n        LOGGER.warn(\"Unable to determine geolocation results for [{}]\", address.getHostAddress());\n        return null;\n    }\n\n    @Override\n    public GeoLocationResponse locate(final Double latitude, final Double longitude) {\n        return null;\n    }\n}\n","sourceCodeStart":26,"sourceCodeEnd":53,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/support/cas-server-support-geolocation-ip/src/main/java/org/apereo/cas/support/geo/ip/IPGeoLocationService.java#L26-L53","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before (proxy IP seen by CAS)\n// no proxy header handling\n// after (forward real client IP)\nserver.forward-headers-strategy=framework\ncas.authn.geo.ip.trustedProxyIps=10.0.0.5,10.0.0.6","handlingStrategy":"fallback","validationCode":"if (address.isSiteLocalAddress() || address.isLoopbackAddress()) {\n    LOGGER.info(\"skipping geolocation for non-routable address\");\n}","typeGuard":null,"tryCatchPattern":"GeoLocationResponse loc = service.locate(address);\nif (loc == null) {\n    loc = GeoLocationResponse.empty(); // or default policy\n}","preventionTips":["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"],"tags":["geolocation","ip-lookup","null-result"],"backgroundTag":"empty-result-set","analyzedSha":"e7288fc434b4f4505b8452e1a57e8fb3111bb863","analyzedAt":"2026-09-08T15:39:16.015Z","contentChangedAt":"2026-09-08T15:39:16.015Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}