pivio / pivio-server

Central DB Server with a simple REST API. Backend by Elasticsearch.
Apache License 2.0
21 stars 5 forks source link

Can not upload a document if ID is more than BIG_INTEGER and it is the first document #2

Closed oliverwehrens closed 8 years ago

oliverwehrens commented 8 years ago

If the id is a very large number and it is the first pivio document to be uploaded, it seems like elasticsearch tries to parse this as BIG_INTEGER and fails with.

org.elasticsearch.ElasticsearchIllegalStateException: No matching token for number_type [BIG_INTEGER]
    at org.elasticsearch.common.xcontent.json.JsonXContentParser.convertNumberType(JsonXContentParser.java:207) ~[elasticsearch-1.5.2.jar:na]
    at org.elasticsearch.common.xcontent.json.JsonXContentParser.numberType(JsonXContentParser.java:66) ~[elasticsearch-1.5.2.jar:na]
    at org.elasticsearch.index.mapper.object.ObjectMapper.parseDynamicValue(ObjectMapper.java:799) ~[elasticsearch-1.5.2.jar:na]
    at org.elasticsearch.index.mapper.object.ObjectMapper.serializeValue(ObjectMapper.java:708) ~[elasticsearch-1.5.2.jar:na]
    at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:497) ~[elasticsearch-1.5.2.jar:na]
    at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:544) ~[elasticsearch-1.5.2.jar:na]
    at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:493) ~[elasticsearch-1.5.2.jar:na]
    at org.elasticsearch.index.shard.IndexShard.prepareIndex(IndexShard.java:492) ~[elasticsearch-1.5.2.jar:na]
    at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:192) ~[elasticsearch-1.5.2.jar:na]
    at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase.performOnPrimary(TransportShardReplicationOperationAction.java:574) ~[na:na]
    at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$PrimaryPhase$1.doRun(TransportShardReplicationOperationAction.java:440) ~[na:na]
    at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:36) ~[elasticsearch-1.5.2.jar:na]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_05]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_05]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_05]

A smaller number or a string fixes this. Converting back to a big number later and uploading works.

fmueller commented 8 years ago

Not reproducible.