0.8 SSH git push "authorization failed"

Labels: area/git kind/bug lifecycle/active priority/important-soon triage/accepted

Timeline

Matěj Cepl (mcepl) opened (edited)

(originally dealt with as https://github.com/go-git/go-git/issues/489, but it is really a different bug, Cc: @MichaelMure , @pjbgf).

Original issue report was:

Just prepared a reproducer for my colleague:

This is my local git repo https://mcepl.fedorapeople.org/tmp/wikipediafs-repo.tar.xz, using https://github.com/MichaelMure/git-bug/releases/download/v0.8.0/git-bug_linux_amd64, and then when I run:

tumbleweed-pkg~/r/wikipediafs (master)$ /tmp/git-bug_linux_amd64 ls 
a1403a8	open	bytes/str mess when converted to Py3              	Matěj Cepl     	
d3b7005	open	proposal for improvement by mobiphil              	Matěj Cepl     	
tumbleweed-pkg~/r/wikipediafs (master)$ git remote -v
myrepo	https://git.cepl.eu/cgit/toys/wikipediafs (fetch)
myrepo	redcrew:/srv/git/toys/wikipediafs.git (push)
sourcehut	https://git.sr.ht/~mcepl/wikipediafs (fetch)
sourcehut	git@git.sr.ht:~mcepl/wikipediafs (push)
tumbleweed-pkg~/r/wikipediafs (master)$ /tmp/git-bug_linux_amd64 push sourcehut
Error: authorization failed
tumbleweed-pkg~/r/wikipediafs (master)$ 

(if you want R/W access to the sourcehut repo, let me know your sourcehut username, but I can reproduce exactly the same with https://git.cepl.eu/cgit/toys/wikipediafs/ where it is just openssh-server-5.3p1-124.el6_10.x86_64 and git-1.7.1-10.el6_10.x86_64 on an ancient CentOS 6).

Obviously, git push --all sourcehut works perfectly.


Then, @pjbgf suspected that I was using outdated go-git version. So, this is the result:

I will look into rebuilding git-bug with revendored dependencies later, but just to note that the reproduction I showed here (and sorry about the formatting, GitHub cannot parse Markdown from emails) was against Sourcehut and I don't think they use obsolete software there (they may use libgit2, or something else than the canonical git binary).

and

When including this commit on the top of the current master, I get this binary for Linux/x86_64. With that I get exactly the same problem:

tumbleweed-pkg~/r/wikipediafs (master)$ git remote -v
myrepo	https://git.cepl.eu/cgit/toys/wikipediafs (fetch)
myrepo	redcrew:/srv/git/toys/wikipediafs.git (push)
sourcehut	https://git.sr.ht/~mcepl/wikipediafs (fetch)
sourcehut	git@git.sr.ht:~mcepl/wikipediafs (push)
tumbleweed-pkg~/r/wikipediafs (master)$ git bug push sourcehut 
Error: authorization failed
tumbleweed-pkg~/r/wikipediafs (master)$ 

(again, trying to push to Sourcehut to eliminate any possible problems with obsolete versions of software on my server)

@MichaelMure, is it possible to get some kind of debugging or verbose information?


Also echo '0009done' | ssh git@git.sr.ht git-upload-pack /~mcepl/wikipediafs reports agent=git/2.43.4.

Michael Muré (MichaelMure) commented

I'm afraid only the debugger deep in go-git will really tell you what's happening.

Paulo Gomes (pjbgf) commented

@mcepl do you mind giving it a try using the pseudo version of go-git from master, as the changes that should enrich the errors are not yet on a cut version.

Paulo Gomes (pjbgf) commented (edited)

I tested vanilla go-git pushing commits to a test source hut repo using a sk-ssh-ed25519 key and it worked fine. I then compiled git-bug using go-git/v5@master and that also worked:

$ git bug termui # create a new bug
$ git bug push

sudoforge added label kind/bug

sudoforge added label priority/important-soon

sudoforge added label triage/accepted

sudoforge added label area/git

sudoforge added label lifecycle/active

sudoforge closed the bug