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

SQL: handle X-Pack or X-Pack SQL not being available in a more graceful way #34736

Merged
merged 9 commits into from
Oct 25, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ private <R> ResponseOrException<R> parserError() throws IOException {
}
SqlExceptionType type = SqlExceptionType.fromRemoteFailureType(failure.type());
if (type == null) {
if (con.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) {
return new ResponseOrException<>(new SQLException("It doesn't look like the X-Pack or the X-Pack SQL component"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slight rephrasing, removing some the and typos: X-Pack/ SQL do not seem to be available on the Elasticsearch node using the access path '...' . Please verify X-Pack is installed and SQL enabled. Alternatively, check if any proxy is interfering the communication to Elasticsearch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I modified it.

+ " are available on this Elasticsearch node using the access path '"
+ con.getURL().getHost()
+ (con.getURL().getPort() > 0 ? ":" + con.getURL().getPort() : "")
+ "'."
+ " Please verify that X-Pack is installed and SQL enabled; alternatively, check if any proxy is interferring"
+ " with the SQL request to Elasticsearch",
SQL_STATE_BAD_SERVER));
}
return new ResponseOrException<>(new SQLException("Server sent bad type ["
+ failure.type() + "]. Original type was [" + failure.reason() + "]. ["
+ failure.remoteTrace() + "]", SQL_STATE_BAD_SERVER));
Expand Down