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

Git LFS Lock: credential issue when using SSH #3084

Closed
2 of 7 tasks
flozz opened this issue Dec 4, 2017 · 11 comments · Fixed by #3152 or #6999
Closed
2 of 7 tasks

Git LFS Lock: credential issue when using SSH #3084

flozz opened this issue Dec 4, 2017 · 11 comments · Fixed by #3152 or #6999
Labels
Milestone

Comments

@flozz
Copy link

flozz commented Dec 4, 2017

Description

Hello,

I am testing the new git LFS lock feature and I have some issues.

When I try it on my own machine and server, I have the following error:

$ git push
Username for 'http://localhost:3000': test
Password for 'http://test@localhost:3000': 
WARNING: Authentication error: Authentication required: You must have push access to verify locks : User undefined doesn't have rigth to verify for lfs lock [rid: 1]
[...]

$ git lfs locks
Error while retrieving locks: You must have pull access to list locks : User undefined doesn't have rigth to list for lfs lock [rid: 1]

When I try on try.gitea.io, I have no error on push but I cannot get lock info:

$ git lfs lock foo.yy 
Lock failed: Repository or object not found: https://try.gitea.io/testzzx464c/lfs-lock-test.git/info/lfs/locks
Check that it exists and that you have proper access to it

I am probably doing it wrong, if someone can tell me where... :)

cc @sapk

@lunny
Copy link
Member

lunny commented Dec 4, 2017

It seems login failed since WARNING: Authentication error: Authentication required: You must have push access to verify locks : User undefined doesn't have rigth to verify for lfs lock [rid: 1] .

@sapk
Copy link
Member

sapk commented Dec 4, 2017

@flozz you need to setup auth in git to keep your credentials. I don't know why git doesn't ask for them like any other git command.

@sapk
Copy link
Member

sapk commented Dec 4, 2017

I should also look again at git-lfs-authenticate in case of locks but if lfs blob are working locks should also.

@sapk
Copy link
Member

sapk commented Dec 4, 2017

Looking further more at it, I may need change some code in git-lfs-authenticate for it to work for locks.

For information:
https://github.com/git-lfs/git-lfs/blob/master/docs/api/authentication.md
https://github.com/go-gitea/gitea/blob/master/cmd/serv.go#L174

@flozz
Copy link
Author

flozz commented Dec 4, 2017

When I setup the credentials it still not working:

content of my .git/configfile:

[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[remote "origin"]
	url = http://localhost:3000/test/test.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master
[gitg]
	mainline = refs/heads/master
[credential "http://localhost:3000"]
	username = test

when I try to get locks:

$ git lfs locks
Error while retrieving locks: You must have pull access to list locks : User undefined doesn't have rigth to list for lfs lock [rid: 1]

Logs from gitea:

[Macaron] 2017-12-04 17:46:27: Completed GET /test/test.git/info/lfs/locks 403 Forbidden in 11.010905ms

@sapk
Copy link
Member

sapk commented Dec 4, 2017

Only operation in https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md (download or upload) should be receive by git-lfs-authenticate https://github.com/git-lfs/git-lfs/blob/master/docs/api/server-discovery.md#ssh so I will try to look what git client try to do.
In the meantime you can test it but configuring credentials like in https://github.com/git-lfs/git-lfs/blob/master/docs/api/authentication.md

@flozz
Copy link
Author

flozz commented Dec 4, 2017

ok, i will try this tomorrow, thank you :)

@sapk
Copy link
Member

sapk commented Dec 4, 2017

If not working, please add env variable GIT_TRACE=1 and GIT_CURL_VERBOSE=1 to running command we may see what happen under the hood.

@flozz
Copy link
Author

flozz commented Dec 5, 2017

Ok, it works if I put both login and password in the repository url:

[remote "origin"]
	url = http://test:test@localhost:3000/test/test.git
	fetch = +refs/heads/*:refs/remotes/origin/*

@flozz
Copy link
Author

flozz commented Dec 11, 2017

The lock feature itself work, but I still have an issue with credentials:

When I use ssh uri:

$ git lfs locks
Error while retrieving locks: You must have pull access to list locks : User undefined doesn't have rigth to list for lfs lock [rid: 5]

When I use http URI, I am prompted for my username and password (so it works):

$ git lfs locks
Username for 'http://git2.foo.bar': XXX
Password for 'http://[email protected]':

Other Git LFS feature have no auth issue

@flozz flozz changed the title I am unable to get Git LFS Lock working Git LFS Lock: credential issue when using SSH Dec 11, 2017
@sapk
Copy link
Member

sapk commented Dec 11, 2017

I confirm that the token methods via ssh that should work like other lfs is not working. I will need to test more what differ since it is the same methods request (upload, ...).

@lafriks lafriks added this to the 1.4.0 milestone Jan 27, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
project-mirrors-bot-tu bot pushed a commit to project-mirrors/forgejo-as-gitea-fork that referenced this issue Jan 23, 2025
- Adjust the warning and success text to be more representive (make them
more green and yellow). They still confirm to AAA contrast.
- For important, note and caution callout boxes make use of the light
variants for the colors colors rather than the dark variant.
- Resolves go-gitea#3084

(cherry picked from commit 515ccaa)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants