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

File Load Error for 01_Intro_to_DP0_Notebooks.ipynb #9

Closed
MelissaGraham opened this issue Jul 8, 2021 · 1 comment
Closed

File Load Error for 01_Intro_to_DP0_Notebooks.ipynb #9

MelissaGraham opened this issue Jul 8, 2021 · 1 comment
Labels
RSP Notebook Science Platform Notebook environment (aka nublado)

Comments

@MelissaGraham
Copy link
Contributor

Describe the bug
In my /home/melissagraham/notebooks/tutorial-notebooks directory, when I try to open the first tutorial notebook (by double-clicking in the left-hand file directory menu), I get this error:

File Load Error for 01_Intro_to_DP0_Notebooks.ipynb
Unreadable Notebook: /home/melissagraham/notebooks/tutorial-notebooks/01_Intro_to_DP0_Notebooks.ipynb NotJSONError('Notebook does not appear to be JSON: \'{\\n "cells": [\\n {\\n "cell_type": "m...')

But other notebooks in that directory open fine. I first noticed this yesterday, but it persists today.

To Reproduce
Log in to the RSP, launch a Notebook server (medium), use the left-hand menu to navigate to my /notebooks/tutorial-notebooks/ directory, and double-click on 01_Intro_to_DP0_Notebooks.ipynb.

Expected behavior
Expected the notebook to open like the other notebooks open. I have a separate directory where I create/edit these tutorials, and the first notebook opens fine there (from main and prod branches).

Desktop (please complete the following information):
Mac OS X, Chrome

@MelissaGraham MelissaGraham added the RSP Notebook Science Platform Notebook environment (aka nublado) label Jul 8, 2021
@MelissaGraham
Copy link
Contributor Author

Check the status of the notebook that is not loading.
Open a terminal and navigate to notebooks/tutorial-notebooks, and do git status. In red, if it says both modified: 01_Intro_to_DP0_Notebooks.ipynb, the following describes why. These instructions will work for any of the notebooks in notebooks/tutorial-notebooks. These instructions will NOT work for notebooks in any other directory.

What is happening?
Changes have been made to this file (executing the notebook counts as making changes, and note that Jupyter auto-saves changes on a ~2 minute cadence), but Rubin staff have also updated it (e.g., bug fixes). Since the file has been twice modified, git has gone ahead and annotated file with all the conflicting lines between the two versions. This essentially ruins a ipynb file's functionality (but it is a very useful built-in git feature for, e.g., ascii and code files). Do a git diff 01_Intro_to_DP0_Notebooks.ipynb and all the differences will be listed.

Recommended Solution

  1. Use the terminal to restore the version in which you made changes: git restore --staged 01_Intro_to_DP0_Notebooks.ipynb. This takes it out of 'staged' status and will avoid future errors.
  2. At this point, if you want to keep your changes, copy the file to a new name in your home directory: cp 01_Intro_to_DP0_Notebooks.ipynb ../../01_mine.ipynb.
  3. Restore the version updated by Rubin staff: git restore 01_Intro_to_DP0_Notebooks.ipynb. Now your notebooks/tutorial-notebooks directory only contains the most up-to-date versions of the tutorial notebooks, with none of your changes.

Alternative Solution
If the notebooks in notebooks/tutorial-notebooks are still not loading, it is safe to delete the entire directory, log out, and log back in. You will then have a full and fresh notebooks/tutorial-notebooks directory.

  1. Use the terminal to navigate to notebooks, then do: rm -rf tutorial/notebooks.
  2. File --> Close and Shutdown Terminal
  3. File --> Save all, Exit, and Log Out
  4. Log back in to the Notebook Aspect and start a new server.
  5. See that your notebooks/tutorial-notebooks is fully restored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RSP Notebook Science Platform Notebook environment (aka nublado)
Projects
None yet
Development

No branches or pull requests

1 participant