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

0.8.0 issue with Authentication #934

Open
idjohnson opened this issue Nov 27, 2022 · 32 comments · May be fixed by #1146
Open

0.8.0 issue with Authentication #934

idjohnson opened this issue Nov 27, 2022 · 32 comments · May be fixed by #1146
Assignees
Milestone

Comments

@idjohnson
Copy link

I setup 0.8.0 (Linux amd64) in WSL running Ubuntu 20.04 (focal) and git 2.25.1

I tried with an Org GH Repo, Personal GH repo and a freshly pulled AzDO repo.

$ git bug pull
Fetching remote ...
Error: authentication required

I tried with 0.7.2 without issue.

I even tried migrating a working repo then using 0.8.0 and got the error again

...snip
Migration #3
Purpose: Make bug and identities independent from the storage by making the ID generation self-contained. Also, migrate to the new full DAG entity data model.

identity 1b5c437: migrated to 73519a0
bug b3d0ba7: migrated to 025f7c3


Done!
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug ls
A lock file is present but the corresponding process is not, removing it.
Building identity cache... Done.
Building bug cache... Done.
025f7c3 open    Bug Title 1                                             Isaac Johnson
builder@DESKTOP-72D2D9T:~/Workspaces/testgitbug$ git bug pull
Fetching remote ...
Error: authentication required
@smoyer64
Copy link
Collaborator

Is your SSH key defined in WSL2 and added to GitHub or is your SSH key in Windows. If it's the latter, you have to configure your WSL2 environment by running the ssh-agent. If you want to share your signing keys between Windows and WSL2, you also have to set up your system to serve the PGP keys from Windows and use them from WSL2.

@idjohnson
Copy link
Author

This is just a WIP writeup that covers all the steps I tried - windows, wsl, pre-compiled and compiled from source: http://freshbrewed-test.s3-website-us-east-1.amazonaws.com/2022/12/13/gitbug.html

@idjohnson
Copy link
Author

I tried: WSL https (my usual) with GH Public, Private and Azure DevOps private repos.
I tried WSL SSH
I tried Windows HTTPS.

I tried 0.8.0 and in WSL, also freshly compiled from main.

@k-g
Copy link

k-g commented Dec 1, 2022

I get the same error, under Ubuntu, pushing to a remote on github requiring username and password. Normal push and pull of repo works fine.

@idjohnson
Copy link
Author

idjohnson commented Dec 1, 2022 via email

@smoyer64 smoyer64 self-assigned this Dec 14, 2022
@smoyer64
Copy link
Collaborator

I can replicate this issue ...

@davidberglund
Copy link

davidberglund commented Dec 28, 2022

git-bug 0.8.0 (haven't tried earlier releases) on MacOS and I also can't push/pull from remote with git-bug, while push/fetch/pull <--> remote works fine with git form the same repo using ssh keys. I tried to create

$>git-bug push    
Error: authentication required

git-bug user ls    
88eef59 David Berglund

git-bug user   
Id: 88eef592...   

I'd be happy to troubleshoot further if I knew where to start. (Happy holidays btw :)

@MichaelMure
Copy link
Owner

@davidberglund the first I would try is to upgrade go-git (#947), as it seems there is improvement in that area: go-git/go-git#411

Unfortunately, it seems that this upgrade break things in git-bug, as well as coming with a CGO dependency ...

If that doesn't help, maybe dig into go-git issues?

@MichaelMure
Copy link
Owner

#929 could be related

@davidberglund
Copy link

CGO dependency

I run the binary release. Is that with go-git 5.4.2? And is your suggestion that I try compiling git-bug from source with go-git 5.5.1?

@MichaelMure
Copy link
Owner

Go-git 5.4.2 doesn't have CGO, but the most recent do. Yes, try compiling with that last one and see if that fix this problem. Master is fairly unstable though, as it got a large refactor recently.

@davidberglund
Copy link

I have the same issue after compiling from master. At least I didn't get any new problems AFAIK.

@davidberglund
Copy link

davidberglund commented Dec 28, 2022

Aha, my bad, I thought the tip was requiring 5.5.1, it referred to 5.4.2. I'll try again.

@MichaelMure
Copy link
Owner

Master doesn't have the updated go-git.

@davidberglund
Copy link

davidberglund commented Dec 28, 2022

Not very experienced with building go apps. How do I get passed or bypass the checksum mismatch that occurs upon running make install after changing the required go-git to 5.5.1? Thanks

This download does NOT match an earlier download recorded in go.sum

I tried to run

go clean -modcache 
go mod tidy

@MichaelMure
Copy link
Owner

It looks like something happened upstream. What if you checkout that dependabot PR and just make ?

@davidberglund
Copy link

That worked. I have the same authentication error with git-bug push/pull, though.

@MichaelMure
Copy link
Owner

Then it's likely an outstanding issue in go-git :-/

@davidberglund
Copy link

Ok, I think my main (tiny) contribution is going to be on this level as I'm not a go hacker. I'll keep subscribing to this issue at least.

@MichaelMure
Copy link
Owner

It's already useful! Maybe you could look for a matching issue in go-git, or open one?

@MichaelMure
Copy link
Owner

Also, could you confirm that there is no issue with git-bug v0.7.2 (try in a new repo to avoid data issue)?

@davidberglund
Copy link

I can confirm that git-bug push/pull works fine with 0.7.2. and with the same repo + remote.

@davidberglund
Copy link

Related? go-git/go-git#489

smoyer64 added a commit that referenced this issue Dec 28, 2022
@smoyer64
Copy link
Collaborator

I've updated go-git in de6f540 - While the dependabot-created PR doesn't build, I'm not surprised that it also solves your issue.

@marcopellin
Copy link

Are there some news about this issue?
I would like to let my team test git-bug, and currently I'm stuck at this point.
Are you planning to release a new update soon?

@MichaelMure MichaelMure added this to the 0.9.0 milestone Feb 1, 2023
@mariusboepple
Copy link

I had the following authentication error:

git bug push
Error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

I fixed it by assigning a dedicated ssh config for the git repository's host like described here https://gist.github.com/rbialek/1012262

@mcepl
Copy link
Contributor

mcepl commented Jan 13, 2024

tumbleweed-pkg~/a/2/p/imapArch (master)$ git bug version
git-bug version: -dev-
tumbleweed-pkg~/a/2/p/imapArch (master)$ sed -n -e '/fedorapeople/,+20p' ~/.ssh/config
Host *fedorahosted.org *fedorapeople.org pkgs.fedoraproject.org
    User mcepl
    ProxyCommand none
    ForwardAgent no
    ForwardX11 no
    ForwardX11Trusted no
    Port 22
    KeepAlive yes
    HashKnownHosts no
    GSSAPIAuthentication no
    VerifyHostKeyDNS yes
    IdentityFile /home/matej/.ssh/id_ed25519

Host fedorapeople
    User mcepl
    Hostname fedorapeople.org
    ForwardAgent no
    ForwardX11 no
    ForwardX11Trusted no
    PreferredAuthentications publickey
    IdentityFile /home/matej/.ssh/id_ed25519
tumbleweed-pkg~/a/2/p/imapArch (master)$ git remote -v
fedorapeople	fedorapeople:public_git/imapArch.git (fetch)
fedorapeople	fedorapeople:public_git/imapArch.git (push)
sourcehut	https://git.sr.ht/~mcepl/imapArch (fetch)
sourcehut	git@git.sr.ht:~mcepl/imapArch (push)
tumbleweed-pkg~/a/2/p/imapArch (master)$ git push fedorapeople master:master
Warning: No xauth data; using fake authentication data for X11 forwarding.
X11 forwarding request failed on channel 0
Everything up-to-date
tumbleweed-pkg~/a/2/p/imapArch (master)$ git bug push fedorapeople
Error: ssh: handshake failed: ssh: no authorities for hostname: fedorapeople.org:22
tumbleweed-pkg~/a/2/p/imapArch (master)$ 

(the version is actually 0.8.0)

@myrrc
Copy link

myrrc commented Feb 5, 2024

I can confirm that binary taken from https://github.com/MichaelMure/git-bug/releases/tag/v0.8.0 fails to push or pull with error

~/src/nfmd/nfmd-0.0 git bug push
Error: ssh: handshake failed: ssh: disconnect, reason 2: Too many authentication failures

Binary built from this tag works perfectly.

~/src/nfmd/nfmd-0.0 uname -a
Linux i108586084 5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
~/src/nfmd/nfmd-0.0 cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"

@mcepl
Copy link
Contributor

mcepl commented Feb 5, 2024

Binary built from this tag works perfectly.

Which tag?

@myrrc
Copy link

myrrc commented Feb 5, 2024 via email

@mcepl
Copy link
Contributor

mcepl commented Feb 5, 2024 via email

@isosphere
Copy link

I had a similar problem.

My issues were:

  1. On one machine I was configured to use HTTP rather than SSH for the remote
  2. I expected git bug to use my existing .ssh/config that git was using - it doesn't

The solution to the first was to change the url with git remote set-url, and the solution to the latter was to add the authentication key I use via ssh-key add. This works on Windows these days, you just have to enable the ssh agent service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants