[JIRA] [git-plugin] (JENKINS-30276) Jenkins GIT Plugin fails on initial clone

396 views
Skip to first unread message

oliver.hepperle@pixell.de (JIRA)

unread,
Sep 3, 2015, 5:20:01 AM9/3/15
to jenkinsc...@googlegroups.com
Oliver Hepperle updated an issue
 
Jenkins / Bug JENKINS-30276
Jenkins GIT Plugin fails on initial clone
Change By: Oliver Hepperle
Hi all,

after creating a new project today and tried to run first time i noticed that the initial checkout isn't working anymore. Older projects which were already built are working correctly.
Does anybody have an advice why the initial git clone command isn't working anymore?

Here is the stacktrace from jenkins server:

Started on Sep 3, 2015 11:06:22 AM
Creating git repository in C:\Jenkins\caches\git-02c0446b939beedabfea0b1e39a6132f
FATAL: Unknown repository format
org.eclipse.jgit.api.errors.JGitInternalException: Unknown repository format
at org.eclipse.jgit.api.InitCommand.call(InitCommand.java:118)
at org.jenkinsci.plugins.gitclient.JGitAPIImpl.doInit(JGitAPIImpl.java:216)
at org.jenkinsci.plugins.gitclient.JGitAPIImpl.access$600(JGitAPIImpl.java:133)
at org.jenkinsci.plugins.gitclient.JGitAPIImpl$7.execute(JGitAPIImpl.java:1556)
at org.jenkinsci.plugins.gitclient.JGitAPIImpl.init(JGitAPIImpl.java:211)
at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:164)
at jenkins.scm.api.SCMSource.fetch(SCMSource.java:141)
at jenkins.scm.api.SCMSource.retrieve(SCMSource.java:180)
at jenkins.scm.api.SCMSource.fetch(SCMSource.java:167)
at com.github.mjdetullio.jenkins.plugins.multibranch.AbstractMultiBranchProject._syncBranches(AbstractMultiBranchProject.java:981)
at com.github.mjdetullio.jenkins.plugins.multibranch.AbstractMultiBranchProject.syncBranches(AbstractMultiBranchProject.java:948)
at com.github.mjdetullio.jenkins.plugins.multibranch.SyncBranchesTrigger.run(SyncBranchesTrigger.java:102)
at com.github.mjdetullio.jenkins.plugins.multibranch.SyncBranchesTrigger.checkTriggers(SyncBranchesTrigger.java:255)
at com.github.mjdetullio.jenkins.plugins.multibranch.SyncBranchesTrigger$Cron.doRun(SyncBranchesTrigger.java:230)
at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Unknown repository format
at org.eclipse.jgit.internal.storage.file.FileRepository.loadRepoConfig(FileRepository.java:249)
at org.eclipse.jgit.internal.storage.file.FileRepository.<init>(FileRepository.java:192)
at org.eclipse.jgit.lib.BaseRepositoryBuilder.build(BaseRepositoryBuilder.java:577)
at org.eclipse.jgit.api.InitCommand.call(InitCommand.java:113)
... 21 more
Caused by: org.eclipse.jgit.errors.ConfigInvalidException: Cannot read file
 D  C :\Jenkins\caches\git-02c0446b939beedabfea0b1e39a6132f\.git\config
at org.eclipse.jgit.storage.file.FileBasedConfig.load(FileBasedConfig.java:173)
at org.eclipse.jgit.internal.storage.file.FileRepository.loadRepoConfig(FileRepository.java:247)
... 24 more
Caused by: org.eclipse.jgit.errors.ConfigInvalidException: Invalid line in config file
at org.eclipse.jgit.lib.Config.fromText(Config.java:1087)
at org.eclipse.jgit.storage.file.FileBasedConfig.load(FileBasedConfig.java:161)
... 25 more
Done. Took 0 ms

regards
pix_oli
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

oliver.hepperle@pixell.de (JIRA)

unread,
Sep 3, 2015, 5:20:01 AM9/3/15
to jenkinsc...@googlegroups.com
Oliver Hepperle created an issue
Issue Type: Bug Bug
Assignee: Nicolas De Loof
Components: git-plugin
Created: 03/Sep/15 9:18 AM
Environment: Windows Server 2008; git version 2.5.1.windows.1
Priority: Major Major
Reporter: Oliver Hepperle

Caused by: org.eclipse.jgit.errors.ConfigInvalidException: Cannot read file D:\Jenkins\caches\git-02c0446b939beedabfea0b1e39a6132f\.git\config


at org.eclipse.jgit.storage.file.FileBasedConfig.load(FileBasedConfig.java:173)
at org.eclipse.jgit.internal.storage.file.FileRepository.loadRepoConfig(FileRepository.java:247)
... 24 more
Caused by: org.eclipse.jgit.errors.ConfigInvalidException: Invalid line in config file
at org.eclipse.jgit.lib.Config.fromText(Config.java:1087)
at org.eclipse.jgit.storage.file.FileBasedConfig.load(FileBasedConfig.java:161)
... 25 more
Done. Took 0 ms

