ERROR: "Unable to change your Space" occurred but no logs

Kibana version : 7.4.2

Elasticsearch version : 7.4.2

Server OS version : CentOS Linux release 7.4.1708 (Core)

Browser version : Chrome 80.0.3987.132

Browser OS version : Windows 10.0.18363

Original install method (e.g. download page, yum, from source, etc.) :
Clone form https://github.com/elastic/kibana.git

Description of the problem including expected versus actual behavior :
I started Kibana according to the guidance of this document:
kibana-contributing-code

But when I visited Kibana I got an error: Unable to change your Space

Does anyone know what is going on?

Hi @liu78778,

In 7.4.2, it looks like the only time this error message is created is when a POST to the select space API fails.

Since this request occurs from the client, you should be able to get more info from inspecting your browser's network requests... what response are you seeing from that API call?

Hi @lukeelmers,
Thanks for your reply. Here is the response.

{"statusCode":401,"error":"Unauthorized","message":"Unauthorized"}

BTW, If I use the release version, there is no problem. Same es cluster.

Thanks, this is helpful. Does anything change if you try re-authenticating (log out & back in)? I assume you are logging in with elastic/changeme?

What do you see when running Kibana with verbose logs (yarn start --verbose)? That may provide a bit more insight as to why you are getting a 401.

Thanks @lukeelmers, The following is the log after I run yarn start --verbose.

etc. There is no logout button on this page so I cannot log out :frowning:


server    log   [15:04:26.776] [debug][plugin] Checking Elasticsearch version
server    ops   [15:04:28.395]  memory: 344.9MB uptime: 0:02:45 load: [0.00 0.00 0.00] delay: 0.110
server    log   [15:04:28.952] [debug][server][Kibana][cookie-session-storage][http] Error: Unauthorized
server    log   [15:04:28.953] [debug][basic][plugins][security] Trying to authenticate user request to /api/spaces/v1/space/default/select.
server    log   [15:04:28.953] [debug][basic][plugins][security] Trying to authenticate via header.
server    log   [15:04:28.954] [debug][basic][plugins][security] Authorization header is not presented.
server    log   [15:04:28.967] [debug][authentication][plugins][security] Could not handle authentication attempt
server    log   [15:04:28.968] [debug][license][xpack] Calling [data] Elasticsearch _xpack API. Polling frequency: 30001
server  respons [15:04:28.951]  POST /api/spaces/v1/space/default/select 401 69ms - 9.0B
server    log   [15:04:29.067] [debug][kibana-monitoring][monitoring] Uploaded bulk stats payload to the local cluster
server  respons [15:04:29.109]  GET /built_assets/dlls/icon.cross-js.bundle.dll.js 200 20ms - 9.0B
server  respons [15:04:29.108]  GET /built_assets/dlls/icon.alert-js.bundle.dll.js 200 24ms - 9.0B
server    log   [15:04:29.306] [debug][plugin] Checking Elasticsearch version
server    log   [15:04:30.862] [debug][kibana-monitoring][monitoring] Received Kibana Ops event data
server    log   [15:04:30.863] [debug][kibana-monitoring][monitoring] Received Kibana Ops event data
server    log   [15:04:30.891] [debug][kibana-monitoring][monitoring] Received Kibana Ops event data
server    log   [15:04:30.892] [debug][kibana-monitoring][monitoring] Received Kibana Ops event data

Try navigating to localhost:5601/logout first, then see if re-authenticating helps.

And just to confirm: are you logging in using the default elastic and changeme credentials?

Thanks for your replay @lukeelmers

I tried to log out, the logout itself was successful, but there is still a problem with re-logging, it didn't work.

This is my kibana.dev.yml 's content, and I used the same account and password to log in:

elasticsearch.hosts: ["http://xx.xx.xx.xx"]
elasticsearch.username: "elastic"
elasticsearch.password: "******"
elasticsearch.ssl.verificationMode: none