2012-11-19 46 views
2

好的,首先,我對git非常陌生。Git on Hudson更新子模塊時發生致命異常

我已經建立了一個構建,但它剛剛開始失敗,出現以下錯誤。

FATAL: Command "git submodule update" returned status code 1: 
stdout: 
stderr: fatal: reference is not a tree: 72294b9c60128b4495dfe0bf3aa014b3bf1853e9 
Unable to checkout '72294b9c60128b4495dfe0bf3aa014b3bf1853e9' in submodule path 'sub/Android-ViewPagerIndicator' 

hudson.plugins.git.GitException: Command "git submodule update" returned status code 1: 
stdout: 
stderr: fatal: reference is not a tree: 72294b9c60128b4495dfe0bf3aa014b3bf1853e9 
Unable to checkout '72294b9c60128b4495dfe0bf3aa014b3bf1853e9' in submodule path 'sub/Android-ViewPagerIndicator' 

    at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:838) 
    at hudson.plugins.git.GitAPI.launchCommand(GitAPI.java:800) 
    at hudson.plugins.git.GitAPI.submoduleUpdate(GitAPI.java:429) 
    at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1308) 
    at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1269) 
    at hudson.FilePath.act(FilePath.java:851) 
    at hudson.FilePath.act(FilePath.java:824) 
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1269) 
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1325) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:676) 
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) 
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:581) 
    at hudson.model.Run.execute(Run.java:1516) 
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) 
    at hudson.model.ResourceController.execute(ResourceController.java:88) 
    at hudson.model.Executor.run(Executor.java:236) 
+0

所以你會介意分享你如何設置構建? – eis

+0

我爲jenkins和github使用了一個git插件。回購有4個子模塊。 (我沒有設置這個)。構建腳本:PATH =/Applications/android/tools /:$ PATH PATH =/Applications/android/platform-tools /:$ PATH android update project --path。 --subprojects --target android-16 cd app; rake build:debug – serenskye

+0

好的,那麼詹金斯/哈德森*工作*細節怎麼樣?像你有什麼樣的SCM網址,什麼樣的refspec,你使用標記,如果你有,你是否需要它等等。 – eis

回答

2

有人在您的主項目中搞亂了您的子模塊參考。基本上,您的主回購總是引用您的子模塊回購中的特定提交,並且提交引用您的子模塊(72294b9c60128b4495dfe0bf3aa014b3bf1853e9)似乎並不存在。

這可能發生在以下情況下:1)某人在子模塊項目中進行了簽入,但其頭部已分離或者2)子模塊項目本身以不包含提交的方式進行了更改。

然而,問題應該出現在哈德遜以外的地方,無論你做什麼克隆你的項目。如果沒有,它可能只是你的哈德森克隆已損壞,可以刪除和重新創建。這也可以用來測試。

如果這樣做什麼都不做,而且您確實需要修復這些問題,請查看this thread以獲得解決方案,您也可以通過this blog post瞭解更多詳細信息。

作爲個人觀點,子模塊很容易打破。如果你對「git」很陌生,你應該避免接觸這些東西,但要先用git的總體使用感受你的雙腳。

+0

它只發生通過jenkins構建。它沒有發生在第一對夫婦身上,但似乎總是在幾次構建之後發生。我無法改變git設置,它是一個與其他開發人員合作的大型項目,我只是在看構建。感謝您的鏈接,我會看看:) – serenskye

+0

所以看起來像我不能使用jenkins的git插件,因爲更新觸發這一切!? – serenskye