Invalid shift value in prefixCoded string (is encoded value really an INT?)

Hi
I don't know what I am doing what. I had in the same index in different
type another field with different data type. I read that this can be a
problem so I deleted that type but the problem is still there

Cluster:
{

  • cluster_name: elasticsearch
  • master_node: nlbyQzhDQsqJExdfpFlGDg
  • blocks: { }
  • nodes: {
    • nlbyQzhDQsqJExdfpFlGDg: {
      • name: Crusher
      • transport_address: inet[/192.168.1.125:9300]
      • attributes: { }
        }
        }
  • metadata: {
    • templates: { }
    • indices: {
      • logs: {
        • state: open
        • settings: {
          • index.number_of_replicas: 1
          • index.number_of_shards: 5
          • index.version.created: 190099
            }
        • mappings: {
          • action_log: {
            • properties: {
              • allowed: {
                • type: byte
                  }
              • post: {
                • type: string
                  }
              • get: {
                • type: string
                  }
              • date: {
                • format: dateOptionalTime
                • type: date
                  }
              • plugin: {
                • type: integer
                  }
              • ip: {
                • type: ip
                  }
              • id: {
                • type: string
                  }
              • is_visible: {
                • type: byte
                  }
              • message: {
                • type: string
                  }
              • duration: {
                • type: float
                  }
              • action: {
                • type: integer
                  }
              • action_name: {
                • type: string
                  }
              • user_id: {
                • type: integer
                  }
              • success: {
                • type: byte
                  }
                  }
                  }
          • console: {
            • properties: {
              • allowed: {
                • type: byte
                  }
              • post: {
                • type: string
                  }
              • get: {
                • type: string
                  }
              • date: {
                • format: dateOptionalTime
                • type: date
                  }
              • plugin: {
                • type: integer
                  }
              • ip: {
                • type: ip
                  }
              • id: {
                • type: string
                  }
              • is_visible: {
                • type: byte
                  }
              • message: {
                • type: string
                  }
              • duration: {
                • type: float
                  }
              • action: {
                • type: integer
                  }
              • user_id: {
                • type: integer
                  }
              • success: {
                • type: byte
                  }
                  }
                  }
          • action: {
            • properties: {
              • allowed: {
                • type: byte
                  }
              • post: {
                • type: string
                  }
              • get: {
                • type: string
                  }
              • date: {
                • format: dateOptionalTime
                • type: date
                  }
              • plugin: {
                • type: integer
                  }
              • ip: {
                • type: ip
                  }
              • id: {
                • type: string
                  }
              • is_visible: {
                • type: byte
                  }
              • message: {
                • type: string
                  }
              • duration: {
                • type: float
                  }
              • action: {
                • type: integer
                  }
              • action_name: {
                • type: string
                  }
              • user_id: {
                • type: integer
                  }
              • success: {
                • type: byte
                  }
                  }
                  }
                  }
        • aliases: [
          • gps_roy
          • gps_local
            ]
            }
            }
            }
  • routing_table: {
    • indices: {
      • logs: {
        • shards: {
          • 0: [
            • {
              • state: STARTED
              • primary: true
              • node: nlbyQzhDQsqJExdfpFlGDg
              • relocating_node: null
              • shard: 0
              • index: logs
                }
            • {
              • state: UNASSIGNED
              • primary: false
              • node: null
              • relocating_node: null
              • shard: 0
              • index: logs
                }
                ]
          • 1: [
            • {
              • state: STARTED
              • primary: true
              • node: nlbyQzhDQsqJExdfpFlGDg
              • relocating_node: null
              • shard: 1
              • index: logs
                }
            • {
              • state: UNASSIGNED
              • primary: false
              • node: null
              • relocating_node: null
              • shard: 1
              • index: logs
                }
                ]
          • 2: [
            • {
              • state: STARTED
              • primary: true
              • node: nlbyQzhDQsqJExdfpFlGDg
              • relocating_node: null
              • shard: 2
              • index: logs
                }
            • {
              • state: UNASSIGNED
              • primary: false
              • node: null
              • relocating_node: null
              • shard: 2
              • index: logs
                }
                ]
          • 3: [
            • {
              • state: STARTED
              • primary: true
              • node: nlbyQzhDQsqJExdfpFlGDg
              • relocating_node: null
              • shard: 3
              • index: logs
                }
            • {
              • state: UNASSIGNED
              • primary: false
              • node: null
              • relocating_node: null
              • shard: 3
              • index: logs
                }
                ]
          • 4: [
            • {
              • state: STARTED
              • primary: true
              • node: nlbyQzhDQsqJExdfpFlGDg
              • relocating_node: null
              • shard: 4
              • index: logs
                }
            • {
              • state: UNASSIGNED
              • primary: false
              • node: null
              • relocating_node: null
              • shard: 4
              • index: logs
                }
                ]
                }
                }
                }
                }
  • routing_nodes: {
    • unassigned: [
      • {
        • state: UNASSIGNED
        • primary: false
        • node: null
        • relocating_node: null
        • shard: 0
        • index: logs
          }
      • {
        • state: UNASSIGNED
        • primary: false
        • node: null
        • relocating_node: null
        • shard: 1
        • index: logs
          }
      • {
        • state: UNASSIGNED
        • primary: false
        • node: null
        • relocating_node: null
        • shard: 2
        • index: logs
          }
      • {
        • state: UNASSIGNED
        • primary: false
        • node: null
        • relocating_node: null
        • shard: 3
        • index: logs
          }
      • {
        • state: UNASSIGNED
        • primary: false
        • node: null
        • relocating_node: null
        • shard: 4
        • index: logs
          }
          ]
    • nodes: {
      • nlbyQzhDQsqJExdfpFlGDg: [
        • {
          • state: STARTED
          • primary: true
          • node: nlbyQzhDQsqJExdfpFlGDg
          • relocating_node: null
          • shard: 0
          • index: logs
            }
        • {
          • state: STARTED
          • primary: true
          • node: nlbyQzhDQsqJExdfpFlGDg
          • relocating_node: null
          • shard: 1
          • index: logs
            }
        • {
          • state: STARTED
          • primary: true
          • node: nlbyQzhDQsqJExdfpFlGDg
          • relocating_node: null
          • shard: 2
          • index: logs
            }
        • {
          • state: STARTED
          • primary: true
          • node: nlbyQzhDQsqJExdfpFlGDg
          • relocating_node: null
          • shard: 3
          • index: logs
            }
        • {
          • state: STARTED
          • primary: true
          • node: nlbyQzhDQsqJExdfpFlGDg
          • relocating_node: null
          • shard: 4
          • index: logs
            }
            ]
            }
            }
  • allocations: [ ]

}

Error:
[2012-03-21 11:02:16,411][DEBUG][action.search.type ] [Crusher]
[logs][3], node[nlbyQzhDQsqJExdfpFlGDg], [P], s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@11ec4e7]
org.elasticsearch.search.query.QueryPhaseExecutionException: [logs][3]:
query[filtered(user_id:[33 TO
33])->cache(_type:action_log)],from[0],size[10]: Query Failed [Failed to
execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:198)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:140)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.NumberFormatException: Invalid shift value in
prefixCoded string (is encoded value really an INT?)
at
org.apache.lucene.util.NumericUtils.prefixCodedToInt(NumericUtils.java:232)
at
org.apache.lucene.search.FieldCache$7.parseInt(FieldCache.java:243)
at
org.elasticsearch.index.field.data.ints.IntFieldData$IntTypeLoader.collectTerm(IntFieldData.java:150)
at
org.elasticsearch.index.field.data.support.FieldDataLoader.load(FieldDataLoader.java:55)
at
org.elasticsearch.index.field.data.ints.IntFieldData.load(IntFieldData.java:135)
at
org.elasticsearch.index.field.data.ints.IntFieldDataType.load(IntFieldDataType.java:91)
at
org.elasticsearch.index.field.data.ints.IntFieldDataType.load(IntFieldDataType.java:33)
at
org.elasticsearch.index.field.data.FieldData.load(FieldData.java:111)
at
org.elasticsearch.index.cache.field.data.support.AbstractConcurrentMapFieldDataCache.cache(AbstractConcurrentMapFieldDataCache.java:122)
at
org.elasticsearch.search.facet.terms.ints.TermsIntOrdinalsFacetCollector.doSetNextReader(TermsIntOrdinalsFacetCollector.java:127)
at
org.elasticsearch.search.facet.AbstractFacetCollector.setNextReader(AbstractFacetCollector.java:75)
at
org.elasticsearch.common.lucene.MultiCollector.setNextReader(MultiCollector.java:67)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:576)
at
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:195)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:445)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:426)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:342)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:330)
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:194)

curl -XGET http://localhost:9200/gps_local/action_log/_search -d
'{"facets":{"tag":{"terms":{"size":5,"field":"action"}}},"query":{"bool":{"must":[{"term":{"user_id":33}},{"term":{"is_visible":1}}]}}}'

I have similar exception on a local client. It was happening on the
junit tests against this local client. Putting Thread.sleap(60*1000)
on the local ES before the tests shut down improved it a bit but it
still happens on every 20-30 builds.
It looks like the ES is not able to to shut down properly and this
breaks the index for the next start.
The strange thing is this never happens on the test system which is
doing much more intensive jmeter tests. The difference is that there
ES never shuts down.

On Mar 23, 2:05 pm, Pavel Dvorak pavel.dvorak.w...@gmail.com wrote:

curl -XGEThttp://localhost:9200/gps_local/action_log/_search-d
'{"facets":{"tag":{"terms":{"size":5,"field":"action"}}},"query":{"bool":{"must":[{"term":{"user_id":33}},{"term":{"is_visible":1}}]}}}'

Deleting the type will not help in this case. The type and its
correspondant data will still remain (and the offending field with
different data type), they will just be marked as deleted. You can send an
optimize request with only_expundge_deletes set, and it will optimize the
index to remove deleted docs (note, it can be expensive on a large index).

On Fri, Mar 23, 2012 at 2:03 PM, Pavel Dvorak
pavel.dvorak.work@gmail.comwrote:

Hi
I don't know what I am doing what. I had in the same index in different
type another field with different data type. I read that this can be a
problem so I deleted that type but the problem is still there

Cluster:
{

  • cluster_name: elasticsearch
  • master_node: nlbyQzhDQsqJExdfpFlGDg
  • blocks: { }
  • nodes: {
    • nlbyQzhDQsqJExdfpFlGDg: {
      • name: Crusher
      • transport_address: inet[/192.168.1.125:9300]
      • attributes: { }
        }
        }
  • metadata: {
    • templates: { }
    • indices: {
      • logs: {
        • state: open
        • settings: {
          • index.number_of_replicas: 1
          • index.number_of_shards: 5
          • index.version.created: 190099
            }
        • mappings: {
          • action_log: {
            • properties: {
              • allowed: {
                • type: byte
                  }
              • post: {
                • type: string
                  }
              • get: {
                • type: string
                  }
              • date: {
                • format: dateOptionalTime
                • type: date
                  }
              • plugin: {
                • type: integer
                  }
              • ip: {
                • type: ip
                  }
              • id: {
                • type: string
                  }
              • is_visible: {
                • type: byte
                  }
              • message: {
                • type: string
                  }
              • duration: {
                • type: float
                  }
              • action: {
                • type: integer
                  }
              • action_name: {
                • type: string
                  }
              • user_id: {
                • type: integer
                  }
              • success: {
                • type: byte
                  }
                  }
                  }
          • console: {
            • properties: {
              • allowed: {
                • type: byte
                  }
              • post: {
                • type: string
                  }
              • get: {
                • type: string
                  }
              • date: {
                • format: dateOptionalTime
                • type: date
                  }
              • plugin: {
                • type: integer
                  }
              • ip: {
                • type: ip
                  }
              • id: {
                • type: string
                  }
              • is_visible: {
                • type: byte
                  }
              • message: {
                • type: string
                  }
              • duration: {
                • type: float
                  }
              • action: {
                • type: integer
                  }
              • user_id: {
                • type: integer
                  }
              • success: {
                • type: byte
                  }
                  }
                  }
          • action: {
            • properties: {
              • allowed: {
                • type: byte
                  }
              • post: {
                • type: string
                  }
              • get: {
                • type: string
                  }
              • date: {
                • format: dateOptionalTime
                • type: date
                  }
              • plugin: {
                • type: integer
                  }
              • ip: {
                • type: ip
                  }
              • id: {
                • type: string
                  }
              • is_visible: {
                • type: byte
                  }
              • message: {
                • type: string
                  }
              • duration: {
                • type: float
                  }
              • action: {
                • type: integer
                  }
              • action_name: {
                • type: string
                  }
              • user_id: {
                • type: integer
                  }
              • success: {
                • type: byte
                  }
                  }
                  }
                  }
        • aliases: [
          • gps_roy
          • gps_local
            ]
            }
            }
            }
  • routing_table: {
    • indices: {
      • logs: {
        • shards: {
          • 0: [
            • {
              • state: STARTED
              • primary: true
              • node: nlbyQzhDQsqJExdfpFlGDg
              • relocating_node: null
              • shard: 0
              • index: logs
                }
            • {
              • state: UNASSIGNED
              • primary: false
              • node: null
              • relocating_node: null
              • shard: 0
              • index: logs
                }
                ]
          • 1: [
            • {
              • state: STARTED
              • primary: true
              • node: nlbyQzhDQsqJExdfpFlGDg
              • relocating_node: null
              • shard: 1
              • index: logs
                }
            • {
              • state: UNASSIGNED
              • primary: false
              • node: null
              • relocating_node: null
              • shard: 1
              • index: logs
                }
                ]
          • 2: [
            • {
              • state: STARTED
              • primary: true
              • node: nlbyQzhDQsqJExdfpFlGDg
              • relocating_node: null
              • shard: 2
              • index: logs
                }
            • {
              • state: UNASSIGNED
              • primary: false
              • node: null
              • relocating_node: null
              • shard: 2
              • index: logs
                }
                ]
          • 3: [
            • {
              • state: STARTED
              • primary: true
              • node: nlbyQzhDQsqJExdfpFlGDg
              • relocating_node: null
              • shard: 3
              • index: logs
                }
            • {
              • state: UNASSIGNED
              • primary: false
              • node: null
              • relocating_node: null
              • shard: 3
              • index: logs
                }
                ]
          • 4: [
            • {
              • state: STARTED
              • primary: true
              • node: nlbyQzhDQsqJExdfpFlGDg
              • relocating_node: null
              • shard: 4
              • index: logs
                }
            • {
              • state: UNASSIGNED
              • primary: false
              • node: null
              • relocating_node: null
              • shard: 4
              • index: logs
                }
                ]
                }
                }
                }
                }
  • routing_nodes: {
    • unassigned: [
      • {
        • state: UNASSIGNED
        • primary: false
        • node: null
        • relocating_node: null
        • shard: 0
        • index: logs
          }
      • {
        • state: UNASSIGNED
        • primary: false
        • node: null
        • relocating_node: null
        • shard: 1
        • index: logs
          }
      • {
        • state: UNASSIGNED
        • primary: false
        • node: null
        • relocating_node: null
        • shard: 2
        • index: logs
          }
      • {
        • state: UNASSIGNED
        • primary: false
        • node: null
        • relocating_node: null
        • shard: 3
        • index: logs
          }
      • {
        • state: UNASSIGNED
        • primary: false
        • node: null
        • relocating_node: null
        • shard: 4
        • index: logs
          }
          ]
    • nodes: {
      • nlbyQzhDQsqJExdfpFlGDg: [
        • {
          • state: STARTED
          • primary: true
          • node: nlbyQzhDQsqJExdfpFlGDg
          • relocating_node: null
          • shard: 0
          • index: logs
            }
        • {
          • state: STARTED
          • primary: true
          • node: nlbyQzhDQsqJExdfpFlGDg
          • relocating_node: null
          • shard: 1
          • index: logs
            }
        • {
          • state: STARTED
          • primary: true
          • node: nlbyQzhDQsqJExdfpFlGDg
          • relocating_node: null
          • shard: 2
          • index: logs
            }
        • {
          • state: STARTED
          • primary: true
          • node: nlbyQzhDQsqJExdfpFlGDg
          • relocating_node: null
          • shard: 3
          • index: logs
            }
        • {
          • state: STARTED
          • primary: true
          • node: nlbyQzhDQsqJExdfpFlGDg
          • relocating_node: null
          • shard: 4
          • index: logs
            }
            ]
            }
            }
  • allocations:

}

Error:
[2012-03-21 11:02:16,411][DEBUG][action.search.type ] [Crusher]
[logs][3], node[nlbyQzhDQsqJExdfpFlGDg], [P], s[STARTED]: Failed to execute
[org.elasticsearch.action.search.SearchRequest@11ec4e7]
org.elasticsearch.search.query.QueryPhaseExecutionException: [logs][3]:
query[filtered(user_id:[33 TO
33])->cache(_type:action_log)],from[0],size[10]: Query Failed [Failed to
execute main query]
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:198)
at
org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:234)
at
org.elasticsearch.search.action.SearchServiceTransportAction.sendExecuteQuery(SearchServiceTransportAction.java:140)
at
org.elasticsearch.action.search.type.TransportSearchQueryThenFetchAction$AsyncAction.sendExecuteFirstPhase(TransportSearchQueryThenFetchAction.java:80)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:204)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.performFirstPhase(TransportSearchTypeAction.java:191)
at
org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$2.run(TransportSearchTypeAction.java:177)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.NumberFormatException: Invalid shift value in
prefixCoded string (is encoded value really an INT?)
at
org.apache.lucene.util.NumericUtils.prefixCodedToInt(NumericUtils.java:232)
at
org.apache.lucene.search.FieldCache$7.parseInt(FieldCache.java:243)
at
org.elasticsearch.index.field.data.ints.IntFieldData$IntTypeLoader.collectTerm(IntFieldData.java:150)
at
org.elasticsearch.index.field.data.support.FieldDataLoader.load(FieldDataLoader.java:55)
at
org.elasticsearch.index.field.data.ints.IntFieldData.load(IntFieldData.java:135)
at
org.elasticsearch.index.field.data.ints.IntFieldDataType.load(IntFieldDataType.java:91)
at
org.elasticsearch.index.field.data.ints.IntFieldDataType.load(IntFieldDataType.java:33)
at
org.elasticsearch.index.field.data.FieldData.load(FieldData.java:111)
at
org.elasticsearch.index.cache.field.data.support.AbstractConcurrentMapFieldDataCache.cache(AbstractConcurrentMapFieldDataCache.java:122)
at
org.elasticsearch.search.facet.terms.ints.TermsIntOrdinalsFacetCollector.doSetNextReader(TermsIntOrdinalsFacetCollector.java:127)
at
org.elasticsearch.search.facet.AbstractFacetCollector.setNextReader(AbstractFacetCollector.java:75)
at
org.elasticsearch.common.lucene.MultiCollector.setNextReader(MultiCollector.java:67)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:576)
at
org.elasticsearch.search.internal.ContextIndexSearcher.search(ContextIndexSearcher.java:195)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:445)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:426)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:342)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:330)
at
org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:194)