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

Bulk operation incorrectly responds with :ok in case of failure #241

Open
akurkin opened this issue Aug 22, 2016 · 3 comments
Open

Bulk operation incorrectly responds with :ok in case of failure #241

akurkin opened this issue Aug 22, 2016 · 3 comments

Comments

@akurkin
Copy link

akurkin commented Aug 22, 2016

hello,
trying to send bulk requests incorrectly responds as {:ok, 200} in case of failure.

Example code:

    data = ...
    payload = bulk([index: "dev", type: "entities"]) do
      index [data]
    end

    Tirexs.bump(payload)._bulk()

Example response:

10:34:53.148 [debug] response = {:ok, 200, %{errors: true, items: [%{create: %{_id: "AVaxY1hfg84TwY4g592U", _index: "dev", _type: "entities", error: %{caused_by: %{reason: "unknown property [day]", type: "illegal_argument_exception"}, 
reason: "failed to parse [timestamp]", type: "mapper_parsing_exception"}, status: 400}}], took: 12}}

Expected response:

{:error, 400, ... }

Thanks,
Alex

@OpakAlex
Copy link
Collaborator

hi @akurkin !
Looks you have issue with mapping in ELK. Can you show me your index?

@akurkin
Copy link
Author

akurkin commented Aug 22, 2016

yes, indeed I had an issue with mapping, I fixed that, but my point is that Tirexs was "routing" my code to "success" callback vs "failure", so I couldn't rely on the response from Tirexs, I had to pattern-match on actual response from elastic to figure out if response was good or not.

@OpakAlex
Copy link
Collaborator

yes, looks issue.

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

No branches or pull requests

2 participants