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

Can't push to github #43106

Closed
Tracked by #38741
nico opened this issue Oct 22, 2019 · 19 comments
Closed
Tracked by #38741

Can't push to github #43106

nico opened this issue Oct 22, 2019 · 19 comments
Labels
bugzilla Issues migrated from bugzilla

Comments

@nico
Copy link
Contributor

nico commented Oct 22, 2019

Bugzilla Link 43761
Resolution FIXED
Resolved on Jun 18, 2020 08:38
Version unspecified
OS Linux
Blocks #38741
CC @legrosbuffle,@gchatelet,@zmodem,@rupprecht,@rotateright,@stephanemoore,@tstellar

Extended Description

see https://reviews.llvm.org/D67772 :

I'm getting

$ llvm/utils/git-svn/git-llvm push -n
Traceback (most recent call last):
File "llvm/utils/git-svn/git-llvm", line 39, in
import github
ImportError: No module named github

now. Are there docs on what I need to do to be able to commit using this script now?

Alternatively I tried pushing via git directly but couldn't get that to work either:

$ git push origin mylocalbranch:master
Enumerating objects: 13, done.
Counting objects: 100% (13/13), done.
Delta compression using up to 24 threads
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 657 bytes | 657.00 KiB/s, done.
Total 7 (delta 6), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (6/6), completed with 6 local objects.
remote: error: GH006: Protected branch update failed for refs/heads/master.
remote: error: You're not authorized to push to this branch. Visit https://help.github.com/articles/about-protected-branches/ for more information.
To https://github.com/llvm/llvm-project.git
! [remote rejected] gnmergerev -> master (protected branch hook declined)
error: failed to push some refs to 'https://github.com/llvm/llvm-project.git'

@tstellar
Copy link
Collaborator

You need to install the github python module.

@nico
Copy link
Contributor Author

nico commented Oct 22, 2019

Thoughts on why the "use git directly" path didn't work?

@nico
Copy link
Contributor Author

nico commented Oct 22, 2019

I ran

$ pip install --user PyGithub

and tried again with the wrapper (but getting it to work without the wrapper first is probably more interesting anyhow):

$ llvm/utils/git-svn/git-llvm push -n
Traceback (most recent call last):
File "llvm/utils/git-svn/git-llvm", line 329, in
args.func(args)
File "llvm/utils/git-svn/git-llvm", line 248, in cmd_push
revs = get_revs_to_push(args.branch)
File "llvm/utils/git-svn/git-llvm", line 217, in get_revs_to_push
git('fetch', get_fetch_url(), branch)
File "llvm/utils/git-svn/git-llvm", line 187, in git
return shell(['git'] + list(cmd), **kwargs)
File "llvm/utils/git-svn/git-llvm", line 146, in shell
quoted_cmd = [quote(arg) for arg in cmd]
File "/usr/lib/python2.7/pipes.py", line 269, in quote
for c in file:
TypeError: 'NoneType' object is not iterable

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 22, 2019

Nico,
What is your GitHub username?

@nico
Copy link
Contributor Author

nico commented Oct 22, 2019

nico

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 22, 2019

Ok, just double checked and you do have write access to the repository.

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 22, 2019

Ah, looks like there was a branch protection in place limiting who could push. I have removed that protection and I believe you should be able to push using git directly now. Would you be able to try a commit when you have a moment?

@nico
Copy link
Contributor Author

nico commented Oct 22, 2019

That did the trick, thanks! Pushing directly works now.

The NoneType problem when using git-llvm is still present.

@gchatelet
Copy link
Contributor

Same here, exact same errors. Stuck on the NoneType and not whitelisted so I can't push to LLVM anymore.

@rotateright
Copy link
Contributor

Same here, exact same errors. Stuck on the NoneType and not whitelisted so I
can't push to LLVM anymore.

I suspect I'm having the same problem. My GitHub username is "rotateright".

@gchatelet
Copy link
Contributor

Same here, exact same errors. Stuck on the NoneType and not whitelisted so I
can't push to LLVM anymore.

My github user is 'gchatelet' but I suspect adding everybody to the whitelist won't scale.

@rupprecht
Copy link
Collaborator

I ran
$ pip install --user PyGithub

On debian, you can use the python-github package instead of pip:
$ sudo apt install python-github

TypeError: 'NoneType' object is not iterable

I changed my usual invocation from
$ git llvm push
to:
$ git llvm push master

Which is what NoneType is complaining about, in a very opaque way.

@gchatelet
Copy link
Contributor

For those using github two factor auth, this will come in handy
https://stackoverflow.com/questions/29297154/github-invalid-username-or-password

TL;DR: you need to create a specific access token to authenticate.

@gchatelet
Copy link
Contributor

For those using github two factor auth, this will come in handy
https://stackoverflow.com/questions/29297154/github-invalid-username-or-
password

TL;DR: you need to create a specific access token to authenticate.

Actually it still doesn't work:

% git status
On branch D69307
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)

nothing to commit, working tree clean

% git llvm push master
git fetch https://github.com/llvm/llvm-project.git master printed to stderr:
From https://github.com/llvm/llvm-project

  • branch master -> FETCH_HEAD
    Nothing to push

Anyone else has a similar problem?

@gchatelet
Copy link
Contributor

Rebasing helped but now I'm missing push access to the repo.

% git llvm push master
git fetch https://github.com/llvm/llvm-project.git master printed to stderr:
From https://github.com/llvm/llvm-project

  • branch master -> FETCH_HEAD
    Pushing 1 commit:
    59c321a7320 [Alignment][NFC] getMemoryOpCost uses MaybeAlign
    Username for 'https://github.com': gchatelet
    Password for 'https://gchatelet@github.com':
    git push https://github.com/llvm/llvm-project.git 59c321a7320da8d4504cd499e020626886a8ea97:master returned 128
    remote: Permission to llvm/llvm-project.git denied to gchatelet.
    fatal: unable to access 'https://github.com/llvm/llvm-project.git/': The requested URL returned error: 403

@rotateright
Copy link
Contributor

Rebasing helped but now I'm missing push access to the repo.

I think we have the same access problem, and it should be handled more specifically than the general case - see bug 43790.

$ git llvm push
git fetch https://github.com/llvm/llvm-project.git master printed to stderr:
From https://github.com/llvm/llvm-project

  • branch master -> FETCH_HEAD
    Pushing 1 commit:
    216f1506ea0 [SLP] adjust code comment; NFC
    Username for 'https://github.com': rotateright
    Password for 'https://rotateright@github.com':
    git push https://github.com/llvm/llvm-project.git 216f1506ea000bb7612bfeb0cbd7dddbd065b1bd:master returned 128
    remote: Permission to llvm/llvm-project.git denied to rotateright.
    fatal: unable to access 'https://github.com/llvm/llvm-project.git/': The requested URL returned error: 403

@gchatelet
Copy link
Contributor

I think we have the same access problem, and it should be handled more
specifically than the general case - see bug 43790.

Thx for the bug!

I arrived to the same conclusion while trying to add myself to SVN's github-usernames.txt

svn co https://llvm.org/svn/llvm-project/meta/trunk/ meta
cd meta
vim github-usernames.txt

Add "me-svn:me-github"

svn commit --message "Add github commit access for me-github"
svn: E175013: Commit failed (details follow):
svn: E175013: Access to '/svn/llvm-project/!svn/act/4e8172f2-1773-4b5c-bdb7-b232c26b40e8' forbidden

@nico
Copy link
Contributor Author

nico commented Jun 18, 2020

pushing works fine, and we deleted git-llvm, so all good now.

@gchatelet
Copy link
Contributor

mentioned in issue llvm/llvm-bugzilla-archive#43791

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

6 participants