7

Windowsスレーブマシンが接続されたjenkinsインスタンスがあります。また、github に常駐するジョブを実行しており、「変更が GitHub にプッシュされたときにビルドする」というトリガーを設定しています。

変更を github にプッシュしても、ジェンキンでトリガーされるビルドはありません。「Githubフックログ」でペイロードがjenkinsに転送されていることを確認しましたが、次のエラーが発生しました:

 Started on Sep 18, 2014 3:57:06 PM
Using strategy: Default
[poll] Last Built Revision: Revision ce6a183e834a3e31afa0eb83a4418b0619c8642b (origin/master)
 > "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master # timeout=10
FATAL: hudson.plugins.git.GitException: Error performing command: "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master
hudson.util.IOException2: hudson.plugins.git.GitException: Error performing command: "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master
    at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:462)
    at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:357)
    at hudson.scm.SCM.poll(SCM.java:374)
    at hudson.model.AbstractProject._poll(AbstractProject.java:1428)
    at hudson.model.AbstractProject.poll(AbstractProject.java:1331)
    at com.cloudbees.jenkins.GitHubPushTrigger$1.runPolling(GitHubPushTrigger.java:73)
    at com.cloudbees.jenkins.GitHubPushTrigger$1.run(GitHubPushTrigger.java:98)
    at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
    at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: hudson.plugins.git.GitException: Error performing command: "C:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1444)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1225)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1138)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1129)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.getHeadRev(CliGitAPIImpl.java:2059)
    at hudson.plugins.git.GitSCM.compareRemoteRevisionWithImpl(GitSCM.java:495)
    at hudson.plugins.git.GitSCM.compareRemoteRevisionWith(GitSCM.java:460)
    ... 13 more
Caused by: java.io.IOException: Cannot run program ""C:\Program Files (x86)\Git\cmd\git.exe"": error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
    at hudson.Proc$LocalProc.<init>(Proc.java:244)
    at hudson.Proc$LocalProc.<init>(Proc.java:216)
    at hudson.Launcher$LocalLauncher.launch(Launcher.java:780)
    at hudson.Launcher$ProcStarter.start(Launcher.java:360)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1433)
    ... 19 more
Caused by: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.forkAndExec(Native Method)
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
    at java.lang.ProcessImpl.start(ProcessImpl.java:130)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
    ... 24 more

基本的に、コマンドを実行できないと不平を言うC:\Program Files (x86)\Git\cmd\git.exe" ls-remote -h https://xx/xx/xx master

しかし、手動でスレーブ マシンにアクセスしてコマンドを実行すると、正常に動作します。

1. jenkins スレーブ サービスが管理者としてログインし、すべての権限を持つように調整しました。2. デフォルトの jenkins サーバーは Linux ボックスで、スレーブ マシンは Windows ボックスです。明らかに、両方の git 実行可能パスが異なります。したがって、何らかの理由でジェンキンスが私のLinuxボックスでこのコマンドを実行するかどうか疑問に思っています。

Windowsスレーブボックスでのみ実行するようにプロジェクトをセットアップしましたが、正常にビルドされるため、正常に動作します(ジョブのgit実行可能ファイルを見つけることができます)

ポインタはありますか?

また、ジェンキンスのgithubプラグインがスレーブマシンでどのように機能するかを知っている人はいますか(スレーブでgitを探しますか、それがソースである可能性があるため、ジェンキンスが存在する場所に移動しますが、その奇妙なケースの解決策はわかりません)なれ?)

4

1 に答える 1

5

Windowsジョブのgit SCM定義で「ワークスペースを使用した強制ポーリング」を「追加の動作」として追加する回避策を試しました.これは私の問題を解決します-最良の方法ではありませんが効果的です.

ポーリングが Linux ノード (マスター) で実行されているが、Windows git 構成を使用してマスターをポーリングする必要があると判断した場合、Linux マスターは Linux git ではなく、Windows git の場所から git を実行しようとする可能性があります。場所(これが私のプロジェクトで起こっていることです)。Linux と Windows のスレーブを幅広く組み合わせて使用​​する Jenkins git のインストールが多数あるため、これはバグであり、私はこのバグに驚きました。私はそのようなバグを認識していませんでしたが、「ワークスペースを使用した強制ポーリング」によって問題が解決されたため、さらに調査が必要な領域であることを示唆している可能性があります。

于 2014-09-22T19:43:59.980 に答える