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

Awhile back we forbid the use of the elastic username in local development to avoid bugs, as it is technically a superuser account, which is easy to forget. Instead we recommend using kibana (which has the same default password of changeme in local development).

Try using this in your kibana.dev.yml and see if it helps:

elasticsearch.username: "kibana"
elasticsearch.password: "changeme"

I'm not 100% sure if this will solve your problems as there should be an error related to this in the logs, but worth a shot just to be sure.

Hi @lukeelmers

I heard your opinion and configured the kibana user, now there are two situations:

1.If I log in to Kibana as a kibana user, 403 Forbidden will appear
image

 ops   [12:15:06.507]  memory: 348.4MB uptime: 0:02:57 load: [0.00 0.00 0.00] delay: 0.065
server    log   [12:15:07.872] [debug][plugin] Checking Elasticsearch version
server    log   [12:15:08.331] [debug][kibana-monitoring][monitoring] Received Kibana Ops event data
server    log   [12:15:08.332] [debug][kibana-monitoring][monitoring] Received Kibana Ops event data
server    log   [12:15:10.230] [debug][kibana-monitoring][monitoring] Received Kibana Ops event data
server    log   [12:15:10.231] [debug][kibana-monitoring][monitoring] Received Kibana Ops event data
server    log   [12:15:10.374] [debug][plugin] Checking Elasticsearch version
server    log   [12:15:11.340] [debug][authenticator][plugins][security] Performing login using "basic" provider.
server    log   [12:15:11.341] [debug][server][Kibana][cookie-session-storage][http] Error: Unauthorized
server    log   [12:15:11.342] [debug][basic][plugins][security] Trying to perform a login.
server    log   [12:15:11.343] [debug][basic][plugins][security] Login has been successfully performed.
server  respons [12:15:11.337]  POST /api/security/v1/login 204 14ms - 9.0B
server    log   [12:15:11.363] [debug][basic][plugins][security] Trying to authenticate user request to /.
server    log   [12:15:11.364] [debug][basic][plugins][security] Trying to authenticate via header.
server    log   [12:15:11.364] [debug][basic][plugins][security] Authorization header is not presented.
server    log   [12:15:11.365] [debug][basic][plugins][security] Trying to authenticate via state.
server    log   [12:15:11.366] [debug][basic][plugins][security] Request has been authenticated via state.
server    log   [12:15:11.368] [debug][plugins][spaces] SpacesClient.getAll(), using RBAC. Found 1 spaces
server    log   [12:15:11.373] [debug][plugins][spaces] SpacesClient.getAll(), authorized for 0 spaces, derived from ES privilege check: {"default":{"login:":false}}
server    log   [12:15:11.377] [debug][plugins][spaces] SpacesClient.getAll(), using RBAC. returning 403/Forbidden. Not authorized for any spaces.
server    log   [12:15:11.377] [debug][license][xpack] Calling [data] Elasticsearch _xpack API. Polling frequency: 30001
server  respons [12:15:11.362]  GET / 403 37ms - 9.0B
server    ops   [12:15:11.516]  memory: 350.3MB uptime: 0:03:02 load: [0.00 0.00 0.00] delay: 0.075

2.If I log in to Kibana with an elastic user, I will log out to the login interface at the moment of successful login.

   log   [12:05:28.577] [debug][server][Kibana][cookie-session-storage][http] Error: Unauthorized
