我在RHEL上运行托管在远程AWS EC2映像上的Ipython笔记本。我正在使用两个系统之间的端口转发从本地浏览器访问笔记本,这些系统在最初几天完全正常。
现在,我在启动笔记本时遇到以下错误消息:
> [E 20:34:57.072 NotebookApp] 500 PUT /api/contents/HW4/HW4.ipynb (::1)
> 9.14ms referer=http://localhost:8880/notebooks/HW4/HW4.ipynb [W 20:35:10.315 NotebookApp] Replacing stale connection:
> 14cfb1f0-1d03-4a84-818e-d11938db6bd6:57AB20A0DD6A47A5815DE5FA12D0C101
> [W 20:36:34.428 NotebookApp] Replacing stale connection:
> 14cfb1f0-1d03-4a84-818e-d11938db6bd6:57AB20A0DD6A47A5815DE5FA12D0C101
> [I 20:36:57.080 NotebookApp] Saving file at /HW4/HW4.ipynb [E
> 20:36:57.083 NotebookApp] Error while saving file: HW4/HW4.ipynb
> unable to open database file
> Traceback (most recent call last):
> File "/home/ec2-user/anaconda3/lib/python3.5/site-packages/notebook/services/contents/filemanager.py",
> line 395, in save
> self.check_and_sign(nb, path)
> File "/home/ec2-user/anaconda3/lib/python3.5/site-packages/notebook/services/contents/manager.py",
> line 431, in check_and_sign
> self.notary.sign(nb)
> File "/home/ec2-user/anaconda3/lib/python3.5/site-packages/nbformat/sign.py",
> line 263, in sign
> self.store_signature(signature, nb)
> File "/home/ec2-user/anaconda3/lib/python3.5/site-packages/nbformat/sign.py",
> line 270, in store_signature
> (self.algorithm, signature, datetime.utcnow())
> sqlite3.OperationalError: unable to open database file [W 20:36:57.084 NotebookApp] Unexpected error while saving file:
> HW4/HW4.ipynb unable to open database file [E 20:36:57.084
> NotebookApp] {
> "Content-Type": "application/json",
> "Connection": "keep-alive",
> "Referer": "http://localhost:8880/notebooks/HW4/HW4.ipynb",
> "Accept-Encoding": "gzip, deflate",
> "Content-Length": "24540",
> "Accept-Language": "en-US,en;q=0.5",
> "Accept": "application/json, text/javascript, */*; q=0.01",
> "Host": "localhost:8880",
> "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:49.0) Gecko/20100101 Firefox/49.0",
> "X-Requested-With": "XMLHttpRequest"
> } [E 20:36:57.084 NotebookApp] 500 PUT /api/contents/HW4/HW4.ipynb (::1) 40.17ms referer=http://localhost:8880/notebooks/HW4/HW4.ipynb [I
> 20:38:57.096 NotebookApp] Saving file at /HW4/HW4.ipynb [E
> 20:38:57.099 NotebookApp] Error while saving file: HW4/HW4.ipynb
> unable to open database file
> Traceback (most recent call last):
> File "/home/ec2-user/anaconda3/lib/python3.5/site-packages/notebook/services/contents/filemanager.py",
> line 395, in save
> self.check_and_sign(nb, path)
> File "/home/ec2-user/anaconda3/lib/python3.5/site-packages/notebook/services/contents/manager.py",
> line 431, in check_and_sign
> self.notary.sign(nb)
> File "/home/ec2-user/anaconda3/lib/python3.5/site-packages/nbformat/sign.py",
> line 263, in sign
> self.store_signature(signature, nb)
> File "/home/ec2-user/anaconda3/lib/python3.5/site-packages/nbformat/sign.py",
> line 270, in store_signature
> (self.algorithm, signature, datetime.utcnow())
> sqlite3.OperationalError: unable to open database file [W 20:38:57.099 NotebookApp] Unexpected error while saving file:
> HW4/HW4.ipynb unable to open database file [E 20:38:57.100
> NotebookApp] {
> "Content-Type": "application/json",
> "Connection": "keep-alive",
> "Referer": "http://localhost:8880/notebooks/HW4/HW4.ipynb",
> "Accept-Encoding": "gzip, deflate",
> "Content-Length": "24540",
> "Accept-Language": "en-US,en;q=0.5",
> "Accept": "application/json, text/javascript, */*; q=0.01",
> "Host": "localhost:8880",
> "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:49.0) Gecko/20100101 Firefox/49.0",
> "X-Requested-With": "XMLHttpRequest"
> }
我检查了anaconda3文件夹的所有权,运行Ipython笔记本的用户对文件夹具有读/写权限。我应该查看任何其他配置
答案 0 :(得分:5)
鉴于此问题是一年多以前发布的,很可能已解决。将这个答案发布给搜索引擎。
/ home目录中的磁盘空间用完将触发此错误,尤其是“以前曾经起作用,但现在不起作用”。鉴于这是EC2实例,因此空间可能有限并且可能已满,尤其是在您要进行大量数据分析的情况下。
在空间用完后,我在受配额限制的/ home文件系统上遇到了类似的错误消息。这是异常的相关部分:
File "/data/user/jpr/projects/mpdmine/venv/lib/python3.6/site-packages/nbformat/sign.py", line 439, in check_signature
return self.store.check_signature(signature, self.algorithm)
File "/data/user/jpr/projects/mpdmine/venv/lib/python3.6/site-packages/nbformat/sign.py", line 239, in check_signature
(datetime.utcnow(), algorithm, digest),
sqlite3.OperationalError: unable to open database file
正在打开的文件未在堆栈跟踪中列出,但是此bug thread提供了提示。该数据库文件是笔记本签名数据库〜/ .local / share / jupyter / nbsignatures.db。开放尝试创建日记文件,如果由于完整的文件系统而失败,则数据库打开将失败。
您可以在jupyter笔记本python进程(strace -e open -p)上使用strace来查看打开文件的尝试。
修复文件系统已满问题,应该可以解决此错误。
答案 1 :(得分:0)
嘿,请确保您没有重新安装python来解决库安装故障,并忘记了Jupyter还是一个python库,同时让实例仍在运行……就像我所做的那样。。