Unable to connect to ES 5.6.2
See original GitHub issueI am trying to integrate stagemonitor into an existing Java 1.7.0_80 project, and when trying to connect to elasticsearch 5.6.2 on my local, it fails to think that elasticsearch is available. Digging into the code a little bit looks like HEAD call that happens to elasticsearch for status fails with a “java.net.ProtocolException: HTTP method HEAD doesn’t support output” exception when it attempts to get the pass the output stream from the HttpUrlConnection to the request.
if (request.getOutputStreamHandler() != null) {
request.getOutputStreamHandler().withHttpURLConnection(connection.getOutputStream());
}
Looking at the calling code, the response isn’t even used, so we could potentially pass null as the output stream handler for this call in order to not fail in this instance. Has anyone else run into this issue? I’m happy to fix and create a PR for this, but want to make sure it isn’t a configuration issue before I do that.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Mixed that up while writing the response, sorry 😉
A
NoopOutputStreamHandler
does not make sense indeed. I was not aware, thatconnection.getOutputStream
could throw e.g. for HEAD requests. Given that it could cause errors (and that we have a replacement), we should remove it.I’ve created PR https://github.com/stagemonitor/stagemonitor/pull/331 for this.