Installing plugin causes Elasticsearch to return 401 #13

temujin9 opened this Issue Jul 12, 2013 · 7 comments


None yet

2 participants


(Following instructions from the Couchbase blog and building a Chef recipe, so it's a very repeatable issue.)

Elasticsearch v0.20.6 on Ubuntu 12.04, with the couchdb.password is in elasticsearch.yml. curl http://localhost:9200 produces the happy status message.

Running 'bin/plugin -install transport-couchbase -url', and then restarting the server, causes the curl command to then return:

root@ip-10-28-98-79:/usr/local/share/elasticsearch# curl http://localhost:9200
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 401 Unauthorized</title>
<h2>HTTP ERROR: 401</h2>
<p>Problem accessing /. Reason:
<pre>    Unauthorized</pre></p>
<hr /><i><small>Powered by Jetty://</small></i>

Turning all logging up to DEBUG shows:

[2013-07-12 17:55:45,216][DEBUG][ ] created SCEP@43a30706{l(/<->r(/,d=false,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=0}-{AsyncHttpConnection@4223d9b,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-14,l=0,c=0},r=0}
[2013-07-12 17:55:45,217][DEBUG][org.eclipse.jetty.http.HttpParser] filled 0/0
[2013-07-12 17:55:45,217][DEBUG][org.eclipse.jetty.http.HttpParser] filled 166/166
[2013-07-12 17:55:45,218][DEBUG][org.eclipse.jetty.server.Server] REQUEST / on AsyncHttpConnection@4223d9b,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-5,l=3,c=0},r=1
[2013-07-12 17:55:45,218][DEBUG][org.eclipse.jetty.server.handler.ContextHandler] scope null||/ @ o.e.j.s.ServletContextHandler{/,null}
[2013-07-12 17:55:45,219][DEBUG][org.eclipse.jetty.server.handler.ContextHandler] context=||/ @ o.e.j.s.ServletContextHandler{/,null}
[2013-07-12 17:55:45,219][DEBUG][org.eclipse.jetty.server.session] sessionManager=org.eclipse.jetty.server.session.HashSessionManager@6a301bf5
[2013-07-12 17:55:45,219][DEBUG][org.eclipse.jetty.server.session] session=null
[2013-07-12 17:55:45,219][DEBUG][org.eclipse.jetty.servlet.ServletHandler] servlet ||/ -> com.couchbase.capi.servlet.CAPIServlet-1387572316
[2013-07-12 17:55:45,222][DEBUG][org.eclipse.jetty.server.Server] RESPONSE /  401
[2013-07-12 17:55:45,223][DEBUG][] ishut SCEP@43a30706{l(/<->r(/,d=true,open=true,ishut=false,oshut=false,rb=false,wb=false,w=true,i=1r}-{AsyncHttpConnection@4223d9b,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=-14,l=0,c=-3},r=1}
[2013-07-12 17:55:45,223][DEBUG][org.eclipse.jetty.http.HttpParser] filled -1/0
[2013-07-12 17:55:45,224][DEBUG][] close SCEP@43a30706{l(/<->r(/,d=true,open=true,ishut=true,oshut=false,rb=false,wb=false,w=true,i=1r}-{AsyncHttpConnection@4223d9b,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=0,l=0,c=-3},r=1}
[2013-07-12 17:55:45,225][DEBUG][ ] destroyEndPoint SCEP@43a30706{l(null)<->r(/,d=true,open=false,ishut=true,oshut=true,rb=false,wb=false,w=true,i=1!}-{AsyncHttpConnection@4223d9b,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=0,l=0,c=-3},r=1}
[2013-07-12 17:55:45,226][DEBUG][org.eclipse.jetty.server.AbstractHttpConnection] closed AsyncHttpConnection@4223d9b,g=HttpGenerator{s=0,h=-1,b=-1,c=-1},p=HttpParser{s=0,l=0,c=-3},r=1

after the curl.

mschoch commented Jul 19, 2013

Sorry for the delay. The setting in the elasticsearch.yml should be "couchbase.password" not "couchdb.password". Can you check that it is set correctly?


It is: I mistyped it here, but it's correct there.

mschoch commented Jul 19, 2013

Did you change the setting "couchbase.port" to 9200? Typically 9200 is used by Elasticsearch, and our plugin tries to use 9091.


I didn't change the couchbase port at all. The call against 9200 before and after is against Elasticsearch, as are the logs; sorry if that was unclear.

mschoch commented Jul 21, 2013

That is strange then, the response after includes "Powered by Jetty" which is only used by our plugin and not by the Elasticsearch core. So it really looks like for some reason the couchbase plugin is taking over port 9200. But I don't have any idea how or why that would happen unless configured to do so.


So I've found and worked around the trigger. If I set http.port in elasticsearch.yml, this happens. Removed it works just fine.

mschoch commented Jul 28, 2013

Thanks, for reporting this. Its possible there is some unexpected interaction between that setting and one of ours. I'll take a look.

@mschoch mschoch added a commit that closed this issue Mar 31, 2014
@mschoch mschoch don't hijack the http.port setting
fixes #11
fixes #13
@mschoch mschoch closed this in 8b803d5 Mar 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment