jupyterlab-git: git folder not being recognized

This is with jupyterlab 0.31.1 and the latest master of jupyterlab-git.

In the terminal I’m seeing 404 messages of the form:

[W 15:45:45.040 LabApp] 404 POST /git/API?1516772745105 (10.200.18.81) 4.00ms
[W 15:45:52.422 LabApp] 404 POST /git/API?1516772752486 (10.200.18.81) 4.00ms 
[W 15:45:52.851 LabApp] 404 POST /git/API?1516772752917 (10.200.18.81) 3.99ms 
[W 15:46:00.031 LabApp] 404 POST /git/API?1516772760098 (10.200.18.81) 4.00ms 

image

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (13 by maintainers)

Most upvoted comments

@dunjoye4real I made a PR(#210) which uses the server server_root_dir setting instead of os.getcwd().

This worked for me when launching using the --notebook-dir option.

Hey @Mayurji

Please open a new issue instead of using a closed one.

The first advice I would give you is to use a more recent version. 0.30.1 is very old.

I have the same issue with Git tab looking in the wrong folder. I tried to use open terminal from Git menu and i figured out jupyter-lab is referencing from /home/username/ which apparently, i started jupyterlab from that path, fine. I did a git init in this same folder /home/username/ but jupyterlab-git could not still recognise the folder as a git repository even after multiple restart. I could do all git task in this repository but jupyterlab-git extension can’t recognise it as a git repository. Kindly, @zzhangjii @AmadeusSG @hjalmarlucius does anyone know a fix for this issue?

Also is there anyway to point jupyterlab-git to --notebook-dir if i had specify my --notebook-dir when starting jupyterlab?

@AmadeusSG I have this very same issue of the Git tab looking in the wrong folder

I think I may have found the issue here; the git extension doesn’t recognise extra prefixes to the path that it supposed to be at. Currently I also have a multi-user JupyterHub set-up with JupyterLab interface, with the added jupyter-git extension (using the package.json hack by @zzhangjii)

For example, by default JupyterHub starts the server at /home/user/. However, I made it such that the root folder of the JupyterHub is at /home/user/JupyterHub/ instead. This may interfere with how it searches for the current folder using the Files tab.

So, for example, the intended repo directory to use the Git tab is at /home/user/JupyterHub/myrepo/. However, the Git tab may be referencing this as /home/user/myrepo/ instead. So I’m wondering if anyone can tell me where to change the reference point to attempt to solve the issue.

How I got this suggestion is to use Open Terminal in the upper menu’s Git tab. When I click on it, it shows me that it does a cd myrepo instead of cd JupyterHub/myrepo, which resulted in a path error.

I may be wrong in the diagnosis of the issue though, as I did copy myrepo to /home/user/myrepo to check whether the Git tab identified the folder as a git directory, but to no avail. But hopefully this finding may lead someone to find a better path to fix this issue.

That should be the issue, the server extension hasn’t been tested for Windows system. Probably the handlers can’t be detected in Windows, so got 404 errors.