2

I'm currently working with Git LFS and Gerrit. Everying seems to be fine, till I try to push LFS files to the gerrit server. I got the following error:

LFS: Put http://<localhost>:3001/plugins/lfs/content/default/2133123fd: dial tcp <localhost>:3001: connect: connection refused error: failed to push some refs to 'http://<user>@<localhost>:3001/lfs'

I have try a lot of configurations and I don't really know what is causing this problem.

These are my configurations.

GERRIT AND LFS

cat $gerrit_path/etc/gerrit.config

[auth]
    type = development_become_any_account
    gitBasicAuthPolicy = HTTP
[lfs]
        plugin = lfs

cat $gerrit_path/etc/lfs.config

[storage]
    backend = fs
[fs]
        directory = /home/<user>/workspace/gerrit_2.15.6

LOCAL PROJECT

cat .git/config

[lfs]
        access = basic
        locksverify = false
        url = http://<user>:<password>@<localhost>:3001/lfs/info/lfs

[filter "lfs"]
        clean = git-lfs clean -- %f
        smudge = git-lfs smudge -- %f
        process = git-lfs filter-process
        required = true

cat .gitattributes

*.tar filter=lfs diff=lfs merge=lfs -text

The gerrit I'm using is not on production, I'm just making some testing to see the implantation (so basically gerrit has the default configurations). I have already tested the HTTP connection and the SSH. I can push and pull normal files with both of these. The problem comes when I try to push LFS files.

I think the problem could be the local git-lfs extension, because if I do git lfs uninstall on the local project, the push goes through, but the object isn't really upload to the gerrit server (just the reference).

Thank you so much!

Extra data:

Gerrit version: 2.15.6

Git LFS extension version: git-lfs/2.10.0 (GitHub; linux amd64; go 1.13.4)

Gerrit LFS plugin: 2.15

Also did the following configuration on All-project on gerrit: Configure Gerrit with Git LFS examples please

  • Looking at "url = http://:@:3001/lfs/info/lfs" I assume your repository is named "lfs", is this correct? – Marcelo Ávila de Oliveira Mar 20 '20 at 00:59
  • yes, it is correct – Alan Oliver Mar 20 '20 at 02:02
  • Have you modified that error and the configuration you posted in anyway from what's actually written in console? Have you restarted gerrit after adding the LFS plugin and configuration? – fredrik Mar 20 '20 at 07:24
  • The only thing I edited from the error are the parameters between "< >". and Yes I restarted the gerrit server after doing all this process. – Alan Oliver Mar 20 '20 at 15:39
  • I have read something about the "git-lfs-authenticate". They suggest to run this command **ssh @ git-lfs-authenticate lfs_project.git** But if I try to run the command I got the error **bash: git-lfs-authenticate: command not found** . I don't know if this could be the problem – Alan Oliver Mar 20 '20 at 15:47
  • Another note, when I installed gerrit with the command **java -jar gerrit-2.15.6.war init --batch -d ~/gerrit_example** . I didn't use the default folder for it's installation, instead I used another one with the "-d". I'm not sure if this got something to do with the problem before. – Alan Oliver Mar 20 '20 at 15:52
  • In my /.git/config file I have: [lfs "https://USER@GERRIT-SERVER/REPOSITORY.git/info/lfs"] access = basic. A little bit different that yours. – Marcelo Ávila de Oliveira Mar 21 '20 at 19:17
  • It shows the same error than before. Just tells me to add locksveryfy = false. besides that, is the same output message. "Remote "origin" does not support the LFS locking API. Consider disabling it with: $ git config lfs.https://localhost/zip_lfs.git/info/lfs.locksverify false" – Alan Oliver Mar 23 '20 at 15:43
  • Do you have httpS protocol configured in your gerrit server? Maybe, this could be the problem. – Alan Oliver Mar 23 '20 at 15:45
  • Do you have an answser fix of this? – B.Kingsun Nov 04 '21 at 02:18

0 Answers0