Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty AWS CodeCommit repo fails to get upstream branch during push #286

Closed
jaipreet-s opened this issue Dec 4, 2018 · 3 comments · Fixed by #1365
Closed

Empty AWS CodeCommit repo fails to get upstream branch during push #286

jaipreet-s opened this issue Dec 4, 2018 · 3 comments · Fixed by #1365
Labels

Comments

@jaipreet-s
Copy link
Member

Steps to repro

  • Create an empty CodeCommit repo
  • Clone locally
  • Touch a file, stage, push.
  • Push failed with an empty error message

Details

On observing the server side logs, I saw the following logs which comes from the get_upstream_branch path

[E 21:47:22.008 NotebookApp] Uncaught exception POST /git/push?1543960041903 (10.0.1.116)
    HTTPServerRequest(protocol='https', host='10.0.46.183:8443', method='POST', uri='/git/push?1543960041903', version='HTTP/1.1', remote_ip='10.0.1.116')
    Traceback (most recent call last):
      File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/web.py", line 1590, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/jupyterlab_git/handlers.py", line 365, in post
        current_upstream_branch = self.git.get_upstream_branch(current_path, current_local_branch)                                                                                  s/JupyterSystemEnv/lib/python3.6/site-packages/jupyterlab
      File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/jupenvs/JupyterSystemEnv/share/jupyter/labyterlab_git/git.py", line 589, in get_upstream_branch
        ' '.join(command)
    Exception: Error [fatal: ambiguous argument 'master@{upstream}': unknown revision or pkerath not in the working tree.
    Use '--' to separate paths from revisions, like this:
    'git <command> [<revision>...] -- [<file>...]'                                        twice to skip confirmation).
    ] occurred while executing [git rev-parse --abbrev-ref master@{upstream}] command to get upstream branch.
[W 21:47:22.058 NotebookApp] Unhandled error   

On git status, I see this state of the local repo, and plain git push works

On branch master
Your branch is based on 'origin/master', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        .ipynb_checkpoints/

nothing added to commit but untracked files present (use "git add" to track)
sh-4.2$ git push
Counting objects: 3, done.
Writing objects: 100% (3/3), 259 bytes | 259.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To https://git-codecommit.us-west-2.amazonaws.com/v1/repos/AmazonSageMaker-jaipreet-new
 * [new branch]      master -> master
@jaipreet-s jaipreet-s added the bug label Dec 4, 2018
@jaipreet-s jaipreet-s changed the title Empty CodeCommit repo fails to get upstream branch Empty AWS CodeCommit repo fails to get upstream branch during push Dec 4, 2018
@jaipreet-s jaipreet-s self-assigned this Dec 6, 2018
@jaipreet-s jaipreet-s removed their assignment Feb 8, 2019
@amit1rrr
Copy link

Just confirming that this happens if you clone an empty repository.

Anyway to set upstream for empty repositories? Or better yet, if the extensions can handle upstreams for empty repository?

@brichet
Copy link

brichet commented Apr 26, 2024

@jaipreet-s does this problem still exist?

I'm not able to reproduce it with jupyterlab-git 0.50.0.

@jtpio
Copy link
Member

jtpio commented Oct 10, 2024

Just tried today and it seems like it's possible to push via the Git menu. After pushing the buttons are not greyed out anymore.

We should check why the push and pull buttons are disabled in the first place.

@jtpio jtpio assigned jtpio and unassigned jtpio Oct 10, 2024
@jtpio jtpio linked a pull request Oct 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants