我正在嘗試Jenkins在我們的(GitLab 社區版本 13.0.3)上為我們的專案集成(gitlab.doman.com版本 2.337),它已部署并運行Linux Centos在AWS EC2. 當我嘗試使用我的 GitLab 進行測驗時Access Token,它給了我錯誤說明Connection Timed Out。當我嘗試使用 Gitlab webhook 和 SSH 密鑰作為憑據而不是訪問令牌時,webhook 成功執行,但 jenkins 上的作業失敗并出現以下錯誤。
我對 Jenkins 和 CI/CD 很陌生。因此,非常感謝任何解決此問題的指導或幫助!
詹金斯控制臺日志:
Started by GitLab push by j****
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/xx_xxxxx
The recommended git tool is: NONE
using credential 7c284997-927a-40d9-b1cf-02axxxxxxxxx
> /usr/bin/git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/xx_xxxxx/.git # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.origin.url [email protected]:xx_xxxxxDetection/xx_xxxxx_detection.git # timeout=10
Fetching upstream changes from [email protected]:xx_xxxxxDetection/xx_xxxxx_detection.git
> /usr/bin/git --version # timeout=10
> git --version # 'git version 1.8.3.1'
using GIT_SSH to set credentials GitLab_SSH_Key
> /usr/bin/git fetch --tags --progress [email protected]:xx_xxxxxDetection/xx_xxxxx_detection.git refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from [email protected]:xx_xxxxxDetection/xx_xxxxx_detection.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:1001)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1242)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1302)
at hudson.scm.SCM.checkout(SCM.java:540)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1215)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:645)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:85)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:517)
at hudson.model.Run.execute(Run.java:1896)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --progress [email protected]:xx_xxxxxDetection/xx_xxxxx_detection.git refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: ssh: connect to host gitlab.sampledomain.co.kr port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2671)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2096)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:618)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:999)
... 11 more
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE
uj5u.com熱心網友回復:
GitLab 訪問令牌僅適用于 HTTPS URL(替換您的 GitLab 帳戶密碼)
如果您Connection timed out 同時看到HTTPS URL 和 SSH URL([email protected]:...如您的問題所示),這意味著gitlab.sampledomain.co.kr無法從嘗試聯系您的 Git 存盤庫托管服務器的 Jenkins 控制器服務器訪問。
您需要確保這樣的服務器可以執行簡單的curl -v telnet://gitlab.sampledomain.co.kr:22or curl -v telnet://gitlab.sampledomain.co.kr:443,然后才能運行像 Jenkins 這樣的服務。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/442169.html
上一篇:為什么在docker-compose.yml中使用空白/空卷允許持久性但使用相對路徑失敗(例如jenkinsgui不可用)?
