Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 308452 - Cloning a Git repository fails with InvocationTargetException with nested NullPointerException
Summary: Cloning a Git repository fails with InvocationTargetException with nested Nul...
Status: CLOSED DUPLICATE of bug 314853
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 0.9.0-M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-08 05:35 EDT by Jan F. CLA
Modified: 2010-08-19 04:38 EDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan F. CLA 2010-04-08 05:35:49 EDT
Build Identifier: 20100218-1602

Using Import > Git Repository, I was able to successfully clone one repository, but on another, the exception below was thrown during the progress of cloning ("Checking out files" was displayed in the wizard status progress), a single file was created on the disk when I first tried, on second attempt nothing was created on the disk.

Egit 0.7.1
eclipse.buildId=unknown
java.version=1.6.0_19
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.rcp.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.rcp.product


Error
Thu Apr 08 10:49:58 CEST 2010
Cloning Git Repository failed

java.lang.reflect.InvocationTargetException
	at org.eclipse.egit.core.op.CloneOperation.run(CloneOperation.java:130)
	at org.eclipse.egit.ui.internal.clone.GitCloneWizard$3.run(GitCloneWizard.java:174)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: java.lang.NullPointerException
	at org.eclipse.jgit.lib.GitIndex$Entry.<init>(GitIndex.java:424)
	at org.eclipse.jgit.lib.GitIndex.addEntry(GitIndex.java:818)
	at org.eclipse.jgit.lib.WorkDirCheckout$1.visitEntry(WorkDirCheckout.java:181)
	at org.eclipse.jgit.lib.IndexTreeWalker.finishVisitTree(IndexTreeWalker.java:198)
	at org.eclipse.jgit.lib.IndexTreeWalker.walk(IndexTreeWalker.java:135)
	at org.eclipse.jgit.lib.IndexTreeWalker.walk(IndexTreeWalker.java:113)
	at org.eclipse.jgit.lib.WorkDirCheckout.checkoutOutIndexNoHead(WorkDirCheckout.java:165)
	at org.eclipse.jgit.lib.WorkDirCheckout.checkout(WorkDirCheckout.java:142)
	at org.eclipse.egit.core.op.CloneOperation.doCheckout(CloneOperation.java:225)
	at org.eclipse.egit.core.op.CloneOperation.run(CloneOperation.java:121)
	... 2 more


Reproducible: Always

Steps to Reproduce:
1. Install fresh PDE, add EGit and JGit using Update center
2. Go to Import > Git Repository, select git repository (using git protocol)
3. Click next
Comment 1 Stefan Lay CLA 2010-04-09 11:03:58 EDT
Does the repo contain submodules? Then it seems to be the same bug as 306765.
Comment 2 Jan F. CLA 2010-04-09 13:22:49 EDT
Nope, just a plain regular repository
Comment 3 Kenny Scott CLA 2010-04-13 09:35:53 EDT
Hi,

Eclipse version: 20100218-1602
Egit version: 0.7.1

I have just had almost the exact same problem, although mine doesn't have a nested NPE, it instead has a nested TransportException.  The thrown exception is an InvocationTargetException though, so I'm thinking I'll add the comment here rather than raise a new bug.  If you think this is a different bug, let me know and I'll log it as a new one.

Details: the git repository lives on a linux machine, workstation on which Eclipse runs is a Windows Vista box, Eclipse workspace is not on local disk but on a linux box.  Attempted to Git Import using git+ssh.

All was good up until the Local Destination part of the Git Import Wizard; before this, it had successfully connected to the linux server and found the project.  After this, though, it fails with the stack trace (see below).

However, it works totally fine if the eclipse workspace is on the Windows workstation itself, for example c:\workspace.  Whether I map a network drive to the directory on the linux machine or I just specify it using \\hostname\path\to\dir, it doesn't work.

Could this be a problem with file locking on the remote linux filesystem?

