Problem with git lfs, cant upload files

Hello!

I am currently evaluating if a can replace my gitea+jenkins setup with gitlab but I am struggling with git push my code to gitlab. I run gitlab with docker-compose behind a nginx reverse proxy. The compose setup looks like:

services:
  app:
    image: 'gitlab/gitlab-ce:latest'
    restart: always
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'https://gitlab.<URL>'
        gitlab_rails['gitlab_shell_ssh_port'] = 2224
        gitlab_rails['lfs_enabled'] = true
        letsencrypt['enable'] = false
        nginx['ssl_certificate'] = "/etc/gitlab/ssl/cert.pem"
        nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/privkey.key"
    ports:
      - '8928:80'
      - '8929:443'
      - '2224:22'
    volumes:
      - '/data/gitlab/config:/etc/gitlab'
      - '/data/gitlab/logs:/var/log/gitlab'
      - '/data/gitlab/data:/var/opt/gitlab'
    shm_size: '256m'

I could create a login and log onto gitlab in this case everything’s fine. Now I create a new project and locally I copy Kotlin code with gradle inside the folder an do the git init.

cd project
git init --initial-branch=main
git remote add origin ssh://git@gitlab.<URL>:2224/org/project.git
git add .
git commit -m "Initial commit"
git push -u origin main

The push command fails with this error:

Locking support detected on remote "origin". Consider enabling it with:
  $ git config lfs.https://gitlab.<URL>/org/project.git/info/lfs.locksverify true
LFS upload failed:cts:   0% (0/2), 0 B | 0 B/s                                                                                                                                                                       
  (missing) gradle/wrapper/gradle-wrapper.jar (33ad4583fd7ee156f533778736fa1b4940bd83b433934d1cc4e9f608e99a6a89)
  (missing) src/main/resources/static/favicon.ico (8878283e783a91df881c34eabed06242b8288625403a016ac1299729a9798e2c)
hint: Your push was rejected due to missing or corrupt local objects.
hint: You can disable this check with: 'git config lfs.allowincompletepush true'
error: failed to push some refs to 'ssh://gitlab.<URL>:2224/org/project.git'

I searched the web for hints what could this caused. Some others have problems after restarting gitlab and missing lfs files but this is an init setup. So I am not able to push git lfs files and I don’t know why.

What I tried so far?

  • All the git fetch and git lfs fetch commands (but if I cannot push something what should it fetch?)
  • Removed lfs files and git push without them. It works but… yeah… I kinda need otherfiles in my repository
  • git lfs install, git lfs track "*.jar", git lfs push --force and so on
  • gitlab_rails['lfs_enabled'] = false but then I ran into another error during build phase that git lfs is not enabled I should contact my administrator
  • git config lfs.https://gitlab.<URL>/org/project.git/info/lfs.locksverify true
  • use https instead of ssh

Nothing works. If I enable GIT_TRACE=1 I get another error message:

11:32:38.467426 trace git-lfs: attempting pure SSH protocol connection
11:32:38.467456 trace git-lfs: run_command: ssh -p 2224 -- git@gitlab.<URL> git-lfs-transfer /org/project.git upload
11:32:38.467534 trace git-lfs: exec: ssh '-p' '2224' '--' 'git@gitlab.<URL>' 'git-lfs-transfer /org/project.git upload'
11:32:38.747133 trace git-lfs: pure SSH protocol connection failed: Unable to negotiate version with remote side (unable to read capabilities): EOF

Maybe someone with more git/gitlab knowledge could help me?

Best regards,
parsi

1 Like