question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to view file changes. Unhandled error

See original GitHub issue

Description

I get “Error Loading Notebook Diff: Unhandled error” when I look at file changes.

Reproduce

  1. Make changes to a file
  2. Go to Git sidebar
  3. Stage commit
  4. Add message
  5. Press Commit
  6. Go to History Tab
  7. Click on changes
  8. Error display on main view

Expected behavior

I expect that see the change history.

Context

After installing anaconda, I configured the proxy settings for anaconda and executed the following command.

> conda install jupyterlab-git
> nbdime config-git --enable --global
  • Python package version:
> conda list jupyterlab-git
jupyterlab-git    0.30.1    pyhd8ed1ab_0    conda-forge
  • Extension version:
>jupyter labextension list
JupyterLab v3.0.14
C:\ProgramData\Anaconda3\share\jupyter\labextensions
        nbdime-jupyterlab v2.1.0 enabled ok
        @jupyter-widgets/jupyterlab-manager v3.0.0 enabled ok (python, jupyterlab_widgets)
        @jupyterlab/git v0.30.1 enabled ok (python, jupyterlab-git)

Other labextensions (built into JupyterLab)
   app dir: C:\ProgramData\Anaconda3\share\jupyter\lab
>jupyter server extension list
Config dir: C:\Users\localadmin\.jupyter

Config dir: C:\ProgramData\Anaconda3\etc\jupyter
    jupyter_server_mathjax enabled
    - Validating jupyter_server_mathjax...
      jupyter_server_mathjax  ok
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 3.0.14 ok
    jupyterlab_git enabled
    - Validating jupyterlab_git...
      jupyterlab_git 0.30.1 ok
    nbclassic enabled
    - Validating nbclassic...
      nbclassic  ok
    nbdime enabled
    - Validating nbdime...
      nbdime 3.1.0 ok

Config dir: C:\ProgramData\jupyter
  • Git version:
> git --version
git version 2.31.1.windows.1
  • Operating System and its version:
Windows Server 2016
Anaconda3-2021.05-Windows-x86_64
Command Line Output
[I 2021-06-08 10:47:45.637 LabApp] Build is up to date
[W 10:47:52.372 NotebookApp.jupyterlab_git] Fail to execute ['git', 'diff', '--numstat', '4b825dc642cb6eb9a060e54bf8d69288fbee4904', '289e12f459513f1bc28ae6a07463ec95db95cfc7', '--', '00_public/01_Settings/Master/Setting Creator.ipynb']
    Traceback (most recent call last):
      File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab_git\git.py", line 142, in execute
        code, output, error = await current_loop.run_in_executor(
      File "C:\ProgramData\Anaconda3\lib\concurrent\futures\thread.py", line 57, in run
        result = self.fn(*self.args, **self.kwargs)
      File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab_git\git.py", line 108, in call_subprocess
        process = subprocess.Popen(
      File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 858, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 1311, in _execute_child
        hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
    NotADirectoryError: [WinError 267] ディレクトリ名が無効です。
[E 10:47:52.372 NotebookApp] Uncaught exception POST /git/content?1623116872354 (***.***.***.***)
    HTTPServerRequest(protocol='http', host='servername:9999', method='POST', uri='/git/content?1623116872354', version='HTTP/1.1', remote_ip='***.***.***.***')
    Traceback (most recent call last):
      File "C:\ProgramData\Anaconda3\lib\site-packages\tornado\web.py", line 1704, in _execute
        result = await result
      File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab_git\handlers.py", line 668, in post
        response = await self.git.get_content_at_reference(
      File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab_git\git.py", line 1249, in get_content_at_reference
        is_binary = await self._is_binary(filename, reference["git"], top_repo_path)
      File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab_git\git.py", line 1302, in _is_binary
        code, output, error = await execute(command, cwd=top_repo_path)
      File "C:\ProgramData\Anaconda3\lib\site-packages\jupyterlab_git\git.py", line 159, in execute
        return code, output, error
    UnboundLocalError: local variable 'code' referenced before assignment
[W 10:47:52.372 NotebookApp] Unhandled error
Web Browser Output
Error Loading Notebook Diff: Unhandled error
Jupyter Config
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.notebook_dir = 'c:/00_workarea'
c.NotebookApp.open_browser = False
c.NotebookApp.quit_button = False
c.NotebookApp.port = 9999
c.NotebookApp.token = 'xxxxx'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rs57770917commented, Jun 14, 2021

Thank you very much. After changing the settings, it shows up correctly.

0reactions
fcollonvalcommented, Jun 9, 2021

You may be right. Could you try using ‘c:\00_workarea’ to use Windows path separator.

Comment: since JupyterLab 3, you need to use c.ServerApp instead of c.NotebookApp - the latter will not be supported in the future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[FATAL] Failed to view version file:[/action/lib/functions ...
For last 2 days, I am getting the error [FATAL] Failed to view version file:[/action/lib/functions/linterVersions.txt].
Read more >
Fatal error when pushing to Github repository
When pushing the changes in my solution into a Github repository, Visual Studio reports a “fatal error” for several files, stopping me from...
Read more >
can't add all files to git due to permissions - Stack Overflow
1. run git as > sudo git add . · 2. run git command as git add --ignore-errors -force . · 3. change...
Read more >
Fatal Error failed open file occurs after equipment change in ...
Ive been trying to isolate it to see if its any specific item but its inconsistant and is not caused by mods as...
Read more >
Error: failed to push some refs to – How to Fix in Git
This error mainly occurs when you attempt to push your local changes to GitHub while the local repository (repo) has not yet been...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found