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
HTTP Connection implementations will take non-200 responses and parse the data as json to help produce more complete exceptions. They do this even if the response contains data of a different type (like text/plain), triggering log messages.
This condition can also be reproduced in tests for the connection classes that ship with this library.
In our production environment we see this most often when rotating passwords for our client roles: the password changes, a routine operation receives a 401 which we catch as an AuthorizationException, but the library also logs that it could not parse the (plain text) response.
What is the expected behavior?
Do not attempt to parse the response as json when it is not json. This will also cause us to stop logging when parsing fails.
What is your host/environment?
Docker image opensearchproject/opensearch:1.1.0 + security plugin
opensearch-py==1.0.0
Python 3.9.5
Do you have any screenshots?
N/A
Do you have any additional context?
I put up a small PR to fix this.
The text was updated successfully, but these errors were encountered:
What is the bug?
HTTP
Connection
implementations will take non-200 responses and parse the data as json to help produce more complete exceptions. They do this even if the response contains data of a different type (like text/plain), triggering log messages.How can one reproduce the bug?
This condition can also be reproduced in tests for the connection classes that ship with this library.
In our production environment we see this most often when rotating passwords for our client roles: the password changes, a routine operation receives a 401 which we catch as an AuthorizationException, but the library also logs that it could not parse the (plain text) response.
What is the expected behavior?
Do not attempt to parse the response as json when it is not json. This will also cause us to stop logging when parsing fails.
What is your host/environment?
Docker image opensearchproject/opensearch:1.1.0 + security plugin
opensearch-py==1.0.0
Python 3.9.5
Do you have any screenshots?
N/A
Do you have any additional context?
I put up a small PR to fix this.
The text was updated successfully, but these errors were encountered: