Jupyter笔记本SSH隧道错误“签名数据库无法打开”

问题描述 投票:0回答:1

我的大学有一台Linux机器,校园里有强大的Jupyter。以下是我通过Windows笔记本电脑登录远程服务器并在服务器上运行Jupyter笔记本的步骤,可以通过ssh隧道在我的本地浏览器上进行编辑,但它总是给我同样的错误:

  1. 在远程服务器上安装anaconda和Jupyter
  2. 创建我的环境并激活它
  3. 对于SSH隧道,这是我在CMD上连接到远程服务器的方式: Ssh –L 8000(on my laptop):localhost:8889(on remote server) <MyUserID>@<RemoteServerIP>
  4. 在此之后,它要求我的密码,然后我进入远程服务器
  5. 要激活anaconda,我使用以下命令: source $HOME/anaconda3/bin/activate
  6. 进入anaconda后,我激活我的环境: conda activate <env_name>
  7. 进入环境后,启动jupyter笔记本,我输入: jupyter notebook 要么 jupyter notebook --no-browser --port=8889
  8. 然后它显示: [I 09:04:06.122 NotebookApp] Writing notebook server cookie secret to /run/user/148037468/jupyter/notebook_cookie_secret [I 09:04:06.881 NotebookApp] Serving notebooks from local directory: <directoryname> [I 09:04:06.881 NotebookApp] The Jupyter Notebook is running at: [I 09:04:06.881 NotebookApp] http://localhost:8889/ [I 09:04:06.881 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [I 09:05:10.507 NotebookApp] 302 GET / (::1) 1.43ms
  9. 然后在我的笔记本电脑上输入: localhost:8000 它将我重定向到登录页面,我在jupyter笔记本中成功查看了我的目录,然后单击.ipynb文件
  10. 在此步骤之后,它永远不会加载笔记本并在笔记本上显示以下错误: 无法建立与笔记本服务器的连接。笔记本电脑将继续尝试重新连接。检查网络连接或笔记本服务器配置。

它在终端上给出以下错误:

The signatures database cannot be opened; maybe it is corrupted or encrypted. You may need to rerun your notebooks to ensure that they are trusted to run Javascript. The old signatures database has been renamed to <directory_name>.local/share/jupyter/nbsignatures.db.bak and a new one has been created.
[W 09:17:35.807 NotebookApp] Failed commiting signatures database to disk. 
You may need to move the database file to a non-networked file system, using config option `NotebookNotary.db_file`. Using in-memory signatures database for the remainder of this session.
[W 09:17:35.811 NotebookApp] Notebook plots1.ipynb is not trusted
[W 09:17:35.881 NotebookApp] 404 GET /nbextensions/widgets/notebook/js/extension.js?v=20190319090406 (::1) 17.39ms referer=http://localhost:8000/notebooks/plots1.ipynb
[I 09:17:36.430 NotebookApp] Kernel started: 242b529a-5acd-4b5f-8a6d-356947ab30d2
[W 09:18:36.467 NotebookApp] Timeout waiting for kernel_info reply from 242b529a-5acd-4b5f-8a6d-356947ab30d2
/<directory_name>/anaconda3/envs/braingrid/lib/python3.6/site-packages/notebook/base/zmqhandlers.py:284: RuntimeWarning: coroutine 'WebSocketHandler.get' was never awaited
super(AuthenticatedZMQStreamHandler, self).get(*args, **kwargs)
[W 09:18:38.276 NotebookApp] Replacing stale connection: 242b529a-5acd-4b5f-8a6d-356947ab30d2:dd09ca5465ba404a886c71b3ca787d6b
[W 09:21:36.370 NotebookApp] Notebook plots1.ipynb is not trusted

[IPKernelApp] ERROR | Failed to open SQLite history /<directory_name>/.ipython/profile_default/history.sqlite (database is locked).
[IPKernelApp] ERROR | History file was moved to /<directory_name>/.ipython/profile_default/history-corrupt.sqlite and a new file created.

Jupyter笔记本不断显示:

"Connecting to terminal"

我不知道如何解决这个问题。我是Linux新手。 sudo命令都不起作用,因为我不是admin /或具有这些权限

这个设置对我的论文是必要的。

linux ssh anaconda jupyter-notebook ssh-tunnel
1个回答
0
投票

这可能是问题所在:您的笔记本存储签名(https://jupyter-notebook.readthedocs.io/en/stable/security.html),告诉浏览器在打开笔记本时是否信任任何javascript和html。它将它们存储在SQLite数据库中。看来如果这个数据库文件在NFS上,可能会出现锁定问题:

因此,将文件移动到服务器上的本地文件夹可能会有效,并将NotebookNotary.db_file指向那里。

© www.soinside.com 2019 - 2024. All rights reserved.