Git lfs needs password over http if url specified manually

Summary

Using Gitlab CE Omnibus, configuring LFS to use http instead of https (see https://docs.gitlab.com/ce/workflow/lfs/manage_large_binaries_with_git_lfs.html#getsockopt-connection-refused) is no longer necessary, and doing so causes git-lfs-authenticate to not be used.

Steps to reproduce

  1. Have a Gitlab CE Omnibus server accessible through SSH and HTTP.
  2. Create a new empty public repository, either in a group or for a user.
  3. Clone that repository locally over ssh.
  4. Initialise git-lfs in the repository (git-lfs install).
  5. Track *.bin with git lfs (git lfs track "*.bin")
  6. Set the lfs url to use http as at https://docs.gitlab.com/ce/workflow/lfs/manage_large_binaries_with_git_lfs.html#getsockopt-connection-refused (git config --add lfs.url "<url of project.git over http>/info/lfs")
  7. Create a test .bin file using dd if=/dev/urandom of=testfile.bin bs=1M count=10.
  8. Add and commit and push all changes.

Example Project

I don't think gitlab.com exposes http endpoints, and the issue is client-side. Any project that supports LFS and git-lfs-authenticate should work.

What is the current bug behavior?

Git prompts for a username/password for basic auth on the http endpoint.

What is the expected correct behavior?

Documentation should not instruct that step 6 is required (https://docs.gitlab.com/ce/workflow/lfs/manage_large_binaries_with_git_lfs.html#known-limitations states it always assumes https). Omitting step 6 above works and does not prompt for credentials.

Results of GitLab environment info

Expand for output related to GitLab environment info

System information System: Current User: git Using RVM: no Ruby Version: 2.3.5p376 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.3.0 Redis Version: 3.2.11 Git Version: 2.14.3 Sidekiq Version:5.0.4 Go Version: unknown

GitLab information Version: 10.3.3 Revision: 888cf31 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://[domain].co.uk HTTP Clone URL: http://[domain].co.uk/some-group/some-project.git SSH Clone URL: git@.scisys.co.uk:some-group/some-project.git Using LDAP: yes Using Omniauth: no

GitLab Shell Version: 5.10.2 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check

Checking GitLab Shell ...

GitLab Shell version >= 5.10.2 ? ... OK (5.10.2) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 1/1 ... ok 1/2 ... ok 1/3 ... ok 36/5 ... ok 7/7 ... ok 1/8 ... ok 7/9 ... ok 7/10 ... ok 7/11 ... ok 7/12 ... ok 7/13 ... ok 7/14 ... ok 12/15 ... ok 1/16 ... ok 12/17 ... ok 1/18 ... ok 4/19 ... ok 12/20 ... ok 5/21 ... ok 35/22 ... ok 35/24 ... ok 29/25 ... ok 29/26 ... ok 30/27 ... ok 30/28 ... ok 30/29 ... ok 29/30 ... ok 37/31 ... ok 37/32 ... ok 7/33 ... ok 16/34 ... repository is empty 7/35 ... ok 35/36 ... ok 36/40 ... ok 37/41 ... ok 37/42 ... ok 37/43 ... ok 37/44 ... ok 37/46 ... ok 39/49 ... ok 42/50 ... ok 39/51 ... ok 39/52 ... ok 39/53 ... ok 39/54 ... ok 39/55 ... ok 39/56 ... ok 7/57 ... ok 39/58 ... ok 46/59 ... ok 46/60 ... ok 49/62 ... ok 49/63 ... ok 49/64 ... ok 49/65 ... ok 46/68 ... ok 49/69 ... ok 49/70 ... ok 39/71 ... ok 51/72 ... ok 51/73 ... ok 46/74 ... ok 56/76 ... ok 56/77 ... ok 57/78 ... ok 57/79 ... ok 57/80 ... ok 57/81 ... ok 58/82 ... ok 59/84 ... ok 58/86 ... ok 57/89 ... ok 7/90 ... repository is empty

Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Reply by email is disabled in config/gitlab.yml Checking LDAP ...

Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results)

[cut list of users]

Checking LDAP ... Finished

Checking GitLab ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 1/1 ... yes 1/2 ... yes 1/3 ... yes 36/5 ... yes 7/7 ... yes 1/8 ... yes 7/9 ... yes 7/10 ... yes 7/11 ... yes 7/12 ... yes 7/13 ... yes 7/14 ... yes 12/15 ... yes 1/16 ... yes 12/17 ... yes 1/18 ... yes 4/19 ... yes 12/20 ... yes 5/21 ... yes 35/22 ... yes 35/24 ... yes 29/25 ... yes 29/26 ... yes 30/27 ... yes 30/28 ... yes 30/29 ... yes 29/30 ... yes 37/31 ... yes 37/32 ... yes 7/33 ... yes 16/34 ... yes 7/35 ... yes 35/36 ... yes 36/40 ... yes 37/41 ... yes 37/42 ... yes 37/43 ... yes 37/44 ... yes 37/46 ... yes 39/49 ... yes 42/50 ... yes 39/51 ... yes 39/52 ... yes 39/53 ... yes 39/54 ... yes 39/55 ... yes 39/56 ... yes 7/57 ... yes 39/58 ... yes 46/59 ... yes 46/60 ... yes 49/62 ... yes 49/63 ... yes 49/64 ... yes 49/65 ... yes 46/68 ... yes 49/69 ... yes 49/70 ... yes 39/71 ... yes 51/72 ... yes 51/73 ... yes 46/74 ... yes 56/76 ... yes 56/77 ... yes 57/78 ... yes 57/79 ... yes 57/80 ... yes 57/81 ... yes 58/82 ... yes 59/84 ... yes 58/86 ... yes 57/89 ... yes 7/90 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.3.5) Git version >= 2.7.3 ? ... yes (2.14.3) Git user has default SSH configuration? ... yes Active users: ... 40

Checking GitLab ... Finished

Possible fixes

Update the documentation so that setting the http url is not implied to be required for all instances. Leave it in troubleshooting.

Assignee Loading
Time tracking Loading