2017-07-10 11 views
0

私はJenkinsのLinuxでgit repoを取得する際に問題に直面しています。私はスタックトレースを添付します。 SSH gitlab接続に秘密鍵とパスフレーズを設定しました。構成は、資格情報/システム/グローバル資格情報(制限なし)で行われます。秘密鍵へのパスは/home/jenkins/.jenkins/secrets/my_private_key.pubです。所有者とグループ:jenkins:jenkins、jenkinsはインストールを行うユーザーです。権限:600 秘密鍵は、コマンドラインからsshを使用してパスフレーズでチェックされています。 jenkinsが使用するgit fetchコマンドもコマンドラインでチェックされています。両方の作品。 リポジトリURLの形式は次のようである:Jenkins git fetchが返されたステータスコード143

[email protected]:org-name/project.git (short notation for ssh protocol) 

環境:

* CentOS 7 64 bit 
* openjdk version "1.8.0_131" 64 bit 
* Jenkins ver. 2.67 
* Git client plugin 2.4.6Git plugin 3.3.0 (3.3.1 is not helping too) 
* GIT server Plugin 1.7 
* GitLab Plugin 1.4.5 (1.4.6 is not helping too) 
* SCM API Plugin 2.1.1 
* Credentials Plugin 2.1.14 
* Jenkins is run directly 
* Jenkins was installed with yum installer 
* Browser: Google Chrome 59 
* GitLab Community Edition 9.3.5 
* git version 1.8.3.1 

スタックトレース:

started by user Jenkins Admin 
Building in workspace /home/jenkins/.jenkins/workspace/my_project 
> git rev-parse --is-inside-work-tree # timeout=10 
Fetching changes from the remote Git repository 
> git config remote.origin.url [email protected]:XYZ/docs/project.git # 
timeout=10 
Cleaning workspace 
> git rev-parse --verify HEAD # timeout=10 
No valid HEAD. Skipping the resetting 
> git clean -fdx # timeout=10 
Fetching upstream changes from [email protected]:XYZ/docs/project.git 
> git --version # timeout=10 
using GIT_SSH to set credentials 
> git fetch --no-tags --progress [email protected]:XYZ/docs/project.git 
+refs/heads/*:refs/remotes/origin/* --depth=1 
ERROR: Timeout after 10 minutes 
ERROR: Error fetching remote repo 'origin' 
hudson.plugins.git.GitException: Failed to fetch from [email protected]:XYZ/docs/project.git 
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:809) 
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1076) 
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1107) 
at hudson.scm.SCM.checkout(SCM.java:495) 
at hudson.model.AbstractProject.checkout(AbstractProject.java:1212) 
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:560) 
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) 
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:485) 
at hudson.model.Run.execute(Run.java:1735) 
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 
at hudson.model.ResourceController.execute(ResourceController.java:97) 
at hudson.model.Executor.run(Executor.java:415) 
Caused by: hudson.plugins.git.GitException: Command "git fetch --no-tags --progress [email protected]:XYZ/docs/project.git +refs/heads/*:refs/remotes/origin/* --depth=1" returned status code 143: 
stdout: 
stderr: 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1903) 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1622) 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71) 
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:348) 
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:807) 
... 11 more 
ERROR: null 
Finished: FAILURE 

答えて

0

私は解決策を見つけました。 Jenkinsをsystemctlでサービスとして実行すると、java -jar jenkins.warでJenkinsを実行する代わりに、問題が解決されました。詳細を与えることを

: は、ドキュメントによると、ジェンキンスさんは

java -jar jenkins.war 

によって開始され、私はそれをチェックすると、システムで実行されているように見えた。しかし

ps aux | grep jenkins 

、 CentOS 7では、Jenkinsを実行するには、systemctlコマンドを使ってデーモンとして実行することをお勧めします。 私はそれをチェックしたとき

sudo systemctl status jenkins.service 

無効でした。 だから私はジェンキンスと

sudo systemctl start jenkins.service 

と始まりました。

+0

他の人の利益のために辿った正確な手順を投稿できますか? – Shwethascar

関連する問題