Skip to content

git lfs locks returns not found when using ssh authentication #3984

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

Closed
2 of 7 tasks
5im-0n opened this issue May 17, 2018 · 4 comments
Closed
2 of 7 tasks

git lfs locks returns not found when using ssh authentication #3984

5im-0n opened this issue May 17, 2018 · 4 comments

Comments

@5im-0n
Copy link

5im-0n commented May 17, 2018

  • Gitea version (or commit ref): 1.4.1
  • Git version: git version 2.17.0.windows.1
  • Operating system: git client is on Windows 7 Enterprise 64 bit, gitea server on ubuntu linux 16.04.4
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
  • Log gist:
C:\Temp\l>git lfs lock Fly.jpg                                                                                                                                                    
14:10:03.364146 git.c:576               trace: exec: git-lfs lock Fly.jpg                                                                                                         
14:10:03.364146 run-command.c:640       trace: run_command: git-lfs lock Fly.jpg                                                                                                  
14:10:03.458146 trace git-lfs: exec: git 'version'                                                                                                                                
14:10:03.567146 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'                                                                                                                                                            
14:10:03.596146 trace git-lfs: exec: git 'config' '-l'                                                                                                                            
14:10:03.620146 trace git-lfs: HTTP: POST https://try.gitea.io/S2-/test.git/info/lfs/locks                                                                                        
14:10:04.168146 trace git-lfs: HTTP: 404                                                                                                                                          
Lock failed: Repository or object not found: https://try.gitea.io/S2-/test.git/info/lfs/locks                                                                                     
Check that it exists and that you have proper access to it                                                                                                                        
                                                                                                                                                                                  
C:\Temp\l>git lfs locks                                                                                                                                                           
14:10:52.084146 git.c:576               trace: exec: git-lfs locks                                                                                                                
14:10:52.085146 run-command.c:640       trace: run_command: git-lfs locks                                                                                                         
14:10:52.184146 trace git-lfs: exec: git 'version'                                                                                                                                
14:10:52.198146 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'                                                                                                                                                            
14:10:52.305146 trace git-lfs: exec: git 'config' '-l'                                                                                                                            
14:10:52.329146 trace git-lfs: HTTP: GET https://try.gitea.io/S2-/test.git/info/lfs/locks                                                                                         
14:10:52.856146 trace git-lfs: HTTP: 404                                                                                                                                          
Error while retrieving locks: Repository or object not found: https://try.gitea.io/S2-/test.git/info/lfs/locks?refspec=refs%2Fheads%2Fmaster                                      
Check that it exists and that you have proper access to it                                                                                                                        
                                                                                                                                                                                  
C:\Temp\l>git lfs ls-files                                                                                                                                                        
14:10:57.664146 git.c:576               trace: exec: git-lfs ls-files                                                                                                             
14:10:57.665146 run-command.c:640       trace: run_command: git-lfs ls-files                                                                                                      
14:10:57.767146 trace git-lfs: exec: git 'version'                                                                                                                                
14:10:57.875146 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'                                                                                                                                                            
14:10:57.891146 trace git-lfs: exec: git 'config' '-l'                                                                                                                            
14:10:57.912146 trace git-lfs: run_command: git cat-file --batch                                                                                                                  
14:10:57.934146 trace git-lfs: run_command: git cat-file --batch                                                                                                                  
14:10:57.944146 trace git-lfs: filepathfilter: rejecting ".gitattributes" via []                                                                                                  
14:10:57.944146 trace git-lfs: filepathfilter: accepting ".gitattributes"                                                                                                         
14:10:57.944146 trace git-lfs: filepathfilter: rejecting "3137588.png" via []                                                                                                     
14:10:57.944146 trace git-lfs: filepathfilter: accepting "3137588.png"                                                                                                            
14:10:57.945146 trace git-lfs: filepathfilter: rejecting "Fly.jpg" via []                                                                                                         
14:10:57.945146 trace git-lfs: filepathfilter: accepting "Fly.jpg"                                                                                                                
49726dca8c * 3137588.png                                                                                                                                                          
a553cfb03b * Fly.jpg                                                                              

Description

git lock returns

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

and an http status 404 is returned.

@5im-0n
Copy link
Author

5im-0n commented May 17, 2018

I just tried to install gitea for windows, and could not reproduce the problem there.
On a fresh install on ubuntu the problem persists.
Maybe this has something to do about how git for windows handles lfs?

client/server combo git lfs locks returns 404
windows git client -> gitea on linux yes (broken)
windows git client -> gitea on windows no (works)

@5im-0n
Copy link
Author

5im-0n commented May 17, 2018

Just had the chance to download and run a fresh install of gitea and everything works from linux to linux as well.
Just the version I upgraded from gogs -> first gitea version -> all intermediate versions -> 1.4.1 does not work and returns a 404 on a git lfs locks. git push with lfs files works.

I had a look at the sqlite3 db to see if the lfs_lock table was maybe missing, but it's there:

sqlite> .dump lfs_lock
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE `lfs_lock` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `repo_id` INTEGER NOT NULL, `owner_id` INTEGER NOT NULL, `path` TEXT NULL, `created` DATETIME NULL);
CREATE INDEX `IDX_lfs_lock_repo_id` ON `lfs_lock` (`repo_id`);
CREATE INDEX `IDX_lfs_lock_owner_id` ON `lfs_lock` (`owner_id`);
COMMIT;
sqlite> 

Can I enable lfs lock somehow without loosing al configs that are in the db?

@5im-0n 5im-0n changed the title git lfs lock returns not found git lfs locks returns not found when using ssh authentication May 17, 2018
@5im-0n
Copy link
Author

5im-0n commented May 17, 2018

Sorry for all the spam. I think I got it now: the git lfs locks was not working because the repo was set to private. I tried to make it public and git lfs locks started working.
So the problem is: when using ssh auth, git lfs locks returns 404.

@techknowlogick
Copy link
Member

Closing this so we can track SSH/LFS in this ticket #2475

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants