Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] GET /api/user/current fails with 500 #306

Closed
jakubgs opened this issue Oct 13, 2020 · 2 comments
Closed

[bug] GET /api/user/current fails with 500 #306

jakubgs opened this issue Oct 13, 2020 · 2 comments

Comments

@jakubgs
Copy link

jakubgs commented Oct 13, 2020

Work Environment

Question Answer
OS version (server) Ubuntu 20.04
Cortex version / git hash 3.0.1-1
Package Type Binary
ElasticSearch 7.8.0

Problem Description

I started Cortex with a very standard config based on the provided one in which essentially I just changed the url and index. After creating the cortex_4 index manually I tried opening the Web UI but all I got were failed GET /api/user/current requests receiving 500 errors:

{
  "type": "com.fasterxml.jackson.databind.exc.MismatchedInputException",
  "message": "Cannot deserialize instance of `long` out of START_OBJECT token\n at [Source: (String)\"{\"took\":6,\"timed_out\":false,\"_shards\":{\"total\":3,\"successful\":3,\"skipped\":0,\"failed\":0},\"hits\":{\"total\":{\"value\":0,\"relation\":\"eq\"},\"max_score\":null,\"hits\":[]}}\"; line: 1, column: 105] (through reference chain: com.sksamuel.elastic4s.http.search.SearchResponse[\"hits\"]->com.sksamuel.elastic4s.http.search.SearchHits[\"total\"])"
}

Which shows up in logs as:

[info] o.t.c.s.ErrorHandler [|] GET /api/user/current returned 500
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `long` out of START_OBJECT token
 at [Source: (String)"{"took":5,"timed_out":false,"_shards":{"total":3,"successful":3,"skipped":0,"failed":0},"hits":{"total":{"value":0,"relation":"eq"},"max_score":null,"hits":[]}}"; line: 1, column: 105] (through reference chain: com.sksamuel.elastic4s.http.search.SearchResponse["hits"]->com.sksamuel.elastic4s.http.search.SearchHits["total"])
        at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
        at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1342)
        at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1138)
        at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1092)
        at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$LongDeserializer._parseLong(NumberDeserializers.java:593)
        at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$LongDeserializer.deserialize(NumberDeserializers.java:557)
        at com.fasterxml.jackson.databind.deser.std.NumberDeserializers$LongDeserializer.deserialize(NumberDeserializers.java:535)
        at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:530)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:528)
        at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:417)

Which I have no idea what I'm supposed to do about.

@To-om
Copy link
Contributor

To-om commented Oct 30, 2020

You must not create the index manually. This the reason of this problem.

@To-om To-om closed this as completed Oct 30, 2020
@jakubgs
Copy link
Author

jakubgs commented Oct 30, 2020

The index was not being created because 3.0.1-1 does not support ElasticSearch 7.8.0.

I was doubly confused because 3.1.0-RC1 which is supposed to support ES 7 was also not creating it, but that was a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants