Change the default session timeout in Kibana

Solution Verified - Updated

Environment

Openshift Container Platform 3.X

Issue

Kibana sessions defaults to 60 min, after that the user is logged out and it needs to re-login again.

Resolution

Set the following environment variables in the kibana deployment-config:

  • OAP_SESSION_DURATION: Duration for encrypted session cookies, defaults to 1h
  • OAP_SESSION_ACTIVE_DURATION: Active duration for encrypted session cookies defaults to 5m

Those variables can be explicitly set in milliseconds. Set them with the following command:

$ oc project ${logging-namespace}
$ oc env dc/${kibana-deploymentConfig} --containers="kibana-proxy" OAP_SESSION_DURATION=720000

Where:

  • ${logging-namespace} defaults to logging
  • ${kibana-deploymentConfig} defaults to logging-kibana

Root Cause

The oauth-proxy in kibana defaults 3600 seconds, any session longer than that will be disconnected.

Diagnostic Steps

  • Login in Kibana.
  • Wait for more than 3600 seconds.
  • Refresh the browser.

It will prompt an error similar to:

Fatal Error
Courier Fetch Error: unhandled courier request error: unknown error
Version: 4.6.4
Build: 10229
Error: unhandled courier request error: unknown error
    at handleError (https://kibana.openshift.example.com/bundles/commons.bundle.js?v=10229:98251:23)
    at DocRequest.AbstractReqProvider.AbstractReq.handleFailure (https://kibana.openshift.intern.example.com/bundles/commons.bundle.js?v=10229:98171:15)
    at https://kibana.openshift.intern.example.com/bundles/commons.bundle.js?v=10229:98065:18
    at Array.forEach (<anonymous>)
    at https://kibana.openshift.intern.example.com/bundles/commons.bundle.js?v=10229:98063:19
    at processQueue (https://kibana.openshift.intern.example.com/bundles/commons.bundle.js?v=10229:42452:29)
    at https://kibana.openshift.intern.example.com/bundles/commons.bundle.js?v=10229:42468:28
    at Scope.$eval (https://kibana.openshift.intern.example.com/bundles/commons.bundle.js?v=10229:43696:29)
    at Scope.$digest (https://kibana.openshift.intern.example.com/bundles/commons.bundle.js?v=10229:43507:32)
    at Scope.$apply (https://kibana.openshift.intern.example.com/bundles/commons.bundle.js?v=10229:43804:25)
SBR
Category
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.