# Number format exception for geo\_point field

**URL:** <https://discuss.elastic.co/t/number-format-exception-for-geo-point-field/201759>\
**Category:** Elasticsearch\
**Created:** [October 1, 2019, 9:00am UTC](https://discuss.elastic.co/t/number-format-exception-for-geo-point-field/201759 "2019-10-01T09:00:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Wee](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Jason\_Wee](https://discuss.elastic.co/u/Jason_Wee)\
**Post date:** [October 1, 2019, 9:00am UTC](https://discuss.elastic.co/t/number-format-exception-for-geo-point-field/201759/1 "2019-10-01T09:00:23Z")

</div>

Hi, in elasticsearch log file, we often see this

```auto
[2019-10-01 09:39:10,694][INFO][rest.suppressed] /my_index/my_type/1569915520584.1689070526/_update Params: {version_type=force, doc_as_upsert=true, index=my_index, op_type=create, id=1569915520584.1689070526, type=my_type, consistency=one, version=1569915550527, ttl=8121600000ms, detect_noop=false}
RemoteTransportException[[node06][1.2.3.4:9300][indices:data/write/update[s]]]; nested: MapperParsingException[failed to parse [geo_location]]; nested: NumberFormatException[For input string: "33.927704,-118.2034"];
Caused by: MapperParsingException[failed to parse [geo_location]]; nested: NumberFormatException[For input string: "33.927704,-118.2034"];
	at org.elasticsearch.index.mapper.FieldMapper.parse(FieldMapper.java:343)
	at org.elasticsearch.index.mapper.DocumentParser.parseObjectOrField(DocumentParser.java:318)
	at org.elasticsearch.index.mapper.DocumentParser.parseAndMergeUpdate(DocumentParser.java:765)
	at org.elasticsearch.index.mapper.DocumentParser.parseDynamicValue(DocumentParser.java:652)
	at org.elasticsearch.index.mapper.DocumentParser.parseValue(DocumentParser.java:451)
	at org.elasticsearch.index.mapper.DocumentParser.parseObject(DocumentParser.java:271)
	at org.elasticsearch.index.mapper.DocumentParser.innerParseDocument(DocumentParser.java:131)
	at org.elasticsearch.index.mapper.DocumentParser.parseDocument(DocumentParser.java:79)
	at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:304)
	at org.elasticsearch.index.shard.IndexShard.prepareIndex(IndexShard.java:580)
	at org.elasticsearch.index.shard.IndexShard.prepareIndexOnPrimary(IndexShard.java:559)
	at org.elasticsearch.action.index.TransportIndexAction.prepareIndexOperationOnPrimary(TransportIndexAction.java:211)
	at org.elasticsearch.action.index.TransportIndexAction.executeIndexRequestOnPrimary(TransportIndexAction.java:223)
	at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:157)
	at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:65)
	at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryPhase.doRun(TransportReplicationAction.java:595)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
	at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryOperationTransportHandler.messageReceived(TransportReplicationAction.java:263)
	at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryOperationTransportHandler.messageReceived(TransportReplicationAction.java:260)
	at org.elasticsearch.transport.TransportService$4.doRun(TransportService.java:350)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NumberFormatException: For input string: "33.927704,-118.2034"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Long.parseLong(Long.java:589)
	at java.lang.Long.parseLong(Long.java:631)
	at org.elasticsearch.common.xcontent.support.AbstractXContentParser.longValue(AbstractXContentParser.java:145)
	at org.elasticsearch.index.mapper.core.LongFieldMapper.innerParseCreateField(LongFieldMapper.java:275)
	at org.elasticsearch.index.mapper.core.NumberFieldMapper.parseCreateField(NumberFieldMapper.java:241)
	at org.elasticsearch.index.mapper.FieldMapper.parse(FieldMapper.java:335)
	... 23 more

```

We checked, the mapping for field geo\_location is having type of geo\_point. We are using elasticsearch 2.2.1.

We try to reproduce this by index a new document and update the same document, we are unable to reproduce. However, the above exception if found from elasticsearch log file from time to time.

Can anyone tell how to reproduce this and why is this happening?

Thank you.

Jason

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 2, 2019, 9:03am UTC](https://discuss.elastic.co/t/number-format-exception-for-geo-point-field/201759/2 "2019-10-02T09:03:58Z")

</div>

first, please upgrade your elasticsearch version. This version is well over 3.5 years old and this is missing not only a ton of features, but more importantly a ton of bugfixes...

second, is it possible that the mapping for this field is a number (despite it's name) and thus it cannot be parsed as a geo point. Please check the mapping of the index. Thanks!

---

<div class="post-metadata">

**Author:** ![Jason\_Wee](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Jason\_Wee](https://discuss.elastic.co/u/Jason_Wee)\
**Post date:** [October 3, 2019, 10:29am UTC](https://discuss.elastic.co/t/number-format-exception-for-geo-point-field/201759/3 "2019-10-03T10:29:46Z")

</div>

Hi Alexander,

can you specify which version that fix the exception I shown above?

I have specified in my initial post, the field geo\_location is using geo\_point type.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 7, 2019, 12:19pm UTC](https://discuss.elastic.co/t/number-format-exception-for-geo-point-field/201759/4 "2019-10-07T12:19:28Z")

</div>

then please provide a full reproduction containing index creation, mapping setup and document storage for others to reproduce your issue.

Thanks!

---

<div class="post-metadata">

**Author:** ![Jason\_Wee](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Jason\_Wee](https://discuss.elastic.co/u/Jason_Wee)\
**Post date:** [October 7, 2019, 12:40pm UTC](https://discuss.elastic.co/t/number-format-exception-for-geo-point-field/201759/5 "2019-10-07T12:40:11Z")

</div>

Unfortunately I have tried to reproduce but was unable to reproduce in the testing environment. This only happen in production. Sure, I can give you the steps.

---

<div class="post-metadata">

**Author:** ![Jason\_Wee](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Jason\_Wee](https://discuss.elastic.co/u/Jason_Wee)\
**Post date:** [October 10, 2019, 12:44pm UTC](https://discuss.elastic.co/t/number-format-exception-for-geo-point-field/201759/6 "2019-10-10T12:44:18Z")

</div>

curl -XPUT '[http://localhost:9200/my\_index/?pretty](http://localhost:9200/my_index/?pretty)' -d '{  
"settings" : {  
"number\_of\_shards" : '5',  
"number\_of\_replicas" : '2'  
},  
"mappings" : {  
"my\_type" : {  
"\_ttl" : { "enabled" : true, "default" : 64800000000},  
"\_parent": {  
"type": "user"  
},  
"\_routing": {  
"required": true  
},  
"properties": {  
"geo\_location": {  
"type": "geo\_point",  
"fields": {  
"raw": {  
"type": "string",  
"index": "not\_analyzed"  
}  
}  
},  
}  
},  
"user" : {  
"\_ttl" : { "enabled" : true, "default" : 64800000000},  
"properties": {  
"count": {  
"type": "string",  
"fields": {  
"count\_long": {  
"type": "long"  
}  
}  
}  
}  
}  
}  
}'

```
$ curl -XPOST 'http://localhost:9200/my_index/my_type/s1?routing=u1' -d '{
> "geo_location" : {
> "lat": 41.12,
> "lon": -71.34
> }
> }'
{"_index":"my_index","_type":"my_type","_id":"s1","_version":1,"_shards":{"total":1,"successful":1,"failed":0},"created":true}

$ curl -XPOST 'http://localhost:9200/my_index/my_type/s2?routing=u2' -d '{
> "geo_location" : "41.12,-71.34"
> }'
{"_index":"my_index","_type":"my_type","_id":"s2","_version":1,"_shards":{"total":1,"successful":1,"failed":0},"created":true}

$ curl -XPOST 'http://localhost:9200/my_index/my_type/s3?routing=u3' -d '{
> "geo_location" : ["41.12, -71.34"]
> }'
{"_index":"my_index","_type":"my_type","_id":"s3","_version":1,"_shards":{"total":1,"successful":1,"failed":0},"created":true}

curl -XPOST 'http://localhost:9200/my_index/my_type/s4?routing=u4' -d '{
     "geo_location" : "43.757004,-71.6881"
}' 

$ curl -XPOST 'http://localhost:9200/my_index/my_type/s4?routing=u4' -d '{
> "geo_location" : "43.757004,-71.6881"
> }' 
{"_index":"my_index","_type":"my_type","_id":"s4","_version":1
```

---

<div class="post-metadata">

**Author:** ![Jason\_Wee](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@Jason\_Wee](https://discuss.elastic.co/u/Jason_Wee)\
**Post date:** [October 10, 2019, 12:45pm UTC](https://discuss.elastic.co/t/number-format-exception-for-geo-point-field/201759/7 "2019-10-10T12:45:11Z")

</div>

I mentioned in my initial post that I have tried that locally but was unable to reproduce locally and thus unable to find out the problem. Perhaps the best question is , what are the way to find out the exception in production?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 7, 2019, 12:45pm UTC](https://discuss.elastic.co/t/number-format-exception-for-geo-point-field/201759/8 "2019-11-07T12:45:15Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
