# "Error loading data" error observed in kibana when keycloak token expires

**URL:** https://forum.search-guard.com/t/error-loading-data-error-observed-in-kibana-when-keycloak-token-expires/1971
**Category:** Search Guard
**Created:** [September 24, 2020, 7:52am UTC](https://forum.search-guard.com/t/error-loading-data-error-observed-in-kibana-when-keycloak-token-expires/1971 "2020-09-24T07:52:11Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![shubha02](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@shubha02](https://forum.search-guard.com/u/shubha02)
#### Post date: [September 24, 2020, 7:52am UTC](https://forum.search-guard.com/t/error-loading-data-error-observed-in-kibana-when-keycloak-token-expires/1971/1 "2020-09-24T07:52:12Z")

</div>

Hi ,  
We are using keycloak openid authentication in kibana.  
When Kibana session remains idle for sometime (10mins) and keycloak token expires (token life span is 5 mins) in between that, after that if the user try to do filter on discover page based on a particular time period then the error pop up “Error loading data”.But manually refreshing the page can recover the access, and load the logs"

> Blockquote  
> TypeError: Failed to fetch  
> at Fetch.\_callee3$ ([https://ip/baseurl/port/bundles/commons.bundle.js:9:1989293](https://ip/baseurl/port/bundles/commons.bundle.js:9:1989293))  
> at l ([https://ip/baseurl/port/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:288:969217](https://ip/baseurl/port/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:288:969217))  
> at Generator.\_invoke ([https://ip/baseurl/port/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:288:968970](https://ip/baseurl/port/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:288:968970))  
> at Generator.forEach.e. [as throw] ([https://ip/baseurl/port/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:288:969574](https://ip/baseurl/port/bundles/kbn-ui-shared-deps/kbn-ui-shared-deps.js:288:969574))  
> at asyncGeneratorStep ([https://ip/baseurl/port/bundles/commons.bundle.js:9:1983787](https://ip/baseurl/port/bundles/commons.bundle.js:9:1983787))  
> at \_throw ([https://ip/baseurl/port/bundles/commons.bundle.js:9:1984184](https://ip/baseurl/port/bundles/commons.bundle.js:9:1984184))

When checked Elasticsearch client logs it says : “log”:“No ‘Basic Authorization’ header, send 401 and ‘WWW-Authenticate Basic’”}

The expectation is it should be redirected to the login page when the keycloak token gets expires.

---

<div class="post-metadata">

### Author: ![srgbnd](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/srgbnd/32/506_2.png) [@srgbnd](https://forum.search-guard.com/u/srgbnd)
#### Post date: [September 24, 2020, 8:28am UTC](https://forum.search-guard.com/t/error-loading-data-error-observed-in-kibana-when-keycloak-token-expires/1971/2 "2020-09-24T08:28:32Z")

</div>

Hi. What version of SG do you use? Do you see any error in the Kibana or Elasticsearch log?

---

<div class="post-metadata">

### Author: ![shubha02](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@shubha02](https://forum.search-guard.com/u/shubha02)
#### Post date: [September 24, 2020, 12:26pm UTC](https://forum.search-guard.com/t/error-loading-data-error-observed-in-kibana-when-keycloak-token-expires/1971/3 "2020-09-24T12:26:55Z")

</div>

Hi , Searchguard version used is : 7.8.0-43.0.0.

below error seen in elasticsearch client.

> Blockquote  
> {“type”:“log”,“host”:“elasticsearch-client-68cd995bbd-crf8h”,“level”:“WARN”,“systemid”:“2106a117733f42d697284fbc54927928”,“system”:“XXXX”,“time”: “2020-09-24T12:00:55.992Z”,“logger”:“c.f.s.h.HTTPBasicAuthenticator”,“timezone”:“UTC”,“marker”:"[elasticsearch-client-68cd995bbd-crf8h] ",“log”:“No ‘Basic Authorization’ header, send 401 and ‘WWW-Authenticate Basic’”}

Attaching the kibana error here.[kibana\_error](https://forum.search-guard.com/uploads/short-url/kYyw1trdrvSfQJF34EaZuasSwdm) (12.2 KB)

---

<div class="post-metadata">

### Author: ![srgbnd](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/srgbnd/32/506_2.png) [@srgbnd](https://forum.search-guard.com/u/srgbnd)
#### Post date: [September 25, 2020, 7:14am UTC](https://forum.search-guard.com/t/error-loading-data-error-observed-in-kibana-when-keycloak-token-expires/1971/4 "2020-09-25T07:14:48Z")

</div>

Hi @shubha02  
Thank you for reporting this. I add this to the queue to reproduce. I’ll reach you out when I have results.

---

<div class="post-metadata">

### Author: ![shubha02](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@shubha02](https://forum.search-guard.com/u/shubha02)
#### Post date: [September 25, 2020, 10:56am UTC](https://forum.search-guard.com/t/error-loading-data-error-observed-in-kibana-when-keycloak-token-expires/1971/5 "2020-09-25T10:56:11Z")

</div>

Thank you for the response .

---

<div class="post-metadata">

### Author: ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/system/32/1870_2.png) [@system](https://forum.search-guard.com/u/system)
#### Post date: [October 16, 2020, 10:56am UTC](https://forum.search-guard.com/t/error-loading-data-error-observed-in-kibana-when-keycloak-token-expires/1971/6 "2020-10-16T10:56:14Z")

</div>

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