java.lang.reflect.InvocationTargetException
at org.eclipse.egit.core.op.CloneOperation.run(CloneOperation.java:130)
at org.eclipse.egit.ui.internal.clone.GitCloneWizard$3.run(GitCloneWizard.java:174)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.jgit.errors.TransportException: Cannot move pack to Y:\StringTemplateTest\.git\objects\pack\pack-d7d1492a586c8f99935b2eac090fb83f3538e847.pack
at org.eclipse.jgit.transport.BasePackFetchConnection.doFetch(BasePackFetchConnection.java:264)
at org.eclipse.jgit.transport.BasePackFetchConnection.fetch(BasePackFetchConnection.java:216)
at org.eclipse.jgit.transport.FetchProcess.fetchObjects(FetchProcess.java:203)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:143)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:109)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:814)
at org.eclipse.egit.core.op.CloneOperation.doFetch(CloneOperation.java:202)
at org.eclipse.egit.core.op.CloneOperation.run(CloneOperation.java:120)
... 2 more
Caused by: java.io.IOException: Cannot move pack to Y:\StringTemplateTest\.git\objects\pack\pack-d7d1492a586c8f99935b2eac090fb83f3538e847.pack
at org.eclipse.jgit.transport.IndexPack.renameAndOpenPack(IndexPack.java:1149)
at org.eclipse.jgit.transport.BasePackFetchConnection.receivePack(BasePackFetchConnection.java:621)
at org.eclipse.jgit.transport.BasePackFetchConnection.doFetch(BasePackFetchConnection.java:257)
... 9 more
Root exception:
org.eclipse.jgit.errors.TransportException: Cannot move pack to Y:\StringTemplateTest\.git\objects\pack\pack-d7d1492a586c8f99935b2eac090fb83f3538e847.pack
at org.eclipse.jgit.transport.BasePackFetchConnection.doFetch(BasePackFetchConnection.java:264)
at org.eclipse.jgit.transport.BasePackFetchConnection.fetch(BasePackFetchConnection.java:216)
at org.eclipse.jgit.transport.FetchProcess.fetchObjects(FetchProcess.java:203)
at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:143)
at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:109)
at org.eclipse.jgit.transport.Transport.fetch(Transport.java:814)
at org.eclipse.egit.core.op.CloneOperation.doFetch(CloneOperation.java:202)
at org.eclipse.egit.core.op.CloneOperation.run(CloneOperation.java:120)
at org.eclipse.egit.ui.internal.clone.GitCloneWizard$3.run(GitCloneWizard.java:174)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: java.io.IOException: Cannot move pack to Y:\StringTemplateTest\.git\objects\pack\pack-d7d1492a586c8f99935b2eac090fb83f3538e847.pack
at org.eclipse.jgit.transport.IndexPack.renameAndOpenPack(IndexPack.java:1149)
at org.eclipse.jgit.transport.BasePackFetchConnection.receivePack(BasePackFetchConnection.java:621)
at org.eclipse.jgit.transport.BasePackFetchConnection.doFetch(BasePackFetchConnection.java:257)
... 9 more
Comment 4 Matthias Sohn CLA 2010-05-26 18:41:04 EDT
did this happen when cloning via http protocol ? There was some problem when the remote repository stopped working during transport.
Comment 5 bdeheer CLA 2010-06-23 09:49:10 EDT
I have the same problem on Ubuntu. I am cloning using the HTTP protocol.
Comment 6 maga CLA 2010-06-23 13:37:16 EDT
there is the same problem here.
conf: Windows 7, Eclipse 3.6, EGet 0.8.4
I can't clone some git repositories from github.com, e.g. git://github.com/extjs/Connect.git
Comment 7 Mathias Kinzler CLA 2010-07-08 04:42:18 EDT
I have created 319233 for the nested IOException. Please let's continue there. 
In case of the nested NullPointerException, which is the original bug (and which also happens in the scenario described in Comment6, the problem occurs in the already deprecated class GitIndex. Since we are just about to replace this with the new DirCache, it doesn't make too much sense to try and hunt the bug down in GitIndex. Instead we should wait for the new DirCache implementation and check if the bug still occurs there and, if it does, continue with the analysis then.
Comment 8 Mathias Kinzler CLA 2010-07-08 04:46:52 EDT
(In reply to comment #5)
> I have the same problem on Ubuntu. I am cloning using the HTTP protocol.

Do you get a nested NullPointerException or a nested IOException?
Comment 9 Mathias Kinzler CLA 2010-07-08 05:11:36 EDT
(In reply to comment #6)
> there is the same problem here.
> conf: Windows 7, Eclipse 3.6, EGet 0.8.4
> I can't clone some git repositories from github.com, e.g.
> git://github.com/extjs/Connect.git

This is because we don't support submodules yet. See bug 314853.
Comment 10 Mathias Kinzler CLA 2010-07-08 05:14:36 EDT
(In reply to comment #5)
> I have the same problem on Ubuntu. I am cloning using the HTTP protocol.

If you do get a NullPointerException, can you confirm that the repository does not contain submodules (see Bug 314853)? If you do get a IOException, can you please add it to bug 319233, along with the repository URL (if it is available)?
Comment 11 Lars Vogel CLA 2010-07-21 09:08:36 EDT
I believe a have an example which can be used by Mathias and Stefan -> Shared via email as it is a file:// based example which can not be accessed from outside the SAP network.
Comment 12 Mathias Kinzler CLA 2010-07-21 10:50:20 EDT
(In reply to comment #11)
> I believe a have an example which can be used by Mathias and Stefan -> Shared
> via email as it is a file:// based example which can not be accessed from
> outside the SAP network.

This example behaves as described in bug 320259, which is already fixed.
Comment 13 Lars Vogel CLA 2010-07-22 09:51:26 EDT
Thanks. With the latest nightly build this issue is gone for me. Perhaps this bug can be closed?
Comment 14 Mathias Kinzler CLA 2010-07-30 05:29:02 EDT

*** This bug has been marked as a duplicate of bug 314853 ***