Kibana keeps booting users back to the home screen

I am in the middle of browsing through data on the discover pane when the page reloads and dumps me back to domainname/app/kibana#/home. The frequency that this happens changes, right now it’s happening every few minutes.

I connect to Kibana via an httpd reverse proxy. I am running another single node ES/Kibana v7.8.0 cluster to monitor the production ES cluster. It has no reverse proxy or any Readonlyrest plugin installed, and I haven’t experienced such issue on it.

Browser: Chrome 86.0.4240.111
Kibana & Elasticsearch 7.8.0
readonlyrest_kbn_enterprise-1.24.0_es7.8.0

Do you see any logs from Kibana by the time it redirects you? Or any “FORBIDDEN” log line in Elasticsearch log?
Strange, because redirecting to the main Kibana page is a behaviour that occurs when you attempt to navigate to one of the Kibana apps listed in the “kibana_hide_apps” rule (if present for that user).

Thank you for your quick reply. I checked my kibana logs. Everytime I got redirected to the home page, I see "info","logout" in my log like those lines at Nov 06 11:23:53

Nov 06 11:23:44 myhostname kibana[12395]: {"type":"response","@timestamp":"2020-11-06T19:23:44Z","tags":[],"pid":12395,"method":"get","statusCode":200,"req":{"url":"/plugins/readonlyrest_kbn/session_probe.txt","method":"get","headers":{"host":"myhostname:5601","accept":"*/*","x-requested-with":"XMLHttpRequest","kbn-xsrf":"7.8.0","kbn-version":"7.8.0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://mydomainname/app/kibana","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,ja;q=0.6,zh-TW;q=0.5,de;q=0.4,mt;q=0.3","x-forwarded-for":"128.3.106.57","x-forwarded-host":"mydomainname","x-forwarded-server":"mydomainname","connection":"Keep-Alive"},"remoteAddress":"192.168.87.129","userAgent":"192.168.87.129","referer":"https://mydomainname/app/kibana"},"res":{"statusCode":200,"responseTime":20,"contentLength":9},"message":"GET /plugins/readonlyrest_kbn/session_probe.txt 200 20ms - 9.0B"}
Nov 06 11:23:48 myhostname kibana[12395]: {"type":"response","@timestamp":"2020-11-06T19:23:48Z","tags":[],"pid":12395,"method":"post","statusCode":200,"req":{"url":"/api/ui_metric/report","method":"post","headers":{"host":"myhostname:5601","kbn-version":"7.8.0","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36","content-type":"application/json","accept":"*/*","origin":"https://mydomainname","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://mydomainname/app/kibana","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,ja;q=0.6,zh-TW;q=0.5,de;q=0.4,mt;q=0.3","x-forwarded-for":"128.3.106.57","x-forwarded-host":"mydomainname","x-forwarded-server":"mydomainname","connection":"Keep-Alive","content-length":"427"},"remoteAddress":"192.168.87.129","userAgent":"192.168.87.129","referer":"https://mydomainname/app/kibana"},"res":{"statusCode":200,"responseTime":18,"contentLength":9},"message":"POST /api/ui_metric/report 200 18ms - 9.0B"}
Nov 06 11:23:52 myhostname kibana[12395]: {"type":"response","@timestamp":"2020-11-06T19:23:52Z","tags":[],"pid":12395,"method":"get","statusCode":200,"req":{"url":"/plugins/readonlyrest_kbn/session_probe.txt","method":"get","headers":{"host":"myhostname:5601","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:82.0) Gecko/20100101 Firefox/82.0","accept":"*/*","accept-language":"en-US,en;q=0.5","accept-encoding":"gzip, deflate, br","referer":"https://mydomainname/app/kibana","kbn-version":"7.8.0","kbn-xsrf":"7.8.0","x-requested-with":"XMLHttpRequest","dnt":"1","x-forwarded-for":"128.55.205.18","x-forwarded-host":"mydomainname","x-forwarded-server":"mydomainname","connection":"Keep-Alive"},"remoteAddress":"192.168.87.129","userAgent":"192.168.87.129","referer":"https://mydomainname/app/kibana"},"res":{"statusCode":200,"responseTime":16,"contentLength":9},"message":"GET /plugins/readonlyrest_kbn/session_probe.txt 200 16ms - 9.0B"}
Nov 06 11:23:53 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:53Z","tags":["info","logout"],"pid":12395,"message":"Beginning to construct the logout redirect url"}
Nov 06 11:23:53 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:53Z","tags":["info","logout"],"pid":12395,"message":"Getting custom logout url from configuration"}
Nov 06 11:23:53 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:53Z","tags":["info","logout"],"pid":12395,"message":"Custom logout url not found in configuration - returning"}
Nov 06 11:23:53 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:53Z","tags":["info","logout"],"pid":12395,"message":"Getting logout url from SAML connector"}
Nov 06 11:23:53 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:53Z","tags":["info","logout"],"pid":12395,"message":"Got logout url from SAML connector: undefined"}
Nov 06 11:23:53 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:53Z","tags":["info","logout"],"pid":12395,"message":"Getting next url from cookie"}
Nov 06 11:23:53 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:53Z","tags":["info","logout"],"pid":12395,"message":"Did not find next url in cookie. Returning"}
Nov 06 11:23:53 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:53Z","tags":["info","logout"],"pid":12395,"message":"Getting next url from query param"}
Nov 06 11:23:53 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:53Z","tags":["info","logout"],"pid":12395,"message":"Got next url from query param: "}
Nov 06 11:23:53 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:53Z","tags":["info","logout"],"pid":12395,"message":"Returning with the following logout redirect url: /login"}
Nov 06 11:23:53 myhostname kibana[12395]: {"type":"response","@timestamp":"2020-11-06T19:23:53Z","tags":[],"pid":12395,"method":"get","statusCode":302,"req":{"url":"/logout?nextUrl=%2F","method":"get","headers":{"host":"myhostname:5601","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","sec-fetch-site":"same-origin","sec-fetch-mode":"navigate","sec-fetch-dest":"document","referer":"https://mydomainname/app/kibana","accept-encoding":"gzip, deflate, br","accept-language":"zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,ja;q=0.6,zh-TW;q=0.5,de;q=0.4,mt;q=0.3","x-forwarded-for":"128.3.106.57","x-forwarded-host":"mydomainname","x-forwarded-server":"mydomainname","connection":"Keep-Alive"},"remoteAddress":"192.168.87.129","userAgent":"192.168.87.129","referer":"https://mydomainname/app/kibana"},"res":{"statusCode":302,"responseTime":29,"contentLength":9},"message":"GET /logout?nextUrl=%2F 302 29ms - 9.0B"}
Nov 06 11:23:53 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:53Z","tags":["info","readonlyrest_kbn:extractIdentity"],"pid":12395,"message":"asked for group undefined"}
Nov 06 11:23:54 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:54Z","tags":["info","readonlyrest_kbn:enrichFromEs"],"pid":12395,"message":"Using groupCurrent 'undefined' - received identity payload: {\"x-ror-username\":\"siqideng\"}"}
Nov 06 11:23:54 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:54Z","tags":["info","readonlyrest_kbn:ensureIndexExists"],"pid":12395,"message":"kbnIndex probably already existed: .kibana-7"}
Nov 06 11:23:54 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:54Z","tags":["info","readonlyrest_kbn:TenantIndexBasedOnTemplateInitiator"],"pid":12395,"message":"Copying all Kibana objects from '.kibana_operator' to '.kibana-7' using reindex api."}
Nov 06 11:23:54 myhostname kibana[12395]: {"type":"log","@timestamp":"2020-11-06T19:23:54Z","tags":["info","readonlyrest_kbn:DefaultSpaceCreator"],"pid":12395,"message":"Default space already exists in '.kibana-7'. No need to create."}

I suspect the session probe is too frequent and can’t get back quickly enough, so that the request fails and you’re logged out automatically.

Please add this to your kibana.yml

readonlyrest_kbn.sessions_probe_interval_seconds: 180

The default value is 15 seconds, so 3 minutes is a good help.

It seems

readonlyrest_kbn.sessions_probe_interval_seconds: 180

fixed my issue. Thank you very much

1 Like