簡體   English   中英

Gitlab CI - 無法注冊跑步者

[英]Gitlab CI - Failed to register runner

我已經從源代碼設置了我的 gitlab 安裝,使用 letencrypt 保護它並在https://gitlab.mydomain.com下部署它。 我可以訪問網站並創建存儲庫等,但我找不到為安裝注冊 gitlab ci runner 的方法。

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

我的 gitlab 系統工作正常,我真的沒有解釋為什么會有connection reset by peer 當我嘗試直接從錯誤消息中卷曲地址時,它返回正確的響應。

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

如果 runner 和 gitlab 在同一主機上運行,​​您可以通過輸入第一個問題而不是文檔中給出的內容來解決此問題:

http://gitlab:port

其中gitlab是容器名稱, port是容器的左側端口號。 如果您使用 gitlab 內部 ssl 證書,請指定 https 而不是 http。 當我得到它時,這總是可以解決這個問題。

將 gitlab 更新到8.8.3並將gitlab-multi-ci-runner到最新版本后,問題就消失了。

我還從頭開始了我的 gitlab nginx 配置文件。

最后,我不知道哪個更改完全解決了問題。

到目前為止,我遇到了很多錯誤和問題,從錯誤 404、403 開始​​,以發布請求問題結束。

對我來說,問題似乎是GitLab 和 ci-runner 之間的不兼容

解決方案,與 post 問題相同,是安裝舊版本的 ci-runner:

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

我已經通過安裝gitlab-ci-multi-runner=1.11.1解決了它。

對於那些使用 docker 的人:

這個問題是關於 docker 網絡的。

如果你嘗試

  "$docker container inspect $id"

您將看到 gitlab 容器的 IPAddress。

在第一個問題中指向那個 ip 地址可以正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM