jupyter / nbdime

Tools for diffing and merging of Jupyter notebooks.
http://nbdime.readthedocs.io
Other
2.66k stars 160 forks source link

nbdiff-web fails #440

Closed QuinRiva closed 5 years ago

QuinRiva commented 5 years ago

Attempting to either run nbdiff-web, or by clicking on the git nbdiff button in Jupyter results in an error. Note that running git diff works just fine.

Jupyter is running on a Centos 7 machine, and I'm accessing the web interface remotely from a Windows 7 Machine.

[E 23:58:19.215 NotebookApp] Uncaught exception POST /nbdime/api/diff?1542671899158 (remote_ip)
    HTTPServerRequest(protocol='http', host='10.100.51.125:8888', method='POST', uri='/nbdime/api/diff?1542671899158', version='HTTP/1.1', remote_ip='172.16.55.33')
    Traceback (most recent call last):
      File "/home/centos/anaconda3/lib/python3.7/site-packages/tornado/web.py", line 1592, in _execute
        result = yield result
      File "/home/centos/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 1133, in run
        value = future.result()
      File "/home/centos/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 326, in wrapper
        yielded = next(result)
      File "/home/centos/anaconda3/lib/python3.7/site-packages/nbdime/webapp/nb_server_extension.py", line 145, in post
        base_nb, remote_nb = self._get_git_notebooks(base[len('git:'):])
      File "/home/centos/anaconda3/lib/python3.7/site-packages/nbdime/webapp/nb_server_extension.py", line 91, in _get_git_notebooks
        for fbase, fremote in changed_notebooks('HEAD', None, base, git_root):
      File "/home/centos/anaconda3/lib/python3.7/site-packages/nbdime/gitfiles.py", line 160, in changed_notebooks
        entry.b_path, entry.b_blob, ref_remote, repo_dir)
      File "/home/centos/anaconda3/lib/python3.7/site-packages/nbdime/gitfiles.py", line 110, in _get_diff_entry_stream
        ret = apply_possible_filter(path)
      File "/home/centos/anaconda3/lib/python3.7/site-packages/nbdime/vcs/git/filter_integration.py", line 64, in apply_possible_filter
        filter_attr = interrogate_filter(git_path)
      File "/home/centos/anaconda3/lib/python3.7/site-packages/nbdime/vcs/git/filter_integration.py", line 24, in interrogate_filter
        path_list, attr, info = [s.decode('utf8', 'replace') for s in spec.split(b'\x00')[:3]]
    ValueError: not enough values to unpack (expected 3, got 1)
[W 23:58:19.223 NotebookApp] Unhandled error
[E 23:58:19.224 NotebookApp] {
      "Host": "10.100.51.125:8888",
      "Connection": "keep-alive",
      "Content-Length": "87",
      "Origin": "http://10.100.51.125:8888",
      "X-Xsrftoken": "hidden",
      "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36",
      "Content-Type": "application/json",
      "Accept": "*/*",
      "Referer": "http://10.100.51.125:8888/nbdime/git-difftool?base=dev/roi/funeral/Refresh%20Cost%20Revenue%20-%202018-10-24-prod.ipynb",
      "Accept-Encoding": "gzip, deflate",
      "Accept-Language": "en-AU,en-GB;q=0.9,en-US;q=0.8,en;q=0.7",
      "Cookie": "_xsrf=2|1e42493f|45e23814f9116c6e8d8e3979d9b9e181|1541391512; username-10-100-51-125-8888=\"2|1:0|10:1542671887|27:username-10-100-51-125-8888|hidden"
    }
[E 23:58:19.224 NotebookApp] 500 POST /nbdime/api/diff?1542671899158 (<remote IP>) 38.36ms referer=http://10.100.51.125:8888/nbdime/git-difftool?base=dev/roi/funeral/Refresh%20Cost%20Revenue%20-%202018-10-24-prod.ipynb
vidartf commented 5 years ago

This is an issue with Centos 7 having an old version of git. See https://github.com/jupyter/nbdime/issues/417.

I think a possible solution to this is to say that if these functions fail, you simply will not get git-filter integration, instead of falling over completely.

vidartf commented 5 years ago

@QuinRiva Are you able to confirm if #441 fixes the issue?