HTTP git functionality unavailable after the upgrade
After upgrade from 10.x to 11.2.3 my users cannot clone via HTTP. SSH transport works just fine. When using HTTP git client says
[emz@anthe ~]$ git clone http://server.name/namespace/repo.git test
Cloning into 'test'...
Username for 'http://server.name': user
Password for 'http://user@server.name':
fatal: repository 'http://server.name/namespace/repo.git/' not found
The most discouraging thing is that none of the logs mention any errors. The links like https://server.name/namespace/repo.git/info/refs?service=git-upload-pack or https://server.name/namespace/repo.git/info/refs?service=git-upload-pack clearly don't work, they show "Not Found" message and 404 status, but the production log think they were rendered without error:
Started GET "/namespace/repo.git/info/refs?service=git-upload-pack" for 168.63.101.55 at 2018-09-10 21:51:27 +0500
Processing by Projects::GitHttpController#info_refs as HTML
Parameters: {"service"=>"git-upload-pack", "namespace_id"=>"namespace", "project_id"=>"repo.git"}
Completed 200 OK in 458ms (Views: 0.5ms | ActiveRecord: 14.3ms)
Completed 200 OK in 357ms (Views: 1.3ms | ActiveRecord: 37.9ms)
I have checked all the paths - gitlab-shell, gitaly, repositories path and they seem to be okay. I've checked that /home prefix in the configuration files is changed to /usr/home because I'm running gitlab on FreeBSD (and /home is a symlink). So at this point I'm pretty much stuck. This installation used to work while running 10.2.x, so this clearly has something to do with the upgrade (which, to my opinion, went without errors).
Could someone point me at the right direction, because at this time I have read tonnes of similar reports, but the solutions mentioned don't work for me. It would be much easier if there were at least some errors in the logs, but unfortunately there's none.
#### Results of GitLab environment info
<details>
<summary>Expand for output related to GitLab environment info</summary>
<pre>
$ bundle exec rake gitlab:env:info RAILS_ENV=production
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.4.4p296
Gem Version: 2.7.7
Bundler Version:1.16.4
Rake Version: 12.3.1
Redis Version: 4.0.11
Git Version: 2.18.0
Sidekiq Version:5.2.1
Go Version: go1.11 freebsd/amd64
GitLab information
Version: 11.2.3
Revision: Unknown
Directory: /usr/local/www/gitlab-ce
DB Adapter: mysql2
URL: http://XXXXXXXXXXXXXXX.net
HTTP Clone URL: http://XXXXXXXXXXXXXXX.net/some-group/some-project.git
SSH Clone URL: git@XXXXXXXXXXXXXXX.net:some-group/some-project.git
Using LDAP: yes
Using Omniauth: no
GitLab Shell
Version: 8.1.1
Repository storage paths:
- default: /usr/home/git/repositories
Hooks: /usr/local/share/gitlab-shell/hooks
Git: /usr/local/bin/git
</details>
#### Results of GitLab application Check
<details>
<summary>Expand for output related to the GitLab application check</summary>
<pre>
$ bundle exec rake gitlab:check RAILS_ENV=production
Checking GitLab Shell ...
GitLab Shell version >= 8.1.1 ? ... OK (8.1.1)
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: ...
[... repositories are ok with two empty ones, I'm afraid I cannot disclose this info 'cause I'm under NDA ...]
Running /usr/local/share/gitlab-shell/bin/check
Check GitLab API access: OK
Redis available via internal API: OK
Access to /usr/home/git/.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)
DN: cn=ХХХ,ou=users,dc=XXXX,dc=XXXX uid: XXX
[... same story with LDAP usernames and CNs ...]
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? ... skipped (no tmp uploads folder yet)
Init script exists? ... no
Try fixing it:
Install the init script
For more information see:
doc/install/installation.md in section "Install Init Script"
Please fix the error above and rerun the checks.
Init script up-to-date? ... can't check because of previous errors
Projects have namespace: ...
[... namespaces check also went okay ...]
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.5 ? ... yes (2.4.4)
Git version >= 2.9.5 ? ... yes (2.18.0)
Git user has default SSH configuration? ... no
Try fixing it:
mkdir ~/gitlab-check-backup-1536660944
sudo mv /usr/local/git/.ssh/dev_id_dsa ~/gitlab-check-backup-1536660944
sudo mv /usr/local/git/.ssh/id_dsa ~/gitlab-check-backup-1536660944
sudo mv /usr/local/git/.ssh/authorized_keys\~ ~/gitlab-check-backup-1536660944
sudo mv /usr/local/git/.ssh/id_dsa.pub ~/gitlab-check-backup-1536660944
sudo mv /usr/local/git/.ssh/svn_id_dsa ~/gitlab-check-backup-1536660944
sudo mv /usr/local/git/.ssh/known_hosts.old ~/gitlab-check-backup-1536660944
For more information see:
doc/ssh/README.md in section "SSH on the GitLab server"
Please fix the error above and rerun the checks.
Active users: ... 160
Checking GitLab ... Finished
</details>
<br/>
I understand that gitlab thinks something is wrong with ~/.ssh directory of the git user itself, but I have the strong impression that the proposed measures will wipe out clean the SSH keys structures and all the users will lose their installed keys. So I decided not to fix this. Furthermore, SSH remains now the only functioning transport, so looks like this is a false positive(?).
issue