sat28 / githubcommit

A jupyter notebook extension enabling users push ipython notebooks to a git repo
MIT License
127 stars 75 forks source link

Warning! Something went wrong. Forbidden #18

Open awg01 opened 5 years ago

awg01 commented 5 years ago

I followed all of your installation steps on linux and added plugin to my jupyter notebook. But I am getting this error after committing code into repo.

Warning! Something went wrong. Forbidden

sat28 commented 5 years ago

@akashgudadhe1 please share the logs you see at the console from where jupyter is being invoke.

acc04747 commented 5 years ago

I get this Forbidden error also. Here are my console logs from jupyter:

[W 10:19:59.731 NotebookApp] 403 PUT /git/commit (::1): '_xsrf' argument missing from POST [W 10:19:59.733 NotebookApp] 403 PUT /git/commit (::1) 2.29ms referer=http://localhost:8888/notebooks/Github%20Integration%20-%20Take%201.ipynb

acc04747 commented 5 years ago

I reran env.sh and that error went away. Now I get "Not Found". Console logs below. I am using ssh port forwarding to run jupyter on a remote server.)

[W 10:26:55.571 NotebookApp] 404 PUT /git/commit (::1) 3.78ms referer=http://localhost:8888/notebooks/new-project/Untitled.ipynb?kernel_name=andrewenv37 [W 10:27:22.132 NotebookApp] 404 PUT /git/commit (::1) 2.49ms referer=http://localhost:8888/notebooks/new-project/TestNotebook.ipynb

driskerr commented 4 years ago

Howdy! I am encountering the same issue too :/ can @sat28 help me troubleshoot?


Uncaught exception PUT /git/commit (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='PUT', uri='/git/commit', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "/Applications/anaconda3/lib/python3.7/site-packages/githubcommit/handlers.py", line 53, in put
        print(repo.git.checkout('HEAD', b=git_branch))
      File "/Applications/anaconda3/lib/python3.7/site-packages/git/cmd.py", line 545, in <lambda>
        return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
      File "/Applications/anaconda3/lib/python3.7/site-packages/git/cmd.py", line 1014, in _call_process
        return self.execute(call, **exec_kwargs)
      File "/Applications/anaconda3/lib/python3.7/site-packages/git/cmd.py", line 825, in execute
        raise GitCommandError(command, status, stderr_value, stdout_value)
    git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
      cmdline: git checkout -b master HEAD
      stderr: 'fatal: 'HEAD' is not a commit and a branch 'master' cannot be created from it'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/Applications/anaconda3/lib/python3.7/site-packages/git/util.py", line 888, in __getitem__
        return getattr(self, index)
      File "/Applications/anaconda3/lib/python3.7/site-packages/git/util.py", line 881, in __getattr__
        return list.__getattribute__(self, attr)
    AttributeError: 'IterableList' object has no attribute 'master'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/Applications/anaconda3/lib/python3.7/site-packages/tornado/web.py", line 1590, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/Applications/anaconda3/lib/python3.7/site-packages/githubcommit/handlers.py", line 55, in put
        print("Switching to {}".format(repo.heads[git_branch].checkout()))
      File "/Applications/anaconda3/lib/python3.7/site-packages/git/util.py", line 890, in __getitem__
        raise IndexError("No item found with id %r" % (self._prefix + index))
    IndexError: No item found with id 'master'
[E 22:16:32.546 NotebookApp] {
      "Host": "localhost:8888",
      "Connection": "keep-alive",
      "Content-Length": "79",
      "Accept": "application/json, text/javascript, */*; q=0.01",
      "Origin": "http://localhost:8888",
      "X-Requested-With": "XMLHttpRequest",
      "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
      "Content-Type": "application/json",
      "Referer": "http://localhost:8888/notebooks/testing.ipynb",
      "Accept-Encoding": "gzip, deflate, br",
      "Accept-Language": "en-US,en;q=0.9",
      "Cookie": "_xsrf=2|abf83965|83c6bbb764c88fcfc7069b42b97b29fd|1570681748; username-localhost-8889=\"2|1:0|10:1570683687|23:username-localhost-8889|44:OGQxMjE5YzNmY2Q1NDU5Yjg1YjVhZDEzNDA0ZWQwYWM=|d5d8428b77af1a7e7439df6cef0d43e3ff8fd71983068fbeae31636810944f4d\"; username-localhost-8888=\"2|1:0|10:1570684545|23:username-localhost-8888|44:OTA4ODUxZTA0NzlkNDJmMmJjNzZjMTM2MGJhYTIyZGM=|b382f8105ca29247d7c19e1b156611b9316f4de3a5a662eeaa6133b768968dc3\""
    }
[E 22:16:32.547 NotebookApp] 500 PUT /git/commit (::1) 58.55ms referer=http://localhost:8888/notebooks/testing.ipynb```
sat28 commented 3 years ago

@driskerr and @akashgudadhe1 pls look into this video https://www.youtube.com/watch?v=vKx_4zFvOi8