Che: Dashboard does not expand 401 error from Che Server

Created on 15 Jun 2020  路  9Comments  路  Source: eclipse/che

Describe the bug

When dashboard gets 401 from Che Server is shows [object Object] error message while there is a browser log

Can't GET "/api". Error:  
Object { status: 401, response: "{\"errors\":[{\"code\":\"unauthorized_error\",\"detail\":\"oauth2: cannot fetch token: 400 Bad Request\\nResponse: {\\\"error\\\":\\\"invalid_grant\\\",\\\"error_description\\\":\\\"Code not valid\\\"}\",\"status\":\"401\",\"title\":\"Unauthorized error\"}]}\n" }
app-852e1d423a.js:319781:17
    <anonymous> app-852e1d423a.js:319781
uncaught exception: Object

So, it would be much better to display the actual error message

oauth2: cannot fetch token: 400 Bad Request\\nResponse: {\\\"error\\\":\\\"invalid_grant\\\",\\\"error_description\\\":\\\"Code not valid\\\"}\",\"status\":\"401\",\"title\":\"Unauthorized error\"}]}

Che version

  • [x] latest
  • [ ] nightly
  • [ ] other: please specify

Steps to reproduce

Can't be reproduced stable, but there are issues when people face that on hosted-che. See
https://github.com/eclipse/che/issues/17153
https://github.com/eclipse/che/issues/16719

aredashboard kinbug severitblocker

Most helpful comment

Hi @l0rd @sleshchenko @sunix

For debug purpose I tried to to initialize Keycloak with empty cliendId to get an error. The text in red are error and error_description from Keycloak.

Screenshot 2020-06-30 at 15 51 05

All 9 comments

@sleshchenko could we also add some link for the login once this error occurs?

@ibuziuk Not logged in users should be forwarded to login page, no?
Or do you mean link to logout and start log process from the beginning? Do we have such a link? Should it be configured in product.json?

Hello,
I am moving this issue to Blocker:

Here are some suggestions,

  • Have a error message for the user describing the error and the origin and ask to try again (refresh? shift f5?)
    we are experiencing some technical difficulties from our SSO: <detail coming from SSO error>. Please try Shift+Refresh.
  • Consider being able to choose an alternative SSO: Red Hat + eclipse foundation one?
  • Maybe have an automatic retry.

@sleshchenko can we have @olexii4 or @akurinnoy working on this issue this week?

@l0rd @akurinnoy will handle that

@sleshchenko cool thanks

Hi @l0rd @sleshchenko @sunix

For debug purpose I tried to to initialize Keycloak with empty cliendId to get an error. The text in red are error and error_description from Keycloak.

Screenshot 2020-06-30 at 15 51 05

super looks great to me

preparing pull request!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JamesDrummond picture JamesDrummond  路  3Comments

Ohrimenko1988 picture Ohrimenko1988  路  3Comments

johnmcollier picture johnmcollier  路  3Comments

amisevsk picture amisevsk  路  3Comments

redeagle84 picture redeagle84  路  3Comments