Illegal latitude value for – How to solve this OpenSearch exception

Opster Team

Aug-23, Version: 1-1.1

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your OpenSearch operation.

Briefly, this error occurs when the latitude value provided in a geospatial query in OpenSearch exceeds the valid range of -90 to 90 degrees. This could be due to a typo or incorrect data input. To resolve this issue, you should first verify the latitude values in your data. If the values are incorrect, correct them. If the values are correct but still causing the error, check your query syntax to ensure you’re not inadvertently altering the values. Lastly, ensure your OpenSearch version supports the geospatial features you’re using.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

This guide will help you check for common problems that cause the log ” illegal latitude value [{}] for [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following OpenSearch concepts: index, query.

Log Context

Log “illegal latitude value [{}] for [{}]” class name is We extracted the following from OpenSearch source code for those seeking an in-depth context :

 // validation was not available prior to 2.x; so to support bwc
 // percolation queries we only ignore_malformed on 2.x created indexes
 if (!GeoValidationMethod.isIgnoreMalformed(validationMethod)) {
 for (GeoPoint point : shell) {
 if (!GeoUtils.isValidLatitude( {
 throw new QueryShardException(context; "illegal latitude value [{}] for [{}]";;
 if (!GeoUtils.isValidLongitude(point.lon())) {
 throw new QueryShardException(context; "illegal longitude value [{}] for [{}]"; point.lon();


How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Get expert answers on Elasticsearch/OpenSearch