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.

Always complains "You aren’t in a git repository" after launching juputerlab from jupyterhub

See original GitHub issue

My notebook_url is set to /home/admin, and when admin logged in, it is automatically navigated to /home/admin as default. I’ve tried to create a new gitlab repo and apply /home/admin to this git repo after commands like (git init; git add .; git commit -m '...'; git push origin master). After all these done, the directory looks as below:

[root@9b27d6147671 admin]# pwd
/home/admin
[root@9b27d6147671 admin]# ll -a
total 40
drwxrwx---  8 admin admin 4096 Aug 16 18:56 .
drwxr-xr-x 14 root  root  4096 Aug 16 18:33 ..
-rw-------  1 admin admin   56 Aug 16 19:10 .bash_history
drwx------  3 admin admin 4096 Aug 16 18:55 .config
drwxr-xr-x  7 admin admin 4096 Aug 16 19:16 .git

I launched jupyterhub from path ‘/’ via command jupyterhub --port 8080 and the git extension always complains “You aren’t in a git repository” even though the git repo exists there. Any ideas? Thanks.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:19
  • Comments:42 (16 by maintainers)

github_iconTop GitHub Comments

4reactions
CerebralMasticationcommented, Nov 22, 2018

I finally got it working in my docker build. For me the secrets were 1) ensuring I ran jupyter labextension link and 2) making sure my serverextension command included --sys-prefix jupyterlab_git

Below is my docker file excerpt showing how I’m loading jupyterlab-git. Note that I’m cloning from github and doing a checkout at a specific hash just to ensure nothing changes underneath me over time.

RUN git clone https://github.com/jupyterlab/jupyterlab-git 
WORKDIR ./jupyterlab-git
RUN git checkout 276a42d772e0a13eb4b880c1ea45044cd5821a45
RUN npm install 
RUN npm run build
RUN jupyter labextension link . 
RUN npm run build 

RUN pip3.6 install .
RUN jupyter serverextension enable --py --sys-prefix jupyterlab_git 
3reactions
gsemetcommented, Oct 24, 2018

Same with jupyterlab 0.35.2, but:

  • no more error on jupyterlab start (jupyterlab_git pypi module seem well installed)
  • 404 still returned on the git/all_history endpoint. The log displays:
404 POST /staging/user/myusername/git/all_history?1540396029715 (myusername@12.13.14.15) 30.64ms

I am behind a jupyterhub + jupyterlab, and the url is accessible throught: http://jupyter.mycompany.fr/staging/user/myusername/lab

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter Notebooks in a Git Repository - Read the Docs
This assumes that you have no Jupyter notebooks in your repository yet or all your notebooks are “clean” (i.e. stored without outputs). ......
Read more >
How do I work with a git-versioned project in Jupyter Lab?
Create a repository on GitHub/GitLab that you want to work with in Jupyter Lab. Whether you are using the git extension or the...
Read more >
Logging into github from Jupyter notebook - Stack Overflow
You shouldn't need credentials because this is a public repo. Since you have git working on your machine, you should be good.
Read more >
How to clear the Jupyter Notebook outputs automatically?
Clearing output cells before every commit will avoid sending data to the remote repository that are not actual changes, decreasing the size of ......
Read more >
Tutorial: Advanced Jupyter Notebooks - Dataquest
Maybe there's a bunch of packages you always need to import when starting a new notebook, a few statistics that you find yourself...
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