apache / apache/beam

elasticsearch Bad Request during ConnectionConfiguration create

Open
#18,502 0 comments 0 reactions 0 assignees View on GitHub
bug elasticsearch io java P4
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
2d 5h
Merged PRs (30d)
204

Description

I am getting the following when connecting to a elastic search instance
Runner: Spark

code
{{ ConnectionConfiguration connectionConfiguration = ConnectionConfiguration.create(new String[] {"http://elasticsearch:9200"},"bigindex_write","bigindex");
}}
Error
{{FATAL: Connection to elasticsearch elasticsearch:9200 failedNov 01, 2017 1:13:15 PM .listener.Kafka2Elastic main
SEVERE: FATAL: Connection to elasticsearch elasticsearch:9200 failed
org.elasticsearch.client.ResponseException: GET http://elasticsearch:9200/: HTTP/1.1 400 Bad Request
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"empty headers are not allowed []"}],"type":"illegal_argument_exception","reason":"empty headers are not allowed []"},"status":400}
at org.elasticsearch.client.RestClient$1.completed(RestClient.java:310)
at org.elasticsearch.client.RestClient$1.completed(RestClient.java:299)
at org.apache.http.concurrent.BasicFuture.completed(BasicFuture.java:119)
at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseCompleted(DefaultClientExchangeHandlerImpl.java:177)
at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.processResponse(HttpAsyncRequestExecutor.java:436)
at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.inputReady(HttpAsyncRequestExecutor.java:326)
at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:265)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:588)
at java.lang.Thread.run(Thread.java:748)
}}

Imported from Jira [BEAM-3132](https://issues.apache.org/jira/browse/BEAM-3132). Original Jira may contain additional context.
Reported by: orjan.lundberg@gmail.com.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the ConnectionConfiguration.create call against the Elasticsearch URL and review the Elasticsearch client request shown in the stack trace. Determine why the request receives the empty-headers 400 response; done means the connection succeeds without that error, with a focused regression test if the relevant test location can be identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, java, spark
Domain
databases, search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.