0

I have installed gitlab via the repository and configured it to run on an apache server instead of nginx (for simplicity of managing one web server instead of two).

SSL certificates have been installed and configured correctly. I am able to pull and push via HTTPS with no issues. Furthermore, I am able to pull from a project via SSH. The git user is correctly authenticating and being routed to the correct directory for pulling repos. However when I attempt to push I received the following error:

C:\Users\user\sshproject>git push -u origin master -v
Pushing to git@gitlab.domain.com:user/sshproject.git
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 258 bytes | 258.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: GitLab: The project you were looking for could not be found.
To gitlab.domain.com:user/sshproject.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@gitlab.domain.com:user/sshproject.git'

My search on this error almost unequivocally points me to rebase my project on the origin, or double check the destination of the remote origin. And I have attempted to resolve the issue with these solutions to no avail.

I have included a list of the settings I have changed in the gitlab config file here. All other settings are unchanged. Hopefully somebody smarter than me can point me in the right direction.

external_url 'https://gitlab.domain.com'
gitlab_rails['trusted_proxies'] = [ '192.168.2.1/24', '192.168.2.1', '2001:0db8::/32' ]
git_data_dirs({
  "default" => { "path" => "/path/repositories" },
  "alternative" => { "path" => "/mnt/nfs-01/git-data" }
})
gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = "127.0.0.1:8181"
user['home'] = "/path/repositories/repositories"
web_server['external_users'] = ['www-data']
nginx['enable'] = false
  • The error is due to a pre-receive hook... – evolutionxbox May 14 '18 at 08:46
  • Right... I mean it clearly says that in the error reporting. Which is why I am being told to rebase my local repo and try pushing again. This is a fresh project, pulled an empty repo and I am trying to push a README back to the repo. Nothing. – CastleNtheSky May 15 '18 at 23:03
  • Who is telling you to rebase? – evolutionxbox May 15 '18 at 23:55
  • [link]https://stackoverflow.com/questions/7986139/git-error-when-trying-to-push-pre-receive-hook-declined This post suggests rebasing against the server and trying to push again (tried this and it isn't working). [link]https://stackoverflow.com/questions/28318599/git-push-error-pre-receive-hook-declined This post says it's a permissions issue on the repo (I'm master so this isn't the issue). I am confident this is a server setting issue with the gitlab install or a permissions issue on the directory? But I'm totally lost as to why I can clone, but not push... :( – CastleNtheSky May 16 '18 at 01:27

0 Answers0