git-lfs / git-lfs

Git extension for versioning large files
https://git-lfs.com
Other
12.64k stars 2.01k forks source link

pure SSH protocol connection failed: Unable to negotiate version with remote side (unable to read capabilities): EOF #5794

Open gstjee opened 3 weeks ago

gstjee commented 3 weeks ago

I have tried various solutions like verifing ssh keys etc for last 1 week but no luck :( I am trying to push and mirror also both are failing for same reason below.

Executed: GIT_TRACE=1 git push --mirror origin

Traced output: 00:58:44.968623 git.c:460 trace: built-in: git push --mirror origin 00:58:44.968953 run-command.c:654 trace: run_command: GIT_DIR=.git git remote-https origin https://github.com/userx/vendor.git 00:58:44.970791 git.c:749 trace: exec: git-remote-https origin https://github.com/userx/vendor.git 00:58:44.970846 run-command.c:654 trace: run_command: git-remote-https origin https://github.com/userx/vendor.git Username for 'https://github.com': userx Password for 'https://userx@github.com': 00:59:01.276495 run-command.c:654 trace: run_command: .git/hooks/pre-push origin https://github.com/userx/vendor.git 00:59:01.279210 git.c:749 trace: exec: git-lfs pre-push origin https://github.com/userx/vendor.git 00:59:01.279268 run-command.c:654 trace: run_command: git-lfs pre-push origin https://github.com/userx/vendor.git 00:59:01.287622 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'remote' '-v' 00:59:01.290216 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'remote' 00:59:01.292223 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' 00:59:01.294121 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' '--git-dir' '--show-toplevel' 00:59:01.295910 trace git-lfs: exec: git 'config' '--includes' '-l'

00:59:01.298091 trace git-lfs: exec: git 'rev-parse' '--is-bare-repository' 00:59:01.300002 trace git-lfs: exec: git 'config' '--includes' '-l' '-f' '/home/xguru/dts_dubai/proprietary_vendor_motorola_dubai (copy)/.lfsconfig' 00:59:01.301848 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' '--git-dir' 00:59:01.303657 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'remote' 00:59:01.306039 trace git-lfs: attempting pure SSH protocol connection 00:59:01.306056 trace git-lfs: spawning pure SSH connection 00:59:01.306142 trace git-lfs: run_command: ssh -oControlMaster=yes -oControlPath=/run/user/1000/sock-2017358522/lfs.sock git@lfs.undocumented.software git-lfs-transfer /lfs/blobs.git upload 00:59:01.306256 trace git-lfs: exec: ssh '-oControlMaster=yes' '-oControlPath=/run/user/1000/sock-2017358522/lfs.sock' 'git@lfs.undocumented.software' 'git-lfs-transfer /lfs/blobs.git upload' 00:59:08.145326 trace git-lfs: pure SSH connection successful

00:59:08.145344 trace git-lfs: pure SSH protocol connection failed: Unable to negotiate version with remote side (unable to read capabilities): EOF 00:59:08.145729 trace git-lfs: pre-push: refs/heads/lineage-21

Git repo config file: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [lfs] repositoryformatversion = 0 [remote "origin"] url = https://github.com/userx/rr.git fetch = +refs/heads/:refs/remotes/origin/ [http] postBuffer = 52428800 [lfs "https://github.com/userx/rr.git/info/lfs"] access = basic [branch "main"] remote = origin merge = refs/heads/main

bk2204 commented 3 weeks ago

Hey,

I think part of your problem is this: git-lfs-transfer /lfs/blobs.git upload. Unless you have an /lfs/blobs.git path on your remote server, that's going to cause pushes to fail.

There's a patch that improves the error message for the trace output in the main branch, but it hasn't been released yet.

gstjee commented 3 weeks ago

but i tried on another fresh created repo and fresh push also(not any older commits or files) and it is working fine even though remote doesn't have /lfs/blobs.git .

only issue is coming on forked repos with lfs objects. if i try to push local to existing same remote forked repo or if i push/mirror local to new remote then errors comes.

bk2204 commented 3 weeks ago

Are you trying to push these LFS objects to GitHub, or to a different server? It looks like your Git remote is GitHub, but I don't see the remote for your LFS remote. Can you include the output of git lfs env as a code block so we can see where things are supposed to be going?

gstjee commented 3 weeks ago

hi earlier i redacted some account related info from first comment. anyway now including info without any changes:

remote repo(both fresh new & same repo): https://github.com/gstjee/vendor https://github.com/gstjee/proprietary_vendor_motorola_dubai/tree/lineage-21

➜ proprietary_vendor_motorola_dubai git:(lineage-21) git lfs env

git-lfs/3.5.1 (GitHub; linux amd64; go 1.21.7; git e237bb3a)
git version 2.37.2

Endpoint=https://lfs.undocumented.software/lfs/blobs.git/info/lfs (auth=none)
Endpoint (upstream)=https://lfs.undocumented.software/lfs/blobs.git/info/lfs (auth=none)
LocalWorkingDir=/home/uguru/dts_dubai/proprietary_vendor_motorola_dubai
LocalGitDir=/home/uguru/dts_dubai/proprietary_vendor_motorola_dubai/.git
LocalGitStorageDir=/home/uguru/dts_dubai/proprietary_vendor_motorola_dubai/.git
LocalMediaDir=/home/uguru/dts_dubai/proprietary_vendor_motorola_dubai/.git/lfs/objects
LocalReferenceDirs=
TempDir=/home/uguru/dts_dubai/proprietary_vendor_motorola_dubai/.git/lfs/tmp
ConcurrentTransfers=8
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneVerifyUnreachableAlways=false
PruneRemoteName=origin
LfsStorageDir=/home/uguru/dts_dubai/proprietary_vendor_motorola_dubai/.git/lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file,ssh
UploadTransfers=basic,lfs-standalone-file,ssh
GIT_EXEC_PATH=/usr/lib/git-core
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"
bk2204 commented 2 weeks ago

Can you please include the output of git config -l --show-origin as a code block as well? From what I see, I don't see a reason that you should be attempting to use SSH from this output, since the output looks like it should be using HTTPS instead.