Couldn't execute POST against gitlab server getsockopt: connection refused
Summary
gitlab-ci-multi-runner register
doesn't seem to play nice with nginx proxy in front of gitlab server.
This could likely be a problem with my convoluted setup, rather than being an issue with anything Gitlab. However, I've looked for hours and hours on Google, Github/lab issues, Stackoverflow, and can't find anything that's helped. I figured maybe it could be something about my setup that just makes gitlab crap the bed. Or I'm just doing something stupid. Either way, I hope to get this solved.
Steps to reproduce
I'm trying to run this on the same machine.
sudo gitlab-ci-multi-runner register
https://gitlab.example.com
[token]
general
[nothing]
false
I get the error here.
Actual behavior
Failure of registration for the runner with strange error results.
couldn't execute POST against https://gitlab.example.com/api/v4/runners: dial tcp 192.168.1.53:443: getsockopt: connection refused
This is odd because it shouldn't (as far as I'm concerned) be requesting 192.168.1.53 (the gitlab server) on port 443 because the gitlab server doesn't listen on port 443, the nginx proxy does.
I'm also getting an error telling me that gitlab runner >9.0 is only compatible with gitlab CE >9.0, but that also gives a POST request error, on api/v4/runners/verify
, so I'm assuming it's part of this issue.
Expected behavior
As far as I know, gitlab runner shouldn't be sending a POST request to 192.168.1.53
directly, it should be sending it to 192.168.1.50
on port 443, which will then proxy everything to the gitlab server running on port 80.
Relevant logs and/or screenshots
ERROR: Checking GitLab compatibility... not-compatible reason=GitLab Runner >= 9.0 can be used ONLY with GitLab CE/EE >= 9.0 result=-1 runner=[part of token] statusText=couldn't execute POST against https://gitlab.example.com/api/v4/runners/verify: Post https://gitlab.example.com/api/v4/runners/verify: dial tcp 192.168.1.53:443: getsockopt: connection refused
PANIC: Failed to register this runner. Perhaps you are having network problems ```
## Environment description
I don't know if this all of the information provided here is relevant, or if I even provided enough useful information. Everything that I did provided, I provided as is (apart from redacting domain name, and some commented out config options).
### Software versions
Gitlab Server:
OS: ``` Centos7 ``` (up to date as of 17:20 4/27/2017 UTC)
Gitlab Runner version: ``` 9.1.0 (built Fri, 21 Apr 2017 14:32) ```
Gitlab Omnibus version: ``` Gitlab-CE 9.1.1 ``` (using external nginx install)
External Nginx: ``` 1.10.2 ```
Proxy Server:
OS: ``` Ubuntu Server 16.10 ``` (up to date as of 17:20 4/27/2017 UTC)
Nginx version: ``` 1.10.1 ```
### Configuration
External nginx config (runs the gitlab web interface): https://pastebin.com/Tk1BGqR5
/etc/gitlab/gitlab.rb config file: https://pastebin.com/GU8bDqs1 (everything that is commented is is removed, and therefor should be default value. I did however remove my smtp config sections, as it's not relevant)
Proxy nginx config (runs infront of gitlab web interface, separate machine): https://pastebin.com/3e3AXuNJ
(Just as a side, this may be caused because the hostname of the gitlab server is ``` gitlab.example.com ``` in ``` /etc/hostname ```, though if I remember correctly, this is the intended setup?)
### Used GitLab Runner version
``` Version: 9.1.0
Git revision: 0118d89
Git branch: 9-1-stable
GO version: go1.7.5
Built: Fri, 21 Apr 2017 14:32:04 +0000
OS/Arch: linux/amd64 ```