server    log   [12:05:28.578] [debug][basic][plugins][security] Trying to authenticate user request to /api/console/api_server?sense_version=%40%40SENSE_VERSION&apis=es_6_0.
server    log   [12:05:28.579] [debug][basic][plugins][security] Trying to authenticate via header.
server    log   [12:05:28.579] [debug][basic][plugins][security] Authorization header is not presented.
server  respons [12:05:28.577]  GET /api/console/api_server?sense_version=%40%40SENSE_VERSION&apis=es_6_0 302 9ms - 9.0B
server  respons [12:05:28.779]  GET /ui/fonts/inter_ui/Inter-UI-Medium.woff2 200 3ms - 9.0B
server    log   [12:05:29.228] [debug][server][Kibana][cookie-session-storage][http] Error: Unauthorized
server    log   [12:05:29.228] [debug][basic][plugins][security] Trying to authenticate user request to /api/security/v1/me.
server    log   [12:05:29.229] [debug][basic][plugins][security] Trying to authenticate via header.
server    log   [12:05:29.229] [debug][basic][plugins][security] Authorization header is not presented.
server    log   [12:05:29.230] [debug][authentication][plugins][security] Could not handle authentication attempt
server    log   [12:05:29.236] [debug][license][xpack] Calling [data] Elasticsearch _xpack API. Polling frequency: 30001
server  respons [12:05:29.227]  GET /api/security/v1/me 401 29ms - 9.0B
server    log   [12:05:29.397] [debug][kibana-monitoring][monitoring] Received Kibana Ops event data
server    log   [12:05:29.397] [debug][kibana-monitoring][monitoring] Received Kibana Ops event data
server    log   [12:05:29.736] [debug][server][Kibana][cookie-session-storage][http] Error: Unauthorized
server    log   [12:05:29.737] [debug][basic][plugins][security] Trying to authenticate user request to /api/interpreter/fns.
server    log   [12:05:29.737] [debug][basic][plugins][security] Trying to authenticate via header.
server    log   [12:05:29.737] [debug][basic][plugins][security] Authorization header is not presented.
server    log   [12:05:29.738] [debug][authentication][plugins][security] Could not handle authentication attempt
server    log   [12:05:29.738] [debug][license][xpack] Calling [data] Elasticsearch _xpack API. Polling frequency: 30001
server    log   [12:05:29.744] [debug][server][Kibana][cookie-session-storage][http] Error: Unauthorized
server    log   [12:05:29.751] [debug][basic][plugins][security] Trying to authenticate user request to /api/saved_objects/_find?fields=title&per_page=1&search=*&search_fields=title&type=index-pattern.
server    log   [12:05:29.751] [debug][basic][plugins][security] Trying to authenticate via header.
server    log   [12:05:29.752] [debug][basic][plugins][security] Authorization header is not presented.
server    log   [12:05:29.752] [debug][authentication][plugins][security] Could not handle authentication attempt
server    log   [12:05:29.753] [debug][license][xpack] Calling [data] Elasticsearch _xpack API. Polling frequency: 30001
server    log   [12:05:29.760] [debug][server][Kibana][cookie-session-storage][http] Error: Unauthorized
server    log   [12:05:29.761] [debug][basic][plugins][security] Trying to authenticate user request to /api/spaces/space.
server    log   [12:05:29.761] [debug][basic][plugins][security] Trying to authenticate via header.
server    log   [12:05:29.762] [debug][basic][plugins][security] Authorization header is not presented.
server    log   [12:05:29.762] [debug][authentication][plugins][security] Could not handle authentication attempt
server    log   [12:05:29.763] [debug][license][xpack] Calling [data] Elasticsearch _xpack API. Polling frequency: 30001
server  respons [12:05:29.735]  GET /api/interpreter/fns 401 29ms - 9.0B
server  respons [12:05:29.736]  GET /api/spaces/space 401 47ms - 9.0B
server  respons [12:05:29.736]  GET /api/saved_objects/_find?fields=title&per_page=1&search=*&search_fields=title&type=index-pattern 401 53ms - 9.0B
server    log   [12:05:29.834] [debug][server][Kibana][cookie-session-storage][http] Error: Unauthorized
server    log   [12:05:29.835] [debug][basic][plugins][security] Trying to authenticate user request to /api/security/v1/me.
server    log   [12:05:29.835] [debug][basic][plugins][security] Trying to authenticate via header.
server    log   [12:05:29.836] [debug][basic][plugins][security] Authorization header is not presented.
server    log   [12:05:29.843] [debug][authentication][plugins][security] Could not handle authentication attempt
server    log   [12:05:29.843] [debug][license][xpack] Calling [data] Elasticsearch _xpack API. Polling frequency: 30001
server  respons [12:05:29.832]  GET /api/security/v1/me 401 114ms - 9.0B
server    log   [12:05:29.948] [debug][server][Kibana][cookie-session-storage][http] Error: Unauthorized
server    log   [12:05:29.956] [debug][basic][plugins][security] Trying to authenticate user request to /api/xpack/v1/info.
server    log   [12:05:29.956] [debug][basic][plugins][security] Trying to authenticate via header.
server    log   [12:05:29.957] [debug][basic][plugins][security] Authorization header is not presented.
server    log   [12:05:29.957] [debug][authentication][plugins][security] Could not handle authentication attempt
server    log   [12:05:29.957] [debug][license][xpack] Calling [data] Elasticsearch _xpack API. Polling frequency: 30001
server  respons [12:05:29.826]  GET /login?next=%2Fnpt%2Fapi%2Fconsole%2Fapi_server%3Fsense_version%3D%2540%2540SENSE_VERSION%26apis%3Des_6_0 200 135ms - 9.0B
server  respons [12:05:29.947]  GET /built_assets/dlls/icon.logo_apm-js.bundle.dll.js 200 27ms - 9.0B
server  respons [12:05:29.948]  GET /built_assets/dlls/icon.logo_logging-js.bundle.dll.js 200 28ms - 9.0B
server  respons [12:05:29.960]  GET /built_assets/dlls/icon.logo_metrics-js.bundle.dll.js 200 31ms - 9.0B
server  respons [12:05:29.945]  GET /api/xpack/v1/info 401 49ms - 9.0B
server  respons [12:05:29.972]  GET /built_assets/dlls/icon.logo_security-js.bundle.dll.js 200 51ms - 9.0B
server  respons [12:05:29.946]  GET /logout?next=%2Fapp%2Fkibana%23%2Fhome%3F_g%3D()&msg=SESSION_EXPIRED 200 153ms - 9.0B
server    log   [12:05:30.102] [debug][plugin] Checking Elasticsearch version
server  respons [12:05:30.032]  GET /built_assets/dlls/icon.app_security-js.bundle.dll.js 200 78ms - 9.0B
server  respons [12:05:30.034]  GET /built_assets/dlls/icon.app_spaces-js.bundle.dll.js 200 78ms - 9.0B
server  respons [12:05:29.990]  GET /ui/fonts/inter_ui/Inter-UI-Light-BETA.woff2 200 123ms - 9.0B
server  respons [12:05:30.021]  GET /ui/fonts/inter_ui/Inter-UI-Bold.woff2 200 95ms - 9.0B
server  respons [12:05:30.114]  GET /built_assets/dlls/icon.app_index_pattern-js.bundle.dll.js 200 72ms - 9.0B
server  respons [12:05:30.116]  GET /built_assets/dlls/icon.app_saved_objects-js.bundle.dll.js 200 71ms - 9.0B
server  respons [12:05:30.124]  GET /built_assets/dlls/icon.app_console-js.bundle.dll.js 200 64ms - 9.0B
server  respons [12:05:30.125]  GET /built_assets/dlls/icon.app_index_rollup-js.bundle.dll.js 200 72ms - 9.0B
server  respons [12:05:30.033]  GET /logout?next=%2Fapp%2Fkibana%23%2Fhome%3F_g%3D()&msg=SESSION_EXPIRED 200 167ms - 9.0B
server  respons [12:05:30.198]  GET /built_assets/dlls/icon.app_watches-js.bundle.dll.js 200 10ms - 9.0B
server    log   [12:05:30.233] [debug][server][Kibana][cookie-session-storage][http] Error: Unauthorized
server    log   [12:05:30.238] [debug][basic][plugins][security] Trying to authenticate user request to /bundles/app/logout/bootstrap.js.
server    log   [12:05:30.238] [debug][basic][plugins][security] Trying to authenticate via header.
server    log   [12:05:30.238] [debug][basic][plugins][security] Authorization header is not presented.
server    log   [12:05:30.239] [debug][authentication][plugins][security] Could not handle authentication attempt
server  respons [12:05:30.231] [api] GET /bundles/app/logout/bootstrap.js 200 18ms - 9.0B
server  respons [12:05:30.266]  GET /node_modules/@elastic/charts/dist/theme_only_light.css 200 5ms - 9.0B
... lots of GET 200
server  respons [12:05:30.451]  GET /ui/favicons/manifest.json 200 20ms - 9.0B
server  respons [12:05:30.551]  GET /bundles/light_theme.style.css.map 200 4ms - 9.0B
server  respons [12:05:30.556]  GET /bundles/commons.style.css.map 200 4ms - 9.0B
server    ops   [12:05:30.578]  memory: 365.8MB uptime: 0:07:34 load: [0.00 0.00 0.00] delay: 0.197
server  respons [12:05:30.467]  GET /built_assets/dlls/vendors.bundle.dll.js 200 1681ms - 9.0B

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