Warning "Execution failed in an unexpected way, clearing staged notebooks" converted to error.
Describe the bug
context
I rename a jupytext .md file used in my book. I'm converting warnings to errors.
expectation I expected the Jupyter cache to reuse the old cache entry.
bug But instead I'm hitting the following error:
Execution failed in an unexpected way, clearing staged notebooks: The URI of the staged record no longer exists: /home/jovyan/work/notes/previous-file-name.md
The error in the code: MyST-NB/execution.py at b345d036fee6c9f65f02e5b35398dc356938ea05 · executablebooks/MyST-NB.
problem This is a problem for people converting warnings to errors. One potential solution is to simply not make this issue a warning.
A workaround for anyone else running into this is to delete the cache entry in the nbstage table. I'm using How to properly view a .sqlite file using sqlite? - Ask Ubuntu.
Another workaround, in my case, was to avoid adding the jupytext header when an .md file doesn't have code.
Reproduce the bug
This happens when I rename a jupytext .md file or move it between directories.
List your environment
$ jupyter-book --version
Jupyter Book : 0.12.2
External ToC : 0.2.4
MyST-Parser : 0.15.2
MyST-NB : 0.13.2
Sphinx Book Theme : 0.1.10
Jupyter-Cache : 0.4.3
NbClient : 0.5.10