6

I've setup my gitlab installation from source, secured it with letsencrypt and deployed it under https://gitlab.mydomain.com. I can access the website and create repositories, etc. but I can't find a way to register a gitlab ci runner for the installation.

Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/ci):
https://gitlab.mydomain.com/ci
Please enter the gitlab-ci token for this runner:
xxxxxxxx-xxxxxxxx
Please enter the gitlab-ci description for this runner:
[server]: test
Please enter the gitlab-ci tags for this runner (comma separated):
test
ERROR: Registering runner... failed     runner=xxxxxxx 
status=couldn't execute POST against https://gitlab.mydomain.com/ci/api/v1/runners/register.json:
Post https://gitlab.mydomain.com/ci/api/v1/runners/register.json: 
read tcp [ipv6address]:33518->[ipv6address]:443: read: connection reset by peer
PANIC: Failed to register this runner. Perhaps you are having network problems

My gitlab system is working fine and I really ran out of explanations why there would be a connection reset by peer. When I try to curl the address from the error message directly, it returns a correct response.

curl -v https://gitlab.mydomain.com/ci/api/v1/runners/register.json
*   Trying ipv6address...
* Connected to gitlab.mydomain.com (ipv6address) port 443 (#0)
* found 174 certificates in /etc/ssl/certs/ca-certificates.crt
* found 700 certificates in /etc/ssl/certs
* ALPN, offering h2
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_256_GCM_SHA384
*        server certificate verification OK
*        server certificate status verification SKIPPED
*        common name: mydomain.com (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #3
*        subject: CN=mydomain.com
*        start date: Wed, 18 May 2016 14:35:00 GMT
*        expire date: Tue, 16 Aug 2016 14:35:00 GMT
*            issuer: C=US,O=Let's Encrypt,CN=Let's Encrypt Authority X3
*        compression: NULL
* ALPN, server did not agree to a protocol
> GET /ci/api/v1/runners/register.json HTTP/1.1
> Host: gitlab.mydomain.com
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 405 Method Not Allowed
< Server: nginx
< Date: Sun, 29 May 2016 09:14:09 GMT
< Content-Type: application/json
< Content-Length: 2
< Connection: keep-alive
< Allow: OPTIONS, POST
< Cache-Control: no-cache
< Status: 405 Method Not Allowed
4
  • Could you post your runner config? Commented May 29, 2016 at 17:33
  • @HuiWang - It only has 1 line concurrent = 1. I assume this is because the process of creating a config fails with the above error. Commented May 29, 2016 at 18:35
  • Please have a look at this link gitlab.com/wiget/gitlab-ci-multi-runner/blob/master/docs/… Commented May 29, 2016 at 19:03
  • @HuiWang - I don't understand which certificate from letsencrypt I have to store at the requested location. I tried with copying my fullchain.pem to /etc/gitlab-runner/gitlab.mydomain.com.crt but the error still occurs. When I use --debug it says Trying to load /etc/gitlab-runner/certs/gitlab.mydomain.com.crt ... but nothing more. Commented May 31, 2016 at 14:32

5 Answers 5

2

If the runner and gitlab are running on the same host you can get around this problem by entering a the first question the following instead what is given in the docs:

http://gitlab:port

where gitlab is the container name and port the left port number of the container. If you are using gitlab internal ssl certs you specify https instead of http. This always solves this problem when I get it.

Sign up to request clarification or add additional context in comments.

Comments

1

For those that are using docker:

The issue its about docker network.

If you try

  "$docker container inspect $id"

You are going to see the IPAddress of gitlab container.

Point to that ip adress on first question to works fine.

Comments

0

Problem went away after updating gitlab to 8.8.3 and gitlab-multi-ci-runner to the most recent version.

I also started my gitlab nginx configuration files from scratch.

In the end, I can't tell which change exactly solved the problem.

Comments

0

I had so far many errors and issue starting with Error 404, 403 and endings with problem with post request.

For me, problem seems to be incompatibility between GitLab and ci-runner.

Solution, same on post issue, was install older version of ci-runner:

sudo apt install gitlab-ci-multi-runner=1.11.1

2 Comments

I tried but it doesn't work for me still getting error ERROR: Registering runner... failed runner=pcT3WTf5 status=couldn't execute POST against http://gitlab.com/api/v4/runners: Post https://gitlab.com:443/api/v4/runners: x509: certificate signed by unknown authority PANIC: Failed to register this runner. Perhaps you are having network problems
In your case it looks like HTTPS and certificate issue. Use some trusted authority (like Lets encrypt) or manually add CA you used for sign the certificate as trusted. This should be helpful docs.gitlab.com/runner/configuration/tls-self-signed.html
0

I've solved it by installing gitlab-ci-multi-runner=1.11.1.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.