Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jenkins多分支管道git配置错误_Git_Jenkins_Gitlab - Fatal编程技术网

Jenkins多分支管道git配置错误

Jenkins多分支管道git配置错误,git,jenkins,gitlab,Git,Jenkins,Gitlab,我在jenkins有一个多分支管道,当我设置它时,我通过点击红十字图标取消了gitlab分支作业的初始扫描 从那时起,我无法让它正常工作 我已将错误粘贴到下面 以下是我试图解决的问题 通过GUI安全地重新启动软件 重新启动容器 已删除主服务器和从服务器上与git存储库连接的工作区文件夹中的所有文件夹 在两台计算机上搜索以*.lock结尾的任何文件,未找到任何相关内容 创建了一个新的多分支管道并使用了相同的git repo,但以相同的方式失败 创建了一个新的多分支管道,并使用了不同的git rep

我在jenkins有一个多分支管道,当我设置它时,我通过点击红十字图标取消了gitlab分支作业的初始扫描

从那时起,我无法让它正常工作

我已将错误粘贴到下面

以下是我试图解决的问题

  • 通过GUI安全地重新启动软件
  • 重新启动容器
  • 已删除主服务器和从服务器上与git存储库连接的工作区文件夹中的所有文件夹
  • 在两台计算机上搜索以*.lock结尾的任何文件,未找到任何相关内容
  • 创建了一个新的多分支管道并使用了相同的git repo,但以相同的方式失败
  • 创建了一个新的多分支管道,并使用了不同的git repo,但来自同一服务器,使用了相同的凭据
  • 我的点子快用完了

    就好像詹金斯那边有一些东西在为这个特殊的git回购缓存

    有人对我可以尝试的事情有什么进一步的建议吗

    提前谢谢

    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
    
    有同样的问题:

  • 转到$JENKINS\u HOME/caches(在windows上可能是C:\Program Files(x86)\JENKINS\caches)-您会发现一些缓存,每个缓存都有.git/config文件
  • 阅读.git/config,直到找到[remote“origin”]指向损坏管道的git URL的文件
  • 删除(或者更好地重命名)这个cahce的.git/config&.git/config.lock

  • 对我有效。

    这几乎对我有效,但我只在一个PR上有问题。我在
    /var/lib/jenkins/workspace/my-pipeline-name\PR中对
    config
    &
    config.lock
    也有同样的问题-1234@script
    (相应地修改
    我的管道名称
    PR-1234
    )。我刚刚从
    $JENKINS\u HOME\caches\git-someidhere123\.git
    文件夹中删除了
    配置锁,它对我也起了作用。这对我也起了作用,但有人能解释到底发生了什么吗?我想更好地理解你是如何推理得出这个解决方案的?