Checkin error "failed to pend changes ... the same name already exists."

Dec 15, 2012 at 1:31 AM

I am getting the error "failed to pend changes to TFS due to the following errors... Cannot create <directory> because a file or directory with the same name already exists."

I tried -renameMode=justFiles, in case it was similar to "The item ... already exists" error (another thread), but got the same errors.

Note that the directories it has issues with change each time it occurs, so maybe a race condition?

Any suggestions?

PS C:\code\Positive2013> git tf checkin>
Connecting to TFS...
Username: sgryphon@live.com
Password:
Checking in to $/Positive2013/Main: 0%, commit 6ab1e59
git-tf: failed to pend changes to TFS due to the following errors. Please fix the errors and retry check in.
C:\Code\Positive2013\.git\tf\43b87e0\PositiveSolution\packages\NSubstitute.1.4.1.0\lib\NET35\NSubstitute.XML: Cannot cre
ate "C:\Code\Positive2013\.git\tf\43b87e0\PositiveSolution\packages\NSubstitute.1.4.1.0\lib\NET35" because a file or dir
ectory with the same name already exists.
C:\Code\Positive2013\.git\tf\43b87e0\PositiveXcode\Positive 2013.xcodeproj\xcuserdata\sly.xcuserdatad\xcschemes\Positive
 2013.xcscheme: Cannot create "C:\Code\Positive2013\.git\tf\43b87e0\PositiveXcode\Positive 2013.xcodeproj\xcuserdata\sly
.xcuserdatad\xcschemes" because a file or directory with the same name already exists.
PS C:\code\Positive2013> git tf checkin
Connecting to TFS...
Username: sgryphon@live.com
Password:
Checking in to $/Positive2013/Main: 0%, commit 6ab1e59
git-tf: failed to pend changes to TFS due to the following errors. Please fix the errors and retry check in.
C:\Code\Positive2013\.git\tf\edd27be\PositiveXcode\Positive 2013.xcodeproj\project.xcworkspace\xcuserdata\sly.xcuserdata
d\WorkspaceSettings.xcsettings: Cannot create "C:\Code\Positive2013\.git\tf\edd27be\PositiveXcode\Positive 2013.xcodepro
j\project.xcworkspace\xcuserdata\sly.xcuserdatad" because a file or directory with the same name already exists.
C:\Code\Positive2013\.git\tf\edd27be\PositiveSolution\packages\NSubstitute.1.4.1.0\lib\NET35\NSubstitute.XML: Cannot cre
ate "C:\Code\Positive2013\.git\tf\edd27be\PositiveSolution\packages\NSubstitute.1.4.1.0\lib\NET35" because a file or dir
ectory with the same name already exists.
PS C:\code\Positive2013> git tf checkin
Connecting to TFS...
Username: sgryphon@live.com
Password:
Checking in to $/Positive2013/Main: 0%, commit 6ab1e59
git-tf: failed to pend changes to TFS due to the following errors. Please fix the errors and retry check in.
C:\Code\Positive2013\.git\tf\52161b9\PositiveXcode\Positive 2013.xcodeproj\project.xcworkspace\xcuserdata\sly.xcuserdata
d\WorkspaceSettings.xcsettings: Cannot create "C:\Code\Positive2013\.git\tf\52161b9\PositiveXcode\Positive 2013.xcodepro
j\project.xcworkspace\xcuserdata\sly.xcuserdatad" because a file or directory with the same name already exists.
PS C:\code\Positive2013> git tf checkin
Connecting to TFS...
Username: sgryphon@live.com
Password:
Checking in to $/Positive2013/Main: 0%, commit 6ab1e59
git-tf: failed to pend changes to TFS due to the following errors. Please fix the errors and retry check in.
C:\Code\Positive2013\.git\tf\0ece2ad\PositiveSolution\packages\NSubstitute.1.4.1.0\lib\NET35\NSubstitute.dll: Cannot cre
ate "C:\Code\Positive2013\.git\tf\0ece2ad\PositiveSolution\packages\NSubstitute.1.4.1.0\lib\NET35" because a file or dir
ectory with the same name already exists.
PS C:\code\Positive2013>

 

Dec 15, 2012 at 1:32 AM

Here is the log file. It does mention pool threads, so race condition is correct?

2012-12-15 12:15:33,152 INFO  [main] (com.microsoft.tfs.jni.loader.NativeLoader) Loaded C:\Apps\Git-TF\native\win32\x86\native_auth.dll from user-specified directory
2012-12-15 12:15:33,282 INFO  [main] (com.microsoft.tfs.core.config.httpclient.DefaultHTTPClientFactory) HttpClient configured for https://sgryphon.visualstudio.com/DefaultCollection, authenticating as logged in user
2012-12-15 12:15:44,718 INFO  [main] (com.microsoft.tfs.jni.loader.NativeLoader) Loaded C:\Apps\Git-TF\native\win32\x86\native_console.dll from user-specified directory
2012-12-15 12:15:46,616 INFO  [main] (com.microsoft.tfs.core.config.httpclient.DefaultHTTPClientFactory) HttpClient configured for https://sgryphon.visualstudio.com/DefaultCollection, authenticating as sgryphon@live.com
2012-12-15 12:15:49,284 INFO  [main] (com.microsoft.tfs.jni.loader.NativeLoader) Loaded C:\Apps\Git-TF\native\win32\x86\native_synchronization.dll from user-specified directory
2012-12-15 12:15:51,101 INFO  [main] (com.microsoft.gittf.core.tasks.UpdateLocalVersionTask) Calling server to update local versions
2012-12-15 12:15:54,347 INFO  [main] (com.microsoft.tfs.jni.loader.NativeLoader) Loaded C:\Apps\Git-TF\native\win32\x86\native_filesystem.dll from user-specified directory
2012-12-15 12:15:56,920 INFO  [pool-1-thread-1] (com.microsoft.tfs.jni.loader.NativeLoader) Loaded C:\Apps\Git-TF\native\win32\x86\native_registry.dll from user-specified directory
2012-12-15 12:19:47,453 WARN  [pool-1-thread-14] (com.microsoft.tfs.core.clients.versioncontrol.engines.internal.workers.GetDownloadWorker) Converted to non-fatal
com.microsoft.tfs.core.clients.versioncontrol.exceptions.VersionControlException: Cannot create "C:\Code\Positive2013\.git\tf\d212e73\PositiveSolution\packages\NSubstitute.1.4.1.0\lib\NET35" because a file or directory with the same name already exists.
 at com.microsoft.tfs.core.clients.versioncontrol.engines.internal.workers.GetDownloadWorker.downloadFile(GetDownloadWorker.java:295)
 at com.microsoft.tfs.core.clients.versioncontrol.engines.internal.workers.GetDownloadWorker.call(GetDownloadWorker.java:164)
 at com.microsoft.tfs.core.clients.versioncontrol.engines.internal.workers.GetDownloadWorker.call(GetDownloadWorker.java:73)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at com.microsoft.tfs.core.clients.versioncontrol.internal.concurrent.BoundedExecutor$1.run(BoundedExecutor.java:96)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
2012-12-15 12:19:47,469 INFO  [pool-1-thread-14] (com.microsoft.gittf.client.clc.commands.CheckinCommand) C:\Code\Positive2013\.git\tf\d212e73\PositiveSolution\packages\NSubstitute.1.4.1.0\lib\NET35\NSubstitute.XML: Cannot create "C:\Code\Positive2013\.git\tf\d212e73\PositiveSolution\packages\NSubstitute.1.4.1.0\lib\NET35" because a file or directory with the same name already exists.
2012-12-15 12:19:47,469 WARN  [pool-1-thread-14] (com.microsoft.tfs.core.clients.versioncontrol.engines.internal.workers.GetDownloadWorker) Converted to non-fatal
com.microsoft.tfs.core.clients.versioncontrol.exceptions.VersionControlException: Cannot create "C:\Code\Positive2013\.git\tf\d212e73\PositiveXcode\Positive 2013.xcodeproj\xcuserdata\sly.xcuserdatad\xcschemes" because a file or directory with the same name already exists.
 at com.microsoft.tfs.core.clients.versioncontrol.engines.internal.workers.GetDownloadWorker.downloadFile(GetDownloadWorker.java:295)
 at com.microsoft.tfs.core.clients.versioncontrol.engines.internal.workers.GetDownloadWorker.call(GetDownloadWorker.java:164)
 at com.microsoft.tfs.core.clients.versioncontrol.engines.internal.workers.GetDownloadWorker.call(GetDownloadWorker.java:73)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at com.microsoft.tfs.core.clients.versioncontrol.internal.concurrent.BoundedExecutor$1.run(BoundedExecutor.java:96)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
2012-12-15 12:19:47,469 INFO  [pool-1-thread-14] (com.microsoft.gittf.client.clc.commands.CheckinCommand) C:\Code\Positive2013\.git\tf\d212e73\PositiveXcode\Positive 2013.xcodeproj\xcuserdata\sly.xcuserdatad\xcschemes\xcschememanagement.plist: Cannot create "C:\Code\Positive2013\.git\tf\d212e73\PositiveXcode\Positive 2013.xcodeproj\xcuserdata\sly.xcuserdatad\xcschemes" because a file or directory with the same name already exists.
2012-12-15 12:19:59,814 INFO  [main] (com.microsoft.gittf.client.clc.commands.CheckinCommand) No pending changes were found for $/Positive2013/Main.
2012-12-15 12:20:00,564 ERROR [main] (git-tf) Error executing task CheckinHeadCommitTask
java.lang.Exception: failed to pend changes to TFS due to the following errors. Please fix the errors and retry check in.
C:\Code\Positive2013\.git\tf\d212e73\PositiveSolution\packages\NSubstitute.1.4.1.0\lib\NET35\NSubstitute.XML: Cannot create "C:\Code\Positive2013\.git\tf\d212e73\PositiveSolution\packages\NSubstitute.1.4.1.0\lib\NET35" because a file or directory with the same name already exists.
C:\Code\Positive2013\.git\tf\d212e73\PositiveXcode\Positive 2013.xcodeproj\xcuserdata\sly.xcuserdatad\xcschemes\xcschememanagement.plist: Cannot create "C:\Code\Positive2013\.git\tf\d212e73\PositiveXcode\Positive 2013.xcodeproj\xcuserdata\sly.xcuserdatad\xcschemes" because a file or directory with the same name already exists.
 at com.microsoft.gittf.core.util.WorkspaceOperationErrorListener.validate(WorkspaceOperationErrorListener.java:109)
 at com.microsoft.gittf.core.tasks.pendDiff.PendDifferenceTask.pendBatchRenames(PendDifferenceTask.java:879)
 at com.microsoft.gittf.core.tasks.pendDiff.PendDifferenceTask.pendRenames(PendDifferenceTask.java:797)
 at com.microsoft.gittf.core.tasks.pendDiff.PendDifferenceTask.pendChanges(PendDifferenceTask.java:584)
 at com.microsoft.gittf.core.tasks.pendDiff.PendDifferenceTask.run(PendDifferenceTask.java:259)
 at com.microsoft.gittf.core.tasks.framework.TaskExecutor.execute(TaskExecutor.java:145)
 at com.microsoft.gittf.core.tasks.CheckinHeadCommitTask.run(CheckinHeadCommitTask.java:450)
 at com.microsoft.gittf.core.tasks.framework.TaskExecutor.execute(TaskExecutor.java:145)
 at com.microsoft.gittf.client.clc.commands.CheckinCommand.run(CheckinCommand.java:215)
 at com.microsoft.gittf.client.clc.Main.main(Main.java:328)

Dec 17, 2012 at 10:23 AM

Looks like the same problem I had (http://gittf.codeplex.com/discussions/404748)
try

    --renamemode=justFIles

or

    --renamemode=none

Dec 21, 2012 at 7:30 AM

Thanks!

I had seen the other post "The item ... already exists" and already tried --renamemode=justFiles (as mentioned above, but note the parameter name needs to be in all lower case), but not the other option.

So, I tried --renamemode=none and it was able to get past the checkin it was having trouble with. Note that I have --deep set by default, and am importing an existing repository with lots of past changes. I presume --renamemode=none does no rename detection and just treats all the changes as deletes/adds (in TFS the changeset reports 251 files added, 252 files deleted :-).

However, I didn't want all of my checkins to have rename turned off so after it had got past the difficult one I hit Ctrl-C to cancel (so I could do the other checkins without the flag). I wasn't quite quick enough however, and it still pushed up another four small changesets.

That, of course, then caused me problems as I then had a lock hanging around from the checkin I cancelled and got the error "git-tf: Could not lock $/..." when trying to checkin again. Of course that wasn't too hard to fix (open up Visual Studio, connect to TFS and Undo checkout to clear the lock).

Does anyone know how to filter/limit the checkin to a particular changeset/point in time? i.e. when doing git tf checkin with the --deep option (which I have as default) it would have been helpful to only checkin the single changeset that was having problems with the --renamemode=none and then stop automatically.

Or does anyone know if it would work if I simply set my working directory back to the old version, or does checkin do all changesets up to HEAD?

Sly

P.S. The other weird thing I just noticed is on the visualstudio.com website (I am using git-tf to load onto TFS in the cloud) the commits are listed for "Saturday, 22 December 2012" even though today is only Friday 21 Dec! (And I am in Australia, so almost at the front of the timezones, so it is definitely not 22 Dec anywhere yet). Inside Visual Studio appears to have the right time, so it could just be something weird on the visualstudio.com website.

 

Developer
Dec 21, 2012 at 2:55 PM

Checkin will always examine HEAD -- if you want to push up only a single commit, feel free to reset to that commit, use renameMode=none, then reset back and continue from there.

Thanks for the note on the visualstudio.com website.  I passed it on to the appropriate people and there should be a fix coming in the next update.

Thanks-

-ed

Dec 22, 2012 at 1:43 AM

Good to know that. I will give it a try.

There was still an actual issue, however, trying to process the renames. Should I log it in the Issue Tracker?