Bug 579793 - Fetch operation Failed
Summary: Fetch operation Failed
Status: NEW
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 5.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-28 14:24 EDT by Deep Singh Bedi CLA
Modified: 2024-04-29 10:57 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deep Singh Bedi CLA 2022-04-28 14:24:33 EDT
I have seen a similar trace in #319233. It says it was resolved but I still see it re-occurring in 5.2.0.201812061821-r version of JGIT. Please find the below trace :

2021-11-24 19:52:18 INFO  20211124195023388_APPLYINGMERGE:1453 - <font color='red'>Cannot move pack to /home/ubuntu/{someLocation}/org/{organisationName}/workspaces/XsMhfRhw3FLNaJiq/cmsDjjd1Dn9YyiQs/.git/objects/pack/pack-71ff9738a5e92b172310e50972d9dbb1e53b3c5e.pack</font>
org.eclipse.jgit.api.errors.TransportException: Cannot move pack to /home/ubuntu/{someLocation}/org/{organisationName}/workspaces/XsMhfRhw3FLNaJiq/cmsDjjd1Dn9YyiQs/.git/objects/pack/pack-71ff9738a5e92b172310e50972d9dbb1e53b3c5e.pack
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:254)
	at com.rabit.scm.GIT.doFetch(GIT.java:1441)
	at com.rabit.scm.GIT.doPull(GIT.java:1343)
	at com.rabit.scm.GIT.doUpdate(GIT.java:374)
	at com.rabit.scm.workspace.WorkspaceComponent.scmCheckout(WorkspaceComponent.java:276)
	at com.rabit.scm.workspace.WorkspaceComponent.createOrUpdateWorkspaceCheckout(WorkspaceComponent.java:106)
	at com.rabit.scm.workspace.WorkspaceServiceImpl.prepareWorkSpace(WorkspaceServiceImpl.java:276)
	at com.rabit.scm.merge.MergeRunner.run(MergeRunner.java:87)
	at com.rabit.queue.AutoRABITOrderedQueueExecutor$Task.run(AutoRABITOrderedQueueExecutor.java:136)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.eclipse.jgit.errors.TransportException: Cannot move pack to /home/ubuntu/{someLocation}/org/{organisationName}/workspaces/XsMhfRhw3FLNaJiq/cmsDjjd1Dn9YyiQs/.git/objects/pack/pack-71ff9738a5e92b172310e50972d9dbb1e53b3c5e.pack
	at org.eclipse.jgit.transport.BasePackFetchConnection.doFetch(BasePackFetchConnection.java:400)
	at org.eclipse.jgit.transport.TransportHttp$SmartHttpFetchConnection.doFetch(TransportHttp.java:1084)
	at org.eclipse.jgit.transport.BasePackFetchConnection.fetch(BasePackFetchConnection.java:323)
	at org.eclipse.jgit.transport.BasePackFetchConnection.fetch(BasePackFetchConnection.java:314)
	at org.eclipse.jgit.transport.FetchProcess.fetchObjects(FetchProcess.java:265)
	at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:163)
	at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:124)
	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1271)
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:243)
	... 11 more
Caused by: java.io.IOException: Cannot move pack to /home/ubuntu/{someLocation}/org/{organisationName}/workspaces/XsMhfRhw3FLNaJiq/cmsDjjd1Dn9YyiQs/.git/objects/pack/pack-71ff9738a5e92b172310e50972d9dbb1e53b3c5e.pack
	at org.eclipse.jgit.internal.storage.file.ObjectDirectoryPackParser.renameAndOpenPack(ObjectDirectoryPackParser.java:502)
	at org.eclipse.jgit.internal.storage.file.ObjectDirectoryPackParser.parse(ObjectDirectoryPackParser.java:209)
	at org.eclipse.jgit.transport.PackParser.parse(PackParser.java:529)
	at org.eclipse.jgit.transport.BasePackFetchConnection.receivePack(BasePackFetchConnection.java:823)
	at org.eclipse.jgit.transport.BasePackFetchConnection.doFetch(BasePackFetchConnection.java:393)
	... 19 more
Caused by: java.io.IOException: Could not rename file /home/ubuntu/{someLocation}/org/{organisationName}/workspaces/XsMhfRhw3FLNaJiq/cmsDjjd1Dn9YyiQs/.git/objects/incoming_14664731427592666144.pack to /home/ubuntu/{someLocation}/org/{organisationName}/workspaces/XsMhfRhw3FLNaJiq/cmsDjjd1Dn9YyiQs/.git/objects/pack/pack-71ff9738a5e92b172310e50972d9dbb1e53b3c5e.pack
	at org.eclipse.jgit.util.FileUtils.rename(FileUtils.java:309)
	at org.eclipse.jgit.internal.storage.file.ObjectDirectoryPackParser.renameAndOpenPack(ObjectDirectoryPackParser.java:497)
	... 23 more
2021-11-24 19:52:18 INFO  20211124195023388_APPLYINGMERGE:1363 - OrgName : {organisationName} Updating head refs
2021-11-24 19:52:18 INFO  20211124195023388_APPLYINGMERGE:1410 - <font color='red'>Invalid ref name: remotes/origin/master</font>
org.eclipse.jgit.api.errors.JGitInternalException: Invalid ref name: remotes/origin/master
	at org.eclipse.jgit.api.ResetCommand.call(ResetCommand.java:170)
	at com.rabit.scm.GIT.doPull(GIT.java:1365)
	at com.rabit.scm.GIT.doUpdate(GIT.java:374)
	at com.rabit.scm.workspace.WorkspaceComponent.scmCheckout(WorkspaceComponent.java:276)
	at com.rabit.scm.workspace.WorkspaceComponent.createOrUpdateWorkspaceCheckout(WorkspaceComponent.java:106)
	at com.rabit.scm.workspace.WorkspaceServiceImpl.prepareWorkSpace(WorkspaceServiceImpl.java:276)
	at com.rabit.scm.merge.MergeRunner.run(MergeRunner.java:87)
	at com.rabit.queue.AutoRABITOrderedQueueExecutor$Task.run(AutoRABITOrderedQueueExecutor.java:136)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Comment 1 Thomas Wolf CLA 2022-04-29 02:48:46 EDT
JGit 5.2 is four years old. Try with the newest JGit version (or with the latest 5.x version, if you absolutely must stay on Java 8).

I'm not going to spend any time on some problem in such an old JGit version.
Comment 2 Dietrich Travkin CLA 2024-04-29 10:57:25 EDT
I've experienced a similar issue with jgit version 6.8.0.2023112914.

I have cloned a git repo using SSH and some days later, when trying to fetch / pull the changes from remote, I get the following error message and stacktrace:

>'Fetch from ...-origin' has encountered a problem. Nothing to fetch.

org.eclipse.jgit.api.errors.TransportException: Nothing to fetch.
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:249)
	at org.eclipse.egit.core.op.FetchOperation.run(FetchOperation.java:134)
	at org.eclipse.egit.ui.internal.fetch.FetchOperationUI.execute(FetchOperationUI.java:111)
	at org.eclipse.egit.ui.internal.fetch.FetchOperationUI$1.performJob(FetchOperationUI.java:137)
	at org.eclipse.egit.ui.internal.jobs.RepositoryJob.run(RepositoryJob.java:59)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.eclipse.jgit.errors.TransportException: Nothing to fetch.
	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1458)
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:238)
	... 5 more

In my case, there are definitely changes to fetch / pull from remote, thus, the error message is misleading.

Executing git fetch from console worked without any problem. Thus, I think, that must be a jgit issue.

Environment details:

jgit 6.8.0.2023112914
OS: RHEL 7
Eclipse 4.30
JDK 21
git 2.36.5