regards
pix_oli

mark.earl.waite@gmail.com (JIRA)

unread,
Sep 3, 2015, 9:57:02 AM9/3/15
to jenkinsc...@googlegroups.com
Mark Waite resolved as Not A Defect
 

It is much better if we use the mailing list for questions and answers, rather than using the bug tracker for questions and answers.

In this case, it appears (from the stack trace) that your job may be configured to use JGit after having previously been configured to use command line git. Usually the config file format is freely interchangeable between JGit and command line git implementations, but apparently not in this case.

As a work around, you might try to open the workspace (from Jenkins) and wipe the workspace, then perform a "Build now" to populate the workspace again.

As another possible work around, you might try to edit the contents of the .git/config file in the workspace directory to see if you can deduce what is in that file that is not acceptable to JGit. That would have the benefit of helping us better understand if the JGit implementation used inside the plugin needs some "safety feature" to handle some new configuration option added in Windows git 2.5.1.

I believe that at least one of my test machines (Ubuntu Linux) has already updated to git 2.5.1, so I will be surprised if this is a git 2.5.1 general change.

Change By: Mark Waite
Status: Open Resolved
Resolution: Not A Defect

oliver.hepperle@pixell.de (JIRA)

unread,
Sep 4, 2015, 3:53:01 AM9/4/15
to jenkinsc...@googlegroups.com
Oliver Hepperle commented on Bug JENKINS-30276
 
Re: Jenkins GIT Plugin fails on initial clone

Hello Mark Waite,

Thank you for your fast answer, but i still think this is a bug in the plugin.

_Mark Waite wrote:
As a work around, you might try to open the workspace (from Jenkins) and wipe the workspace, then perform a "Build now" to populate the workspace again._

There is no option for wiping the workspace. If i look on the server in C:\Jenkins\jobs\xxx\ there is a template folder, config.xml and a sync-branches.log file. The stacktrace was from the sync-branches.log file. I already tried to create a new project, but it also fails on first checkout.

Mark Waite wrote: As another possible work around, you might try to edit the contents of the .git/config file in the workspace directory to see if you can deduce...

In the workspace of this project there is no .git folder. I looked into older projects and there is one. So i think the git plugin crashed before the folder was created.

If i execute the command git clone xxx on the machine it works normally.

regards

oliver.hepperle@pixell.de (JIRA)

unread,
Sep 4, 2015, 3:54:02 AM9/4/15
to jenkinsc...@googlegroups.com
Oliver Hepperle edited a comment on Bug JENKINS-30276
Hello Mark Waite,

Thank you for your fast answer, but i still think this is a bug in the plugin.

_Mark Waite wrote:

As a work around, you might try to open the workspace (from Jenkins) and wipe the workspace, then perform a "Build now" to populate the workspace again._

There is no option for wiping the workspace. If i look on the server in C:\Jenkins\jobs\xxx\ there is a template folder, config.xml and a sync-branches.log file. The stacktrace was from the sync-branches.log file. I already tried to create a new project, but it also fails on first checkout.

_Mark Waite wrote: As another possible work around, you might try to edit the contents of the .git/config file in the workspace directory to see if you can deduce..._


In the workspace of this project there is no .git folder. I looked into older projects and there is one. So i think the git plugin crashed before the folder was created.

If i execute the command git clone xxx on the machine it works normally.

regards

mark.earl.waite@gmail.com (JIRA)

unread,
Sep 4, 2015, 9:14:03 AM9/4/15
to jenkinsc...@googlegroups.com

I'm impressed if it is a bug in the plugin, since that would mean you've found a case which 60000+ other installations of the plugin have not detected. That is certainly possible, though it seems less likely than there being something which changed locally on your machine that caused the problem to occur.

The stack trace includes:

Cannot read file C:\Jenkins\caches\git-02c0446b939beedabfea0b1e39a6132f\.git\config

That is a surprising name for a file being attempted to read. It seems to include a SHA1 in the directory name. Is that intentional? Is the workspace intentionally stored in a directory named "caches" with a job name "git-02c0446b939beedabfea0b1e39a6132f"?

Can you provide steps that will allow someone else to duplicate the bug outside your environment?

oliver.hepperle@pixell.de (JIRA)

unread,
Sep 8, 2015, 4:49:01 AM9/8/15
to jenkinsc...@googlegroups.com

ok, after some investigations: it seems that this problem is caused by the "Multi-Branch Project Plugin". Like you said "git" and "git plugin" are not causing any problems.

How to duplicate this bug:

1. Add new build item
2. select "Freestyle multi-branch project"
3. insert git project uri (https) and credentials
4. click on save and build.
It will fail directly before workspace is created. You can see the exceptions in jenkins polling log.

regards

mark.earl.waite@gmail.com (JIRA)

unread,
Oct 22, 2019, 9:32:04 PM10/22/19
to jenkinsc...@googlegroups.com
Mark Waite closed an issue as Not A Defect
 
Change By: Mark Waite
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages