New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apiserver incorrectly returns 405 when 404 expected during a HEAD request #7517
Comments
If I create an ELB for the Kibana service then everything works perfectly. |
@satnam6502 : In addition to the headers, can you please post the body of response as well. The status object in response body might have more details on why the server thinks that the method is not allowed. |
@satnam6502 Did you mark this v1.0-candidate because Kibana/Elasticsearch aren't working due to this bug, and you think it's important to have them working for 1.0? |
I marked it as a v1.0-candidate because if this really is a bug then a whole class of applications are likely to fall foul of this bug -- which is a shame -- because it then discourages people to deploy software in a way that suits our model (i.e. running a backend server inside the cluster that can make use of DNS etc. as is the case with the new Kibana 4) vs. running a system entirely as a pile of Javascipt in your browser which has lots of issues for us (and that's what we are forced to do now by using an older Kibana that has to speak to the service proxy at the master to access Elasticsearch). |
@nikhiljindal : I shall try to do a repo when I am done with some other work -- perhaps later this week. |
Do we allow HEAD requests at all? I suspect you're getting some of these error codes because of the HEAD verb. Does the client actually attempt HEAD requests? Can you repeat this sequence of actions with GET requests? |
Kibana makes a HEAD request to Elasticsearch to determine if an index exists and if it does not it creates it. We should adjust our proxy to route HEAD requests. |
SGTM |
I think the action item here is to change the spot in api_installer.go where it sets up the go restful stuff to pass all verbs on to the proxy handler. |
Closed via #7950 |
I think this is the root of the reason why the new Kibana to Elasticsearch setup failed to work (even with basic auth). I think a 404 response is incorrectly being turned into a 405 response.
In these example I am running a Kibana service which maps to a pod running a Kibana server.
Note that the Kibana service has the IP 10.0.32.105. If we ssh into a minion and curl against this we get the expected response i.e. "a .kibana index does not exist". This is the correct expected behavior.
However, the Kibana dashboard reports an error when it tries to connect to Elasticsearch (which it does by going through its own URL with the subpath
elasticsearch
) saying the method is not allowed:If we ssh to the master and perform the same HEAD request against the apiserver we get a 404 Forbidden:
Adding the basic auth we get a 405 Method Not Allowed:
However, we should have got the same answer as doing a HEAD request on
10.0.32.105:5601/elasticsearch/.kibana
i.e. a 404 Not Found.I think this is a bug and this is what is preventing Kibana from speaking to Elasticsearch.
@thockin @roberthbailey @lavalamp
Thanks to who @ArtfulCoder who helped diagnose what was going on.
The text was updated successfully, but these errors were encountered: