JN 7 → Impossible to save/keep "Trusted" state of a notebook

Hello, I am playing with JN 7.0 the latest version and it is truly an amazing job, thank you for your work and effort!

The issue below is true only for JN 7, all other versions JN <7 keep Trusted state.

I just can’t figure out how to convince new JN to keep state “Trusted” - I open a notebook, change to Trusted from Not Trusted, save it. Close it and reopen it and state is again “Not Trusted”.

I tried it on several machines and notebooks and no luck - always falls back to Not Trusted.
Even “jupyter trust X.ipynb” command doesn’t solve the problem - it reports back “Notebook already signed: X.ipynb”. However, once opened it is in the Not Trusted state.

Can you guide me how to fix it?

Note:
The only possible link to this issue I see is a server’s message:
“This version of python seems to be incorrectly compiled
(internal generated filenames are not absolute).
This may make the debugger miss breakpoints.
Related bug: Issue 1666807: Incorrect file path reported by inspect.getabsfile() - Python tracker

But as previous versions of Jupyter didn’t have this message, I have no clue how to fix it.

Thanks,
Michal

Do you see this with every notebook, even a simple 1-cell notebook? Does your notebook have any empty cells? When does it loos trusted status? Can you narrow it down to any specific action? Can you reproduce this in JupyterLab?

When you switch between machines it is expected that notebook looses trust as your signature key is different. But if you are reopening it on the same machine it should be in the same trust status as it was.

1 Like

Hi, in JupyterLab the notebook in question is denoted as Trusted, however, the same one in JN 7 as Not Trusted.

I believe it is connected with a fact that the notebook was created in older version of JN an somehow new JN has some issue with it, but doesn’t report anything anywhere.

I am wondering, is there some sort of a tool which will check possible internal errors of a notebook - its structure etc. which might cause some issues in JN 7? Or only solution is to copy paste the code to newly created JN under v7?

When I create a new notebook under v7 then it keeps Trusted state as expected behavior.

Note - this is cross-post with JN 7.0 → Impossible to save/keep Trusted state of a notebook · Issue #6988 · jupyter/notebook · GitHub.

1 Like