Ошибка конфигурации git в Jenkins MultiBranch Pipeline - PullRequest
1 голос
/ 20 мая 2019

У меня есть многоотраслевой конвейер в jenkins, и когда я его настраивал, я отменил начальное сканирование задания веток gitlab, нажав значок красного креста.

С этого момента,Я не могу заставить его работать должным образом.

Я вставил ошибку ниже.

Вот вещи, которые я пытался исправить.

  1. ПерезапущенПрограммное обеспечение безопасно через графический интерфейсв * .lock ничего не найдено
  2. Создан новый многоотраслевой конвейер и использован тот же git-репо, произошел сбой таким же образом.
  3. Создан новый многоотраслевой конвейер и использован другой git-репо, но изтот же сервер, использующий те же учетные данные, работал.

У меня заканчиваются идеи

Как будто что-то кешируется на стороне jenkins для этого конкретного git repo.

Есть ли у кого-нибудь какие-либо дополнительные предложения о том, что я могу попробовать?

Заранее спасибо

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 Ответ

0 голосов
/ 11 июля 2019

Была такая же проблема:

  1. Перейдите к $ JENKINS_HOME / caches (в Windows это, вероятно, C: \ Program Files (x86) \ Jenkins \ caches) - вы найдете несколько кэшей,у каждого есть файл .git / config
  2. Читайте .git / config, пока не найдете тот, чей [удаленный «источник»] указывает на URL-адрес git прерванного конвейера.
  3. Удалить (илилучше переименуйте) .git / config & .git / config.lock этого cahce

У меня сработало.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...