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

Ignore pageconfig file if JSON is zero-length #444

Merged
merged 3 commits into from
Apr 8, 2024

Conversation

holzman
Copy link
Contributor

@holzman holzman commented Mar 11, 2024

Fixes #443

Copy link

welcome bot commented Mar 11, 2024

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

Copy link
Member

@fcollonval fcollonval left a comment

Choose a reason for hiding this comment

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

Thanks @holzman

@krassowski
Copy link
Member

Can pageconfig include security related options? I think yes. This I think it's better to crash than to allow the server to start with the options inactive. Of course that should be with a better error message

@manics
Copy link

manics commented Mar 12, 2024

Regardless of if it's a security issue, from a user perspective it can be very annoying/surprising to have a config file (effectively) silently ignored due to a syntax error. There may be log messages, but people generally don't look at them unless there's a problem, which may not be immediately apparent since JupyterLab will start.

Same for jupyter-server/jupyter_server#1404

In the motivating issue jupyter-server/jupyter_server#1403 the problem is a lack of disk space, which is going to cause many more problems than an invalid empty config file.

@holzman
Copy link
Contributor Author

holzman commented Mar 12, 2024

In our particular case, the disk being full was transient, but the zero-length page_config.json persisted.

How about if we check if the file exists and isn't zero bytes? That sounds like it will cover all of the bases - ignoring an empty file seems OK to me.

@manics
Copy link

manics commented Mar 12, 2024

Sounds reasonable to me!

@fcollonval
Copy link
Member

@krassowski does the final version is ok for you?

Copy link
Member

@krassowski krassowski left a comment

Choose a reason for hiding this comment

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

Thanks!

@krassowski krassowski changed the title Ignore pageconfig file if JSON is invalid Ignore pageconfig file if JSON is zero-length Apr 8, 2024
@krassowski krassowski merged commit 2cc9672 into jupyterlab:main Apr 8, 2024
28 checks passed
Copy link

welcome bot commented Apr 8, 2024

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

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

Successfully merging this pull request may close these issues.

Zero length page_request.json throws exception
4 participants