Skip to content

#create_index! produces error output under correct operation #571

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

Closed
dogweather opened this issue May 26, 2016 · 9 comments
Closed

#create_index! produces error output under correct operation #571

dogweather opened this issue May 26, 2016 · 9 comments

Comments

@dogweather
Copy link

dogweather commented May 26, 2016

Given that there's no index, when this is executed:

klass.__elasticsearch__.create_index! force: true

then this is sent to stderr:

[!!!] Index does not exist (Elasticsearch::Transport::Transport::Errors::NotFound)

I believe that nothing should be sent to stderr in this particular case, because we've asked the lib to "create an index, over-writing any potentially existing one". And so there's no error when none exists.

I'm willing to contribute a PR if this issue is approved.

(Relevant code)

@andyw8
Copy link

andyw8 commented Apr 5, 2017

@dogweather any luck with solving this? I'm not super familiar with with ES but this message pollutes my test output.

@karmi
Copy link
Contributor

karmi commented Apr 6, 2017

Hi @andyw8, I think we've debated adding some "quiet mode" in some issue, but I don't recall the reference now.

Looking at the code now, it comes from delete_index!, where we should use the ignore option in the Elasticsearch client, instead of capturing the exception like this.

@webhive
Copy link

webhive commented Jul 18, 2018

Any progress on it? Very annoying!

@Kani999
Copy link

Kani999 commented Jan 24, 2019

Still not solved?

@shawndeprey
Copy link

shawndeprey commented Feb 25, 2019

Still running into this issue as well. The quiet mode that @karmi mentioned above would be very useful.

@estolfo
Copy link
Contributor

estolfo commented Feb 26, 2019

@shawndeprey @Kani999 @andyw8 @dogweather how does this solution look?
I use the client transport logger to log the message. That way, the user has control over whether it's printed via the log level.

@shawndeprey
Copy link

@estolfo If I understand what client.transport is this seems reasonable to me as this will follow the logging set in our application configuration. 👍

@estolfo
Copy link
Contributor

estolfo commented Feb 27, 2019

@shawndeprey client.transport is the client transport layer, which is where the logger would be set if you set one on an Elasticsearch::Client. That said, it sounds like we're on the same page = )

@estolfo
Copy link
Contributor

estolfo commented Jul 19, 2019

Closing as this has been resolved in the linked PR.

@estolfo estolfo closed this as completed Jul 19, 2019
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

7 participants