Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error reporting and use pre-defined token #339

Merged
merged 3 commits into from
Nov 20, 2021

Conversation

krassowski
Copy link
Member

@krassowski krassowski commented Nov 18, 2021

#238 demonstrates that for an unknown reasons the Jupyter Server does not get setup correctly for some users. It is very difficult to debug currently, so I tried to address this in multiple ways:

  • removing one of the modes of failures which was in retrieving the token (which if not found could lead to promise rejection and error screen state)
  • displaying the actual error that led to the error screen (and encouraging reporting of these errors)
  • allowing users to change environment with the selector introduced in Custom python environment support #317
  • rewriting the error message which was incorrectly suggesting that it was due to server not being in path, where in reality there are several code paths which could lead to the promise rejection and that screen; instead it is now more accurately titled "Jupyter Server Initialization Failed"
  • I also removed the "Install Jupyter" link, because the JupyterLab Desktop now ships with a builtin conda environment so it is redundant and it was directing users to rather not very useful generic Jupyter website (so they could end up installing Notebook and getting frustrated that it did not help).
  • I added code for parsing the actual version of Jupyter Server that got started, but end up not using it for now. We should consider if we want to add a check on the version at this level too - it could help against some inconsistent environments - but it can wait for another PR.
  • The server standard error output is now logged into the console. We may want to change this in the future (or make it optional, only for debugging) but it seems important for this stage of development.

I also restored the XSRF checks as I do not see any reason for having those disabled when the token is properly set up.

Tested by manually adding a reject(new Error('test')):

Screenshot from 2021-11-18 21-00-50

And selecting a non-Python path fusing the first button:

Screenshot from 2021-11-18 21-00-56

The environment selector works well too:

Screenshot from 2021-11-18 21-01-22

@krassowski
Copy link
Member Author

The CI errors are not related to this PR, but to lack of peer dependency pinning. Yarn is installing the latest versions of peer dependencies which causes compilation issues. Merging #337 will temporarily solve this issue, but we should find a way to better locking of peer dependencies.

@krassowski krassowski requested a review from mbektas November 18, 2021 21:37
@krassowski krassowski force-pushed the better-errors-and-token branch from d5145ab to 7ebd7fa Compare November 19, 2021 18:09
Copy link
Member

@mbektas mbektas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants