You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The extra opening of a { when writing an array breaks the serialization of objects containing arrays copied using this method. The following code snippet demonstrates how to reproduce the error:
The query contains a syntax error (unclosed parens). The code path within the server goes through the pointed out line above. The response object wrapped in the ElasticsearchException seems to be copied using this method. Trying to call toString on it leads to the following error:
Exception in thread "main" jakarta.json.stream.JsonGenerationException: Illegal method during JSON generation, not valid in current context IN_OBJECT
at org.eclipse.parsson.JsonGeneratorImpl.writeStartObject(JsonGeneratorImpl.java:121)
at co.elastic.clients.json.JsonpUtils.copy(JsonpUtils.java:167)
at co.elastic.clients.json.JsonpUtils.copy(JsonpUtils.java:180)
at co.elastic.clients.json.JsonpUtils.copy(JsonpUtils.java:157)
at co.elastic.clients.json.jackson.JacksonJsonBuffer.serialize(JacksonJsonBuffer.java:98)
at co.elastic.clients.elasticsearch._types.ErrorCause.serializeInternal(ErrorCause.java:168)
at co.elastic.clients.elasticsearch._types.ErrorCause.serialize(ErrorCause.java:160)
at co.elastic.clients.elasticsearch._types.ErrorResponse.serializeInternal(ErrorResponse.java:96)
at co.elastic.clients.elasticsearch._types.ErrorResponse.serialize(ErrorResponse.java:89)
at co.elastic.clients.json.JsonpUtils.toString(JsonpUtils.java:409)
at co.elastic.clients.json.JsonpUtils.toString(JsonpUtils.java:346)
at co.elastic.clients.elasticsearch._types.ErrorResponse.toString(ErrorResponse.java:105)
at LuceneParseBug.main(LuceneParseBug.java:39)
Suppressed: jakarta.json.stream.JsonGenerationException: Generating incomplete JSON
at org.eclipse.parsson.JsonGeneratorImpl.close(JsonGeneratorImpl.java:519)
at co.elastic.clients.json.JsonpUtils.toString(JsonpUtils.java:408)
... 3 more
The text was updated successfully, but these errors were encountered:
Java API client version
8.8.0
Java version
19
Elasticsearch Version
8.8.0
Problem description
This line introduced in the context of #508 seems to be mistaken.
The extra opening of a
{
when writing an array breaks the serialization of objects containing arrays copied using this method. The following code snippet demonstrates how to reproduce the error:The query contains a syntax error (unclosed parens). The code path within the server goes through the pointed out line above. The response object wrapped in the
ElasticsearchException
seems to be copied using this method. Trying to calltoString
on it leads to the following error:The text was updated successfully, but these errors were encountered: