Hi
We have two apps(Test1 and kibana) integrated with same keycloak.
When we login to Test1 app with the keycloak user and in another tab we open kibana it automatically logins,It is because of Single-sign-on(SSO) session. But when we logout from Test1 app and refresh kibana it shows “internal server error”. Even if we close the Chrome browser and try again kibana,it shows same internal server error.
But in the above scenario,if we logout from kibana directly it properly logs out without any issue and redirects to login page for re-login. This action also logs out from Test1 app.
Only when we logout from another app(Test1), kibana does not logout and shows “internal server error” on accessing it. Please refer the below logs when we get error
{"type":"error","@timestamp":"2021-01-27T05:11:06Z","tags":[],"pid":10,"level":"error","error":\{"message":"Internal Server Error","name":"Error","stack":"Error: Internal Server Error\n at HapiResponseAdapter.toInternalError (/usr/share/kibana/src/core/server/http/router/response_adapter.js:69:19)\n at Router.handle (/usr/share/kibana/src/core/server/http/router/router.js:163:34)\n at process._tickCallback (internal/process/next_tick.js:68:7)"}
,"url":{"protocol":null,"slashes":null,"auth":null,"host":null,"port":null,"hostname":null,"hash":null,"search":null,"query":{},"pathname":"/","path":"/","href":"/"},"message":"Internal Server Error"}
{"type":"response","@timestamp":"2021-01-27T05:11:06Z","tags":[],"pid":10,"method":"get","statusCode":500,"req":{"url":"/","method":"get","headers":
{"host":"abc.xyz.net","x-request-id":"79874e40e41ed0177308e34c08537b79","x-real-ip":"yy.yy.yy.yy","x-forwarded-for":"yy.yy.yy.yy","x-forwarded-host":"abc.xyz.net","x-forwarded-port":"443","x-forwarded-proto":"https","x-original-uri":"/","x-scheme":"https","cache-control":"max-age=0","sec-ch-ua":"\"Chromium\";v=\"88\", \"Google Chrome\";v=\"88\", \";Not A Brand\";v=\"99\"","sec-ch-ua-mobile":"?0","upgrade-insecure-requests":"1","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 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":"none","sec-fetch-mode":"navigate","sec-fetch-user":"?1","sec-fetch-dest":"document","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9"}
,"remoteAddress":"xx.xx.xx.xx","userAgent":"xx.xx.xx.xx"},"res":{"statusCode":500,"responseTime":111,"contentLength":9},"message":"GET / 500 111ms - 9.0B"}
Befor 500 InternalServer error, below errors shows up:-
{"type":"log","@timestamp":"2021-01-27T05:11:07Z","tags":["error","http"],"pid":10,"message":"{ Error: Authentication Exception\n at respond (/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:349:15)\n at checkRespForFailure (/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:306:7)\n at HttpConnector.<anonymous> (/usr/share/kibana/node_modules/elasticsearch/src/lib/connectors/http.js:173:7)\n at IncomingMessage.wrapper (/usr/share/kibana/node_modules/elasticsearch/node_modules/lodash/lodash.js:4929:19)\n at IncomingMessage.emit (events.js:203:15)\n at endReadableNT (_stream_readable.js:1145:12)\n at process._tickCallback (internal/process/next_tick.js:63:19)\n status: 401,\n displayName: 'AuthenticationException',\n message: 'Authentication Exception',\n path: '/.kibana/_doc/config%3A7.8.0',\n query: {},\n body: 'Authentication finally failed',\n statusCode: 401,\n response: 'Authentication finally failed',\n toString: [Function],\n toJSON: [Function],\n isBoom: true,\n isServer: false,\n data: null,\n output:\n { statusCode: 401,\n payload:\n
{ statusCode: 401,\n error: 'Unauthorized',\n message: 'Authentication Exception' }
,\n headers:\n { 'WWW-Authenticate': 'Basic realm=\"Authorization Required\"' } },\n reformat: [Function],\n [Symbol(ElasticsearchError)]: 'Elasticsearch/notAuthorized',\n [Symbol(SavedObjectsClientErrorCode)]: 'SavedObjectsClient/notAuthorized' }"}
Ideally when we logout from Test1 app it should also logout from kibana properly without any issues. Kibana should not shows the “internal server error”.
For re-login to kibana again we need to clear the cookies.
Could you please help regarding this issue ?