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
Failing to connect to an OpenSearch cluster with a bad username/password gives unhelpful error:
Exception in thread "main" jakarta.json.stream.JsonParsingException: Jackson exception: Unrecognized token 'Unauthorized': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (ByteArrayInputStream); line: 1, column: 13]
at org.opensearch.client.json.jackson.JacksonJsonpParser.convertException(JacksonJsonpParser.java:97)
at org.opensearch.client.json.jackson.JacksonJsonpParser.fetchNextToken(JacksonJsonpParser.java:104)
at org.opensearch.client.json.jackson.JacksonJsonpParser.next(JacksonJsonpParser.java:131)
at org.opensearch.client.json.JsonpDeserializer.deserialize(JsonpDeserializer.java:82)
at org.opensearch.client.json.ObjectBuilderDeserializer.deserialize(ObjectBuilderDeserializer.java:92)
at org.opensearch.client.json.DelegatingDeserializer$SameType.deserialize(DelegatingDeserializer.java:56)
at org.opensearch.client.transport.rest_client.RestClientTransport.getHighLevelResponse(RestClientTransport.java:271)
at org.opensearch.client.transport.rest_client.RestClientTransport.performRequest(RestClientTransport.java:143)
at org.opensearch.client.opensearch.cluster.OpenSearchClusterClient.getSettings(OpenSearchClusterClient.java:282)
at org.opensearch.dataprepper.plugins.sink.opensearch.index.AbstractIndexManager.checkISMEnabled(AbstractIndexManager.java:187)
at org.opensearch.dataprepper.plugins.sink.opensearch.index.AbstractIndexManager.checkAndCreateIndexTemplate(AbstractIndexManager.java:208)
at org.opensearch.dataprepper.plugins.sink.opensearch.index.AbstractIndexManager.setupIndex(AbstractIndexManager.java:203)
at org.opensearch.dataprepper.plugins.sink.opensearch.OpenSearchSink.doInitializeInternal(OpenSearchSink.java:174)
at org.opensearch.dataprepper.plugins.sink.opensearch.OpenSearchSink.doInitialize(OpenSearchSink.java:139)
at org.opensearch.dataprepper.model.sink.AbstractSink.initialize(AbstractSink.java:39)
at org.opensearch.dataprepper.pipeline.Pipeline.isReady(Pipeline.java:194)
at org.opensearch.dataprepper.DataPrepper.execute(DataPrepper.java:93)
at org.opensearch.dataprepper.DataPrepperExecute.main(DataPrepperExecute.java:42)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'Unauthorized': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: (ByteArrayInputStream); line: 1, column: 13]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2418)
at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:759)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._reportInvalidToken(UTF8StreamJsonParser.java:3693)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2781)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:907)
at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:793)
at org.opensearch.client.json.jackson.JacksonJsonpParser.fetchNextToken(JacksonJsonpParser.java:102)
... 16 more
How can one reproduce the bug?
use opensearch-java client with wrong username or password configured to call any API against a opensearch engine
What is the expected behavior?
A clear error message indicating wrong username or password
What is your host/environment?
macOS.
Do you have any screenshots?
Do you have any additional context?
The bug seems to be at parsing with both RestClientTransport and AwsSdk2Transport
The text was updated successfully, but these errors were encountered:
@wbeckler This one seems not so straightforward to fix as the low level response entity is just a string value of Unauthorized which is not valid json. We probably need to modify that message to be more clear. Do you have suggestions where it can be modified?
@chenqi0805 The fix you submitted for this error parsing issue is an improvement. Thank you for these bar-raising issues and PRs. To answer your question above, for issues around the response from the OpenSearch server, one option is to open an issue in the core repo, https://github.com/opensearch-project/OpenSearch/issues
What is the bug?
Failing to connect to an OpenSearch cluster with a bad username/password gives unhelpful error:
How can one reproduce the bug?
use opensearch-java client with wrong username or password configured to call any API against a opensearch engine
What is the expected behavior?
A clear error message indicating wrong username or password
What is your host/environment?
macOS.
Do you have any screenshots?
Do you have any additional context?
The bug seems to be at parsing with both
RestClientTransport
andAwsSdk2Transport
The text was updated successfully, but these errors were encountered: