簡體   English   中英

Jenkins 多分支管道 git 配置錯誤

[英]Jenkins MultiBranch Pipeline git config error

我在 jenkins 中有一個多分支管道,當我設置它時,我通過點擊紅叉圖標取消了 gitlab 分支作業的初始掃描。

從那時起,我無法讓它正常工作。

我在下面粘貼了錯誤。

這是我試圖解決的問題。

  1. 通過 GUI 安全重啟軟件
  2. 重新啟動容器
  3. 刪除了主從上工作區文件夾中的所有文件夾,與 git 存儲庫連接
  4. 在兩台機器上搜索以 *.lock 結尾的任何文件,沒有找到相關內容
  5. 創建了一個新的多分支管道並使用相同的 git 回購協議,以同樣的方式失敗。
  6. 創建了一個新的多分支管道並使用了不同的 git 存儲庫,但來自使用相同憑據的同一服務器,工作正常。

我的想法不多了

就好像在這個特定的 git 存儲庫的 jenkins 端緩存了一些東西。

有人對我可以嘗試的事情有任何進一步的建議嗎?

提前致謝

Started by user admin
[Mon May 20 15:38:34 UTC 2019] Starting branch indexing...
 > git --version # timeout=10
using GIT_ASKPASS to set credentials git
 > git ls-remote --symref  # timeout=10
 > git rev-parse --is-inside-work-tree # timeout=10
Setting origin to http://myserver/project.git
 > git config remote.origin.url http://myserver/project.git # timeout=10
ERROR: [Mon May 20 15:38:37 UTC 2019] Could not fetch branches from source 773e986b-d653-49c8-b3eb-7320be14e5aa
hudson.plugins.git.GitException: Command "git config remote.origin.url http://myserver/project.git" returned status code 255:
stdout: 
stderr: error: could not lock config file .git/config: File exists

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2010)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2006)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1638)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1650)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.setRemoteUrl(CliGitAPIImpl.java:1284)
    at hudson.plugins.git.GitAPI.setRemoteUrl(GitAPI.java:160)
    at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:352)
    at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:556)
    at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:374)
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:284)
    at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
    at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
    at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
    at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1025)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
[Mon May 20 15:38:37 UTC 2019] Finished branch indexing. Indexing took 2.4 sec
FATAL: Failed to recompute children of Foldername » MultiBranchPipeline
hudson.plugins.git.GitException: Command "git config remote.origin.url http://myserver/project.git” returned status code 255:
stdout: 
stderr: error: could not lock config file .git/config: File exists

    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2010)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2006)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1638)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1650)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.setRemoteUrl(CliGitAPIImpl.java:1284)
    at hudson.plugins.git.GitAPI.setRemoteUrl(GitAPI.java:160)
    at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:352)
    at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:556)
    at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:374)
    at jenkins.scm.api.SCMSource.fetch(SCMSource.java:284)
    at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:634)
    at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:277)
    at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
    at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1025)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:429)
Finished: FAILURE

有同樣的問題:

  1. 轉到$ JENKINS_HOME / caches(在Windows上可能是C:\\ Program Files(x86)\\ Jenkins \\ caches)-您會發現一些緩存,每個緩存都有.git / config文件
  2. 閱讀.git / config,直到找到其[remote“ origin”]指向斷開管道的git URL的目錄。
  3. 刪除(或更好地重命名)此cahce的.git / config和.git / config.lock

為我工作。

刪除工作區修復我的

暫無
暫無

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

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