Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Packfile is truncated error while cloning Git repository

Tags:

java

git

eclipse

I'm using Egit with Eclipse on Windows to try to clone a repository from private Git. It connects, but while downloading I get the "Packfile is truncated" error. My web browser and file explorer are both closed. Does anyone know what the problem could be?

org.eclipse.jgit.api.errors.TransportException: Packfile is truncated.
    at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139)
    at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:187)
    at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:127)
    at org.eclipse.egit.core.op.CloneOperation.run(CloneOperation.java:156)
    at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard.executeCloneOperation(AbstractGitCloneWizard.java:433)
    at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard.access$2(AbstractGitCloneWizard.java:426)
    at org.eclipse.egit.ui.internal.clone.AbstractGitCloneWizard$5.run(AbstractGitCloneWizard.java:387)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.jgit.errors.TransportException: Packfile is truncated.
    at org.eclipse.jgit.transport.BasePackFetchConnection.doFetch(BasePackFetchConnection.java:370)
    at org.eclipse.jgit.transport.TransportHttp$SmartHttpFetchConnection.doFetch(TransportHttp.java:783)
    at org.eclipse.jgit.transport.BasePackFetchConnection.fetch(BasePackFetchConnection.java:301)
    at org.eclipse.jgit.transport.BasePackFetchConnection.fetch(BasePackFetchConnection.java:291)
    at org.eclipse.jgit.transport.FetchProcess.fetchObjects(FetchProcess.java:247)
    at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:160)
    at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
    at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138)
    at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130)
    ... 7 more
Caused by: java.io.EOFException: Packfile is truncated.
    at org.eclipse.jgit.transport.PackParser.fill(PackParser.java:1138)
    at org.eclipse.jgit.transport.PackParser.access$000(PackParser.java:97)
    at org.eclipse.jgit.transport.PackParser$InflaterStream.read(PackParser.java:1663)
    at java.io.InputStream.read(Unknown Source)
    at org.eclipse.jgit.transport.PackParser.whole(PackParser.java:983)
    at org.eclipse.jgit.transport.PackParser.indexOneObject(PackParser.java:916)
    at org.eclipse.jgit.transport.PackParser.parse(PackParser.java:487)
    at org.eclipse.jgit.internal.storage.file.ObjectDirectoryPackParser.parse(ObjectDirectoryPackParser.java:194)
    at org.eclipse.jgit.transport.PackParser.parse(PackParser.java:448)
    at org.eclipse.jgit.transport.BasePackFetchConnection.receivePack(BasePackFetchConnection.java:762)
    at org.eclipse.jgit.transport.BasePackFetchConnection.doFetch(BasePackFetchConnection.java:363)
    ... 15 more
like image 815
domen Avatar asked Feb 15 '15 17:02

domen


People also ask

How difficult is it to clone a git repository with JGit?

While cloning a repository with JGit isn’t particularly difficult, there are a few details that might be worth noting. And because there are few online resources on the subject, this article summarizes how to use the JGit API to clone from an existing Git repository.

Why am I having trouble cloning a repository?

If you're having trouble cloning a repository, check these common errors. There are a few common errors when using HTTPS with Git. These errors usually indicate you have an old version of Git, or you don't have access to the repository.

How does the clone command work in Git?

By default, the clone command creates a single local branch. It looks at the HEAD ref of the remote repository and creates a local branch with the same name as the remote branch referenced by it.

Why can't I clone a repository using SSH?

If you've previously set up SSH keys, you can use the SSH clone URL instead of HTTPS. For more information, see " About remote repositories ." If you see this error when cloning a repository, it means that the repository does not exist or you do not have permission to access it. There are a few solutions to this error, depending on the cause.


Video Answer


1 Answers

If somebody is getting the same error. The problem was that my internet connection was too slow, and the server has a timeout of 30 seconds. Tried on a faster internet, worked fine.

like image 86
domen Avatar answered Oct 09 '22 00:10

domen