diff --git a/docs/user/admin/settings.rst b/docs/user/admin/settings.rst index 1d07dde380..7250b76f7d 100644 --- a/docs/user/admin/settings.rst +++ b/docs/user/admin/settings.rst @@ -305,7 +305,7 @@ SQL query:: { "error": { "reason": "Invalid SQL query", - "details": "Failed to parse query due to offending symbol [DELETE] at: 'DELETE' <--- HERE... More details: Expecting tokens in {, 'DESCRIBE', 'SELECT', 'SHOW', ';'}\nQuery failed on both V1 and V2 SQL engines. V1 SQL engine error following: \nDELETE clause is disabled by default and will be deprecated. Using the plugins.sql.delete.enabled setting to enable it", + "details": "Failed to parse query due to offending symbol [DELETE] at: 'DELETE' <--- HERE... More details: Expecting tokens in {, 'DESCRIBE', 'SELECT', 'SHOW', ';'}", "type": "SQLFeatureDisabledException" }, "status": 400 diff --git a/integ-test/src/test/java/org/opensearch/sql/legacy/PluginIT.java b/integ-test/src/test/java/org/opensearch/sql/legacy/PluginIT.java index 5843e5bb5b..6fb59aa742 100644 --- a/integ-test/src/test/java/org/opensearch/sql/legacy/PluginIT.java +++ b/integ-test/src/test/java/org/opensearch/sql/legacy/PluginIT.java @@ -72,10 +72,7 @@ public void sqlDeleteSettingsTest() throws IOException { + " \"reason\": \"Invalid SQL query\",\n" + " \"details\": \"" + "Query request is not supported. Either unsupported fields are present, the " - + "request is not a cursor request, or the response format is not supported.\\n" - + "Query failed on both V1 and V2 SQL engines. V1 SQL engine error following: \\n" - + "DELETE clause is disabled by default and will be deprecated." - + " Using the plugins.sql.delete.enabled setting to enable it\",\n" + + "request is not a cursor request, or the response format is not supported.\",\n" + " \"type\": \"SQLFeatureDisabledException\"\n" + " },\n" + " \"status\": 400\n" diff --git a/legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java b/legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java index c8d352e5a5..94fa76fa41 100644 --- a/legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java +++ b/legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlAction.java @@ -305,7 +305,8 @@ private void sendResponse(final RestChannel channel, final String message, final private void reportError(final RestChannel channel, final Exception e, final RestStatus status) { var message = ErrorMessageFactory.createErrorMessage(e, status.getStatus()); if (null != QueryContext.getError()) { - message.setDetails(QueryContext.getError() + + message.setDetails(QueryContext.getError()); + LOG.error(QueryContext.getError() + "\nQuery failed on both V1 and V2 SQL engines. V1 SQL engine error following: \n" + message.getDetails()); }