Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Constant errors when checking out and pulling(EGit can't rename files during checkout/pull/reset)
Constant errors when checking out and pulling [message #1767932] Wed, 12 July 2017 08:40 Go to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 33
Registered: October 2012
Location: Zürich, Switzerland
Member
Practically every time when I do a checkout, a pull or (since the previous messed up my local copy) a reset I keep getting errors like the following:

Could not rename file W:\git\rcs\ch.sbb.alea\jars\._ch.sbb.alea.jar8814896191113171081.tmp to W:\git\rcs\ch.sbb.alea\jars\ch.sbb.alea.jar


Afterwards my EGit typically shows dozens or even hundreds of unstaged changes on files that I never touched. It seems as if "something" is keeping a lock onto temporary files while git is working on them and then the renaming of these temporary files to their final names fails (and then EGit completely derails...).
Any idea what could be causing this and how to make this more reliable? Right now EGit is practically unusable!

I found a similar bug described in 2015 guessing that this might be due to a race condition between the egit client and the .jar indexer. Could that still be the case here? Can one tame the indexer to wait or not lock these files?

This is using EGit 4.6.1.201703071140-r on Neon (M20161124) on Windows 7 (x64).

[Updated on: Wed, 12 July 2017 08:45]

Report message to a moderator

Re: Constant errors when checking out and pulling [message #1767943 is a reply to message #1767932] Wed, 12 July 2017 10:00 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1032
Registered: July 2009
Senior Member
- which filesystem are you using ?
- can you try to trace which processes are accessing the files which can't be renamed ?
On Linux you should be able to trace using strace, on Mac dtrace, AFAIK on Windows you can use ProcessMonitor.
Re: Constant errors when checking out and pulling [message #1768007 is a reply to message #1767943] Wed, 12 July 2017 19:08 Go to previous messageGo to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 33
Registered: October 2012
Location: Zürich, Switzerland
Member
I am using NTFS.

Re. the monitoring: I consider that practically impossible since those temporary files have "randomized" names (here e.g. "_ch.sbb.alea.jar8814896191113171081.tmp") which can not be guessed in advance and are spread over all the .lib or .jar directories over 100+ projects in our case.
How would one tell any tool to monitor these files? I'll try to figure out which process holds that file when it happens again, but I have very little hope that the file is still locked by the time I manage to copy-paste that filename into a command line or some entry field.

[Updated on: Wed, 12 July 2017 19:09]

Report message to a moderator

Re: Constant errors when checking out and pulling [message #1768025 is a reply to message #1768007] Thu, 13 July 2017 06:12 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29545
Registered: July 2009
Senior Member
I've seen problems like this with p2 that were caused by the virus scanner scanning and thereby locking the file. I spent a long time debugging and because it's timing related: if I stepped over the whole method that created the temp file and did a File.renameTo, the problem would happen, but if I stepped the individual lines, the problem would no longer happen... I told the virus scanner to exclude the folders involved...
Re: Constant errors when checking out and pulling [message #1768026 is a reply to message #1768025] Thu, 13 July 2017 06:29 Go to previous messageGo to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 33
Registered: October 2012
Location: Zürich, Switzerland
Member
Hm - good point! I'll make sure that my eclipse workspaces are excluded from AV scanning and then I'll report whether that changes anything. Thanks for that hint!
Re: Constant errors when checking out and pulling [message #1770514 is a reply to message #1768026] Sun, 13 August 2017 17:16 Go to previous messageGo to next message
Michael Moser is currently offline Michael MoserFriend
Messages: 33
Registered: October 2012
Location: Zürich, Switzerland
Member
Just wanted to thank again for the hint re. the virus scanner holding a lock on temp. files. I meanwhile excluded the relevant folder from being scanned and that indeed seems to have fixed the issue! I finally can reliably switch different branches without randomly ending up with a completely corrupted egit status.
Highly appreciated your help!

[Updated on: Sun, 13 August 2017 17:17]

Report message to a moderator

Re: Constant errors when checking out and pulling [message #1771231 is a reply to message #1770514] Wed, 23 August 2017 07:00 Go to previous messageGo to next message
Bjorn-Willy  Arntzen is currently offline Bjorn-Willy ArntzenFriend
Messages: 8
Registered: August 2017
Junior Member
I have the same problem. After going to OXYGENE with EGit 4.8.0, it almost impossible to do simple git actions. Getting this kind of errors a lot

Using : Git integration for Eclipse 4.8.0.201706111038-r org.eclipse.egit.feature.group Eclipse EGit

example here:

Here I updated a file, and then tried to do a Replace With HEAD Revision

!ENTRY org.eclipse.core.jobs 4 2 2017-08-23 08:51:01.430
!MESSAGE An internal error occurred during: "Discard Changes".
!STACK 0
org.eclipse.jgit.api.errors.JGitInternalException: Checkout conflict with file: pom.xml
at org.eclipse.jgit.api.CheckoutCommand.checkoutPath(CheckoutCommand.java:514)
at org.eclipse.jgit.api.CheckoutCommand.access$200(CheckoutCommand.java:128)
at org.eclipse.jgit.api.CheckoutCommand$2.apply(CheckoutCommand.java:500)
at org.eclipse.jgit.dircache.DirCacheEditor.applyEdits(DirCacheEditor.java:177)
at org.eclipse.jgit.dircache.DirCacheEditor.finish(DirCacheEditor.java:130)
at org.eclipse.jgit.dircache.BaseDirCacheEditor.commit(BaseDirCacheEditor.java:273)
at org.eclipse.jgit.dircache.DirCacheEditor.commit(DirCacheEditor.java:124)
at org.eclipse.jgit.api.CheckoutCommand.checkoutPathsFromCommit(CheckoutCommand.java:505)
at org.eclipse.jgit.api.CheckoutCommand.checkoutPaths(CheckoutCommand.java:432)
at org.eclipse.jgit.api.CheckoutCommand.call(CheckoutCommand.java:207)
at org.eclipse.egit.core.op.DiscardChangesOperation.discardChanges(DiscardChangesOperation.java:205)
at org.eclipse.egit.core.op.DiscardChangesOperation.discardChanges(DiscardChangesOperation.java:162)
at org.eclipse.egit.core.op.DiscardChangesOperation.access$0(DiscardChangesOperation.java:150)
at org.eclipse.egit.core.op.DiscardChangesOperation$1.run(DiscardChangesOperation.java:143)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
at org.eclipse.egit.core.op.DiscardChangesOperation.execute(DiscardChangesOperation.java:146)
at org.eclipse.egit.ui.internal.actions.DiscardChangesActionHandler$1.runInWorkspace(DiscardChangesActionHandler.java:81)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: java.io.IOException: Could not rename file C:\dev\git\autostart-core\._pom.xml6748537022159573126.tmp to C:\dev\git\autostart-core\pom.xml
at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1359)
at org.eclipse.jgit.api.CheckoutCommand.checkoutPath(CheckoutCommand.java:511)
... 19 more
Caused by: java.io.IOException: Could not rename file C:\dev\git\autostart-core\._pom.xml6748537022159573126.tmp to C:\dev\git\autostart-core\pom.xml
at org.eclipse.jgit.util.FileUtils.rename(FileUtils.java:287)
at org.eclipse.jgit.dircache.DirCacheCheckout.checkoutEntry(DirCacheCheckout.java:1356)
... 20 more
Re: Constant errors when checking out and pulling [message #1771773 is a reply to message #1771231] Wed, 30 August 2017 10:13 Go to previous messageGo to next message
Bjorn-Willy  Arntzen is currently offline Bjorn-Willy ArntzenFriend
Messages: 8
Registered: August 2017
Junior Member
I have turned off my virus software, but still this occurs a lot. Often I must close my eclipse project, og do the git command line tools. They works as designed.

I suspect eclipse windows oxygen is holding files, as the command line tool my fail, and if closing eclipse, it works again.
Re: Constant errors when checking out and pulling [message #1771774 is a reply to message #1771231] Wed, 30 August 2017 10:13 Go to previous messageGo to next message
Bjorn-Willy  Arntzen is currently offline Bjorn-Willy ArntzenFriend
Messages: 8
Registered: August 2017
Junior Member
I have turned off my virus software, but still this occurs a lot. Often I must close my eclipse project, og do the git command line tools. They works as designed.

I suspect eclipse windows oxygen is holding files, as the command line tool my fail, and if closing eclipse, it works again.
Re: Constant errors when checking out and pulling [message #1772839 is a reply to message #1771774] Sat, 16 September 2017 17:07 Go to previous messageGo to next message
Bjorn-Willy  Arntzen is currently offline Bjorn-Willy ArntzenFriend
Messages: 8
Registered: August 2017
Junior Member
I have disabled the location of my git checkout from the on-access virus scanning, so this must be a bug in EGIT 4.8.0. I also have discovered that this problem often occur when the updated file is open in eclipse.

Using: Git integration for Eclipse 4.8.0.201706111038-r org.eclipse.egit.feature.group Eclipse EGit
Re: Constant errors when checking out and pulling [message #1774526 is a reply to message #1772839] Mon, 16 October 2017 19:35 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1032
Registered: July 2009
Senior Member
on Windows this is typically caused by some open file handle on the file EGit tries to change during checkout.
Git and also JGit implement transactional checkout by first checking out the requested file version into a temporary file which is then
renamed to the target file name using the file system's atomic rename operation.
So monitor which process is having an open file handle on the target file name in order to find out why the rename fails.
Re: Constant errors when checking out and pulling [message #1776033 is a reply to message #1774526] Thu, 09 November 2017 13:56 Go to previous messageGo to next message
Bjorn-Willy  Arntzen is currently offline Bjorn-Willy ArntzenFriend
Messages: 8
Registered: August 2017
Junior Member
Well, this is VERY annoying. Have turned off all virus checks, using only eclipse, but it's almost impossible to pull files from out git server with eclipse. Using commandline git works fine, so I really thing it's a eclipse issue. Have tried to monitor files, but the files only exists for a fractional of a second, so it's not possible decide who's holding the file.

As I recall this never happened before egit v4.8.0 (isch)

[Updated on: Thu, 09 November 2017 13:57]

Report message to a moderator

Re: Constant errors when checking out and pulling [message #1776037 is a reply to message #1776033] Thu, 09 November 2017 14:49 Go to previous messageGo to next message
Bjorn-Willy  Arntzen is currently offline Bjorn-Willy ArntzenFriend
Messages: 8
Registered: August 2017
Junior Member
Currently 80% of my project refuses to execute a git pull from eclipse. It I close them in eclipse, and just execute a 'git pull' from my git bash command line, everything works fine, no errors.... But it's a stupid way of getting a workaround...
Re: Constant errors when checking out and pulling [message #1776532 is a reply to message #1776037] Fri, 17 November 2017 11:43 Go to previous message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 80
Registered: August 2016
Member
Maybe bug 526494?
Previous Topic:Inconsistency between Egit and GitHub
Next Topic:Synchronization with FETCH_HEAD does not refresh
Goto Forum:
  


Current Time: Sat Sep 22 23:24:20 GMT 2018

Powered by FUDForum. Page generated in 0.02516 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top