Failed to load resource: the server responded with a status of 405 (Method Not Allowed)

Hello Guys,
While connecting elasticsearch from kibana, Under Management tab,
At "Create Index Pattern" I am getting error "Failed to load Indices"
And In browser console, I get
Failed to load resource: the server responded with a status of 405 (Method Not Allowed)
A strange thing is
I have provided elasticsearch.hosts= "http://some-elasticsearch-url:9200" in kibana configuration.
KIbana is running on some-IP:5601
Why it is trying to connect elasticsearch on
some-IP:5601
instead of http://some-elasticsearch-url:9200

Can you check your Kibana logs (not the browser console) for any errors? Feel free to paste them here.

You see some-ip:5601 in the browser because Kibana is a proxy for Elasticsearch. The browser never accesses Elasticsearch directly.

Hi Nick, Thanks for the help,
Actually, I forgot to mention,
In browser, Under Management > Create Index Pattern
I see 2 pop ups :

  • Failed to load remote clusters
  • Failed to load indices
    BUT I am able to see the list of indices in "Index Management" tab
    Here are kibana logs...

{"type":"log","@timestamp":"2019-06-04T05:19:13Z","tags":["status","plugin:index_lifecycle_management@7.1.0","info"],"pid":1,"state":"green","message":"Status changed from yellow to green - Ready","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}
{"type":"log","@timestamp":"2019-06-04T05:19:13Z","tags":["status","plugin:rollup@7.1.0","info"],"pid":1,"state":"green","message":"Status changed from yellow to green - Ready","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}
{"type":"log","@timestamp":"2019-06-04T05:19:13Z","tags":["status","plugin:remote_clusters@7.1.0","info"],"pid":1,"state":"green","message":"Status changed from yellow to green - Ready","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}
{"type":"log","@timestamp":"2019-06-04T05:19:13Z","tags":["status","plugin:cross_cluster_replication@7.1.0","info"],"pid":1,"state":"green","message":"Status changed from yellow to green - Ready","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}
{"type":"log","@timestamp":"2019-06-04T05:19:13Z","tags":["info","monitoring-ui","kibana-monitoring"],"pid":1,"message":"Starting monitoring stats collection"}
{"type":"log","@timestamp":"2019-06-04T05:19:13Z","tags":["status","plugin:security@7.1.0","info"],"pid":1,"state":"green","message":"Status changed from yellow to green - Ready","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}
{"type":"log","@timestamp":"2019-06-04T05:19:13Z","tags":["status","plugin:maps@7.1.0","info"],"pid":1,"state":"green","message":"Status changed from yellow to green - Ready","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}
{"type":"log","@timestamp":"2019-06-04T05:19:13Z","tags":["license","info","xpack"],"pid":1,"message":"Imported license information from Elasticsearch for the [monitoring] cluster: mode: basic | status: active"}
{"type":"log","@timestamp":"2019-06-04T05:19:15Z","tags":["reporting","browser-driver","warning"],"pid":1,"message":"Enabling the Chromium sandbox provides an additional layer of protection."}
{"type":"log","@timestamp":"2019-06-04T05:19:15Z","tags":["reporting","warning"],"pid":1,"message":"Generating a random key for xpack.reporting.encryptionKey. To prevent pending reports from failing on restart, please set xpack.reporting.encryptionKey in kibana.yml"}
{"type":"log","@timestamp":"2019-06-04T05:19:15Z","tags":["status","plugin:reporting@7.1.0","info"],"pid":1,"state":"green","message":"Status changed from uninitialized to green - Ready","prevState":"uninitialized","prevMsg":"uninitialized"}
{"type":"log","@timestamp":"2019-06-04T05:19:16Z","tags":["info","task_manager"],"pid":1,"message":"Installing .kibana_task_manager index template version: 7010099."}
{"type":"log","@timestamp":"2019-06-04T05:19:16Z","tags":["info","task_manager"],"pid":1,"message":"Installed .kibana_task_manager index template: version 7010099 (API version 1)"}
{"type":"log","@timestamp":"2019-06-04T05:19:17Z","tags":["info","migrations"],"pid":1,"message":"Creating index .kibana_1."}
{"type":"log","@timestamp":"2019-06-04T05:19:18Z","tags":["info","migrations"],"pid":1,"message":"Pointing alias .kibana to .kibana_1."}
{"type":"log","@timestamp":"2019-06-04T05:19:18Z","tags":["info","migrations"],"pid":1,"message":"Finished in 656ms."}
{"type":"log","@timestamp":"2019-06-04T05:19:18Z","tags":["listening","info"],"pid":1,"message":"Server running at http://0:5601"}
{"type":"log","@timestamp":"2019-06-04T05:19:18Z","tags":["status","plugin:spaces@7.1.0","info"],"pid":1,"state":"green","message":"Status changed from yellow to green - Ready","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}
{"type":"response","@timestamp":"2019-06-04T05:19:18Z","tags":,"pid":1,"method":"get","statusCode":200,"req":{"url":"/app/kibana","method":"get","headers":{"user-agent":"curl/7.29.0","host":"localhost:5601","accept":"/"},"remoteAddress":"127.0.0.1","userAgent":"127.0.0.1"},"res":{"statusCode":200,"responseTime":1363,"contentLength":9},"message":"GET /app/kibana 200 1363ms - 9.0B"}
{"type":"response","@timestamp":"2019-06-04T05:19:29Z","tags":,"pid":1,"method":"get","statusCode":200,"req":{"url":"/app/kibana","method":"get","headers":{"user-agent":"curl/7.29.0","host":"localhost:5601","accept":"/"},"remoteAddress":"127.0.0.1","userAgent":"127.0.0.1"},"res":{"statusCode":200,"responseTime":89,"contentLength":9},"message":"GET /app/kibana 200 89ms - 9.0B"}
{"type":"response","@timestamp":"2019-06-04T05:19:39Z","tags":,"pid":1,"method":"get","statusCode":200,"req":{"url":"/app/kibana","method":"get","headers":{"user-agent":"curl/7.29.0","host":"localhost:5601","accept":"/"},"remoteAddress":"127.0.0.1","userAgent":"127.0.0.1"},"res":{"statusCode":200,"responseTime":87,"contentLength":9},"message":"GET /app/kibana 200 87ms - 9.0B"}

Sorry, the logs output is messy.
These are kibana container logs

Hi Nick,
One more thing,
I am running elasticsearch and kibana in Kubernetes Cluster and, Kibana is exposed outside using nginx ingress controller.
So when I remove nginx and try to connect Kibana directly,
It's successful.
So is there any specific configuration to be done to run KIbana behind nginx?

Probably my question is similar to this

https://discuss.elastic.co/t/kibana-fails-to-load-indices-when-trying-to-set-up-an-index-pattern-in-management-tab/173964

Only difference is I am using nginx.
So what should

Maybe you can set the server.basePath parameter in kibana.yml as suggested in this thread. Kibana via nginx proxy

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.