I got the same problem. Platform: Windows Server 2008 R2 (x64)
Sometimes happens, press "retry" maybe works.
gitlab-ci-multi-runner 1.1.4 (9e2fd1a)Using Shell executor...Running on CX-TECH...Fetching changes...HEAD is now at 14f0e2d XXXXXXXXfatal: unable to access 'https://gitlab-ci-token:xxxxxx@xxxxxx.com/xxx/xxxxxx.git/': SSL certificate problem: unable to get issuer certificateERROR: Build failed: exit status 1
@maxraab Not yet. We have several issues that are pointing us to this problem - different versions, different platforms, different settings. I need to find a way to reproduce it on my local machine (or any other machine). Then I can look for a reasons and for solutions.
@ayufan I know this isn't a good solution but currently we have about 200 builds a day and approximate 30 build fails with the named error.
All runners are installed on normal Win7 machines (no Windows Server). My config.toml contains the tls-ca-file entry with path to the GitLabCA.ctr.
I tested the SSL url, the HTTPS url and the runner url (and replaced the xxxxx through the access token).
Even when I go to /builds/* subdirectory, where the runner store it's builds, I can not git pullon one of these repos.
Browser will show green, because it caches intermedate certificates. The best to test this is curl, git clone and openssl. You need to make sure that you certificate chain has all intermediates to resolve trust of your certificate up to root CA.
@ayufan Ah, ok! Now I downloaded the intermediate and the root certificate, put them together in domain.crt and updated /etc/gitlab/ssl/.
curl domain aborts with the same problem. I followed these guide.
@ayufan Now I can access my repo via curl, git and browsers without the intermediate cached files. I also can clone the repo via the runner's machines.
The runner has changed his error too:
gitlab-ci-multi-runner 1.3.2 (0323456)Using Shell executor...Running on GITLAB-SRV-07...Fetching changes...HEAD is now at 0099d02 Merge branch 'implements-using-of-reportdesignerworksheetdocument' into 'master'fatal: unable to access 'https://gitlab-ci-token:xxxxxx@domain.tld/group-namespace/repository.git/': SSL certificate problem: unable to get issuer certificateERROR: Build failed: exit status 1
from: "SSL certificate problem: unable to get local issuer certificate" to: "SSL certificate problem: unable to get issuer certificate"
@ayufan The validation with openssl looks good after your configuration help. But the runners still fail approx. every 3. build.
$ openssl s_client -showcerts-connect domain.tld:443CONNECTED(000001AC)---Certificate chain 0 s:/OU=Domain Control Validated/CN=*.domain.tld i:/C=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UHAgEWJmh0dHBzOi8vd3d3Lmdsb2JhbHNpZ24uY29tL3JlcG9zaXRvcnkvMDMGA1UdHwQsMCowKKAmoCSGb3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24xxxxxxxxxxxxxxxxxxxxxMjAxMDAwMTAvMC0GCCsGAQUFBzABhiFodHRwOi8vb2NzcC5nbG9iYWxzaWduLmNvbS9yb290cjEwHwYDVR0jBBgwFoAUYHtmGkUNl8qJUC99BM00qP/8/UswDQYJKoZIhvcNAQELBQADggEBANdFnqDc4ONhWgt9d4QXLWVagpqNoycqhffJ7+mG/dRHzQFSlsVDvTexA1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1JvGwJbxeOJyLS4bx448lYm6UHvPc2smU9ZSlctS32ux4j71pg79eXw6ImJuYsDy1ojH6T9uOr7Lp2uanMJvPzVoLVEgqtEkS5QLlfBQ9iRBIvpES5ftD953x77PzAAi1PjtyxxxxxxxxxxxQRYM68bVeerDL8wBHTk8w4vMDmNSwSMHnVmZkngvkA0x1xaUZK6EjxS1QSCVS1npd+3lXzuP8MIugS+wEY=-----END CERTIFICATE--------Server certificatesubject=/OU=Domain Control Validated/CN=*.domain.tldissuer=/C=BE/O=GlobalSign nv-sa/CN=GlobalSign Domain Validation CA - SHA256 - G2---No client certificate CA names sentPeer signing digest: SHA512Server Temp Key: ECDH, P-256, 256 bits---SSL handshake has read 3139 bytes and written 434 bytes---New, TLSv1/SSLv3, Cipher is ECDHE-RSA-AES256-GCM-SHA384Server public key is 2048 bitSecure Renegotiation IS supportedCompression: NONEExpansion: NONENo ALPN negotiatedSSL-Session: Protocol : TLSv1.2 Cipher : ECDHE-RSA-AES256-GCM-SHA384 Session-ID: 5C5273425D011EBFC52E77CCFBD44D3xxxxxxxxxxxxxxxC7D326DBB385BF7D23 Session-ID-ctx: Master-Key: B6D22D776C806F46808xxxxxxD38F8FB13D5xxxxxxxxxxC96EA6D85A9B482B23EBBxxxxxx82651EA59EB653AB82561 Key-Arg : None PSK identity: None PSK identity hint: None SRP username: None TLS session ticket lifetime hint: 300 (seconds) TLS session ticket: 0000 - 06 17 72 78 26 db 25 87-a0 22 98 c8 ce e6 00 9c ..rx&.%.."...... 0010 - xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx ......ke.`.....t 0020 - d1 cc 30 9a 4b b5 ed 12-38 c1 46 87 09 3d a1 c4 ....h..<8.F..=.. 0030 - xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx *V..C.q.n....NE. 0040 - 6d 9a f5 36 9e 23 23 e7-cc 1e 7b ee 76 f7 a0 91 m..6......{.v... 0050 - xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx h%+.]........@.. 0060 - 46 a6 f9 7d dd 69 54 ae-58 f8 fe a1 e1 96 5d 9e F..}.iT.X.....]. 0070 - xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx .c....N....!).C. 0080 - 04 3c cf ca 3d 1f b0 b6-c8 88 14 b2 e0 a8 b1 78 .<.............x 0090 - xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx }..s.....Yu..n.8 00a0 - a5 e6 4a 52 f4 eb 57 5f-b8 f5 ba aa cf cb f2 3a ..WE..W_...<...: Start Time: 1467312129 Timeout : 300 (sec) Verify return code: 0 (ok)---closeddepth=2 C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CAverify return:1depth=1 C = BE, O = GlobalSign nv-sa, CN = GlobalSign Domain Validation CA - SHA256 - G2verify return:1depth=0 OU = Domain Control Validated, CN =*.domain.tldverify return:1
@ayufan I have 2 runners and especially if there are many builds at the same time (i.e. 10 Builds in the queue) the fail-rate is higher than normal. Each build runs approx. 3 min.
Also builds which get executed immediate after a merge request is merged (accept mr and direct sync a fork) fails often too.
Is it maybe related to the git version? I had always this certificate error with pre 2.x git, but after I upgraded git it mostly works. Still, not always.
I've been having a look at this at @ayufan's request.
As far as I can see, the certificate data flow is:
gitlab-ci-multi-runner has a cacert.pem file which it uses to verify the GitLab server (network/client.go:38)
When receiving a build, the TLS certificate chain used by GitLab is read from the TLS connection state (network/client.go:89) and stuffed into the build config (network/gitlab.go:97)
These certificates are written to a file in the project-specific directory by the prepare script
The code that does the conversion from TLS state to PEM-encoded certificate data is suspect. Is there a reason why we don't just copy the file used by gitlab-ci-multi-runner proper, for the builds to use?
This will non-deterministically shuffle the order of the certificates - a map is not a list, and order is not guaranteed in a list. Could this account for the symptoms we're seeing? Here's an example of what I mean: https://play.golang.org/p/N-A0dJGXdp
We're being bit by this as well, although we're not using an intermediate cert. Our certs are signed by our internal CA. The runners experiencing the issue are on Windows Server 2012R2.
We have been experiencing this issue since day one of using GitLab CI. This issue is already 10 months old and is clearly affecting large numbers of deployments. Any chance this can get the attention needed to solve it once and for all?
@ayufan that new issue already exists since a month now: #2148 (closed) ... Its simple to say: the ssl-certificate-problem is not solved. Cloning submodules only works with the "old" method (using before_script) presumably due to the fact that that happens in the actual build-container which is in control by the user and thus usually contains the necessary stuff for ssl to work properly.