400 for “/api/console/proxy” after upgrading kibana from 6.4.0 to 6.7.1

After upgrading kibana from 6.4.0 to 6.7.1, some error logs repeatably occur below.

{"type":"response","@timestamp":"2019-04-26T14:32:27+09:00","tags":,"pid":19036,"method":"post","statusCode":400,"req":{"url":"/api/console/proxy?path=_aliases&method=GET","method":"post","headers":{"host":"XXX","connection":"keep-alive","content-length":"0","accept":"text/plain, /; q=0.01","origin":"XXX","kbn-version":"6.4.0","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36","referer":"http://XXX/app/kibana","accept-encoding":"gzip, deflate","accept-language":"ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7,zh-CN;q=0.6,zh;q=0.5"},"remoteAddress":"XXX","userAgent":"XXX","referer":"http://XXX/app/kibana"},"res":{"statusCode":400,"responseTime":51,"contentLength":9},"message":"POST /api/console/proxy?path=_aliases&method=GET 400 51ms - 9.0B"}

It has no problem to use kibana pages.
And It says "kbn-version":"6.4.0", but every ELK stack has been upgraded to the same version of 6.7.1.

so, to reply myself, It turns out we had some users who had never refreshed the browser on kibana console page after upgrading. It was just because the old client browser was sending header of "kbn-version: 6.4.0".

curl -X POST -H "kbn-xsrf: reporting" -H "kbn-version:6.4.0" http://XXX/api/console/proxy\?path\=_template\&method\=GET
{"statusCode":400,"error":"Bad Request","message":"Browser client is out of date, please refresh the page"}
curl -X POST -H "kbn-xsrf: reporting" -H "kbn-version:6.7.1" http://XXX/api/console/proxy\?path\=_template\&method\=GET
(successful)

2 Likes

Hey @c81b4c93b1f70af5398f thanks for following up with the solution that you found!

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