-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
SQL: JDBC should validate existance of SQL url #30009
Comments
Original comment by @nik9000: +1 for a better error message. Probably worth having something for when SQL is disabled or not installed. I think we already have something for when SQL's license isn't valid, but I imagine we don't test the CLI with it so I expect the error message isn't great. |
A nice error message saying xpack needs to be installed is always nicer then a cryptic internal message. FixedItFriday is in favour of implementing. PS - this specific error is weird - it should complain about a path not being registered. |
I believe it's just hitting RestIndexAction. The rest controlled doesn't care that |
In |
Thanks for the pointer @tvernum (I see the familiar JDK Cheers, |
I'd like to pick this issue up. |
Backported to 6.5.x: 8d83b2d |
Original comment by @costin:
Trying JDBC against a vanilla Elasticsearch, without X-Pack or SQL returns a 'weird' error:
Notice that the error complains an obscure
mode
parameter when in fact the endpoint does not exist and hence the query is handled by the base handler which triggers the exception above.The driver should be smarter than this and return an appropriate error message.
There are several approaches:
Before doing something on a connection do some kind of validation call (HTTP
HEAD
) or something along those lines. The issue however is that this adds up over time (we keep validating each connection so x2 calls) and it's also fairly light - we only know the endpoint is there, nothing beyond that.Except the exception and handle it appropriately - this is similar to the security case, where we can look at the body and understand what went wrong without having to waste any extra calls. It's also something we can extend long term for things like not being able to open a connection, etc... (client issues).
My preference would be for 2.
Thoughts?
The text was updated successfully, but these errors were encountered: