{"record":{"id":"8374b906b9613c9b","repo":"quarkusio/quarkus","slug":"the-latitude-must-be-in-85-05112878-85-05112878-8374b9","errorCode":null,"errorMessage":"The latitude must be in [85.05112878, 85.05112878]","messagePattern":"The latitude must be in \\[85\\.05112878, 85\\.05112878\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/datasource/Validation.java","lineNumber":109,"sourceCode":"\n    static <K, V> void notNullOrEmpty(Map<K, V> map, String name) {\n        if (map == null) {\n            throw new IllegalArgumentException(\"`\" + name + \"` must not be `null`\");\n        }\n        if (map.size() == 0) {\n            throw new IllegalArgumentException(\"`\" + name + \"` must not be empty\");\n        }\n    }\n\n    static void validateLongitude(double longitude) {\n        if (longitude < -180 || longitude > 180) {\n            throw new IllegalArgumentException(\"The longitude must be in [-180, 180]\");\n        }\n    }\n\n    static void validateLatitude(double latitude) {\n        if (latitude < -85.05112878 || latitude > 85.05112878) {\n            throw new IllegalArgumentException(\"The latitude must be in [85.05112878, 85.05112878]\");\n        }\n    }\n\n    public static void validateTimeout(Duration value, String name) {\n        if (value == null) {\n            throw new IllegalArgumentException(String.format(\"`%s` must not be `null`\", name));\n        }\n        if (value.isNegative()) {\n            throw new IllegalArgumentException(String.format(\"`%s` must be greater than or equal to zero\", name));\n        }\n    }\n\n    public static void positive(double amount, String name) {\n        if (amount <= 0) {\n            throw new IllegalArgumentException(String.format(\"`%s` must be greater than zero`\", name));\n        }\n    }\n","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/datasource/Validation.java#L91-L127","documentation":"Validation.validateLatitude checks latitude arguments for Redis GEO commands before they are sent to the server. Valid latitudes for Redis geospatial indexing lie in [-85.05112878, 85.05112878] (the Web Mercator limit), so anything outside is rejected locally with IllegalArgumentException. Note the exception message itself is buggy — it prints the same bound twice instead of [-85.05112878, 85.05112878].","triggerScenarios":"Calling geoadd/geosearch/georadius-style APIs on RedisDataSource with a latitude < -85.05112878 or > 85.05112878, e.g. passing a raw +/-90 pole coordinate or a swapped longitude value in the latitude slot.","commonSituations":"Passing latitude=90 (North Pole) which is valid geography but outside Mercator bounds; swapping lat/lng so a longitude like 151.2 lands in the latitude argument; data imported from coordinate systems with wider latitude ranges.","solutions":["Clamp latitude to [-85.05112878, 85.05112878] before calling the geo API (points at poles cannot be represented in Redis GEO anyway)","Verify latitude and longitude are not swapped in the call","Round the value only if it slightly exceeds the bound due to floating-point noise (e.g. 85.05112878000001)","Reject or relocate such points at data-import time rather than at query time"],"exampleFix":"// before\nredis.geoadd(\"cities\", 2.35, 90.0, \"northpole\"); // throws\n// after\ndouble lat = 85.05112878; // clamped; note pole is not representable in Redis GEO\nredis.geoadd(\"cities\", 2.35, lat, \"near-northpole\");","handlingStrategy":"validation","validationCode":"static boolean isValidLatitude(double lat) { return lat >= -85.05112878 && lat <= 85.05112878; }\nif (!isValidLatitude(lat)) throw new IllegalArgumentException(\"latitude outside Mercator bounds: \" + lat);","typeGuard":null,"tryCatchPattern":"try { redis.geoadd(key, lon, lat, member); } catch (IllegalArgumentException e) { log.warn(\"Bad latitude: {}\", e.getMessage()); }","preventionTips":["Remember Redis GEO uses Web Mercator bounds, not +/-90","Clamp instead of wrapping latitude (wraparound is meaningless for latitude)","Check lat/lng ordering at import boundaries","Ignore the misleading message text; the real range is [-85.05112878, 85.05112878]"],"tags":["redis","validation","illegal-argument","geospatial"],"backgroundTag":"invalid-argument-range","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}