System.IO.IOException: The file exists

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
Busboy
Posts: 55
Joined: Wed Mar 31, 2004 6:25 am

System.IO.IOException: The file exists

Post by Busboy » Tue Jul 11, 2006 2:16 am

Hi,
I am having trouble with getting files from my Vault server. This problem only occur when using the commandline client, not the GUI client.
'C:\Program Files\SourceGear\Vault Client\vault.exe' -host vaultpc -user builder -password secret -repository Source get $/Source -makereadonly -setfiletime modification -merge overwrite -unchanged undocheckout -destpath D:\Source -verbose
<vault>
<error>
The file exists.

</error>
<exception>
System.IO.IOException: The file exists.

at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.Path.GetTempFileName()
at VaultClientOperationsLib.ClientInstance.ProcessGetFileRequests(GetFileInfo[] infos, MakeWritableType makeWritable, SetFileTimeType setFileTime, MergeType merge, Boolean updateHiddenFilesOnly, String ancestorFullPath, Boolean flat, String ancestorDiskPath, OverwritePrompt PromptData, Boolean isLabelGet, String currentPathToLabelItem, Int64 labelID, Boolean isRetry, Boolean isGetByDisplayVersion)
at VaultClientOperationsLib.ClientInstance.GetToNonWorkingFolder(VaultClientFile[] files, Boolean forceLatest, Boolean overwrite, MakeWritableType makeWritable, SetFileTimeType setFileTime, String ancestorFullPath, String ancestorDiskPath, OverwritePrompt PromptData)
at VaultClientOperationsLib.ClientInstance.GetToNonWorkingFolder(VaultClientFolder folder, Boolean recursive, Boolean forceLatest, Boolean overwrite, MakeWritableType makeWritable, SetFileTimeType setFileTime, String ancestorDiskPath, OverwritePrompt PromptData)
at VaultCmdLineClient.VaultCmdLineClient.performGet(ArrayList strItemArray)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommandGet(ArrayList strItemArray)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Args curArg)
at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)
</exception>
<result success='no' />
</vault>
In the sgvault.log file there are no abnormal entries. Only builder user logging in and out.
No files are located in D:\Source when this problem arise.

Any ideas on how to solve this problem?

Regards,
Kim

Busboy
Posts: 55
Joined: Wed Mar 31, 2004 6:25 am

Post by Busboy » Tue Jul 11, 2006 5:30 am

Additional information that might help solving the problem:
The error message also occur on setworkingfolder
Building using scheduled tasks with my own credentials
Building project step 'Set Working Folder'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host vaultpc -user builder -password **** -repository spirit setworkingfolder $/Baseline -merge overwrite -unchanged undocheckout -exclusive D:\Spirit
<vault>
<error>
The file exists.

</error>
<exception>
System.IO.IOException: The file exists.

at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.Path.GetTempFileName()
at VaultClientNetLib.VaultConnection.GetRepositoryStructure(Int32 nRepID, Int64 nSrcRevision, Int64 nDestRevision, Int64& nReturnDestRevision, DateTime dtLastCheck, DateTime& dtLatestCheck, VaultRepositoryDelta& rd)
at VaultClientOperationsLib.ClientInstance.Refresh(Int64 knownServerRevision, Boolean isRetry, VaultRepositoryDelta delta, Int64 returnedRevision)
at VaultClientOperationsLib.ClientInstance.SetActiveRepositoryID(Int32 id, String username, String uniqueRepositoryID, Boolean doRefresh, Boolean updateKnownChangesAll)
at VaultCmdLineClient.VaultCmdLineClient.Login(Boolean bAllowAuto, Boolean bSaveSession)
at VaultCmdLineClient.VaultCmdLineClient.SetWorkingFolder(String uncheckedRepospath, String strDiskFolder, Boolean bCreateDiskPath)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Args curArg)
at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)
</exception>
<result success="no" />
</vault>

Process completed with exit code -1

Building manually
Building project step 'Set Working Folder'...
"C:\Program Files\SourceGear\Vault Client\vault.exe" -host vaultpc -user builder -password **** -repository spirit setworkingfolder $/Baseline -merge overwrite -unchanged undocheckout -exclusive D:\Spirit
<vault>
<listworkingfolders>
<workingfolder reposfolder="$/Baseline" localfolder="D:\Spirit" />
</listworkingfolders>
<result success="yes" />
</vault>
After one successful setworkingfolder, the scheduled task version of the setworkingfolder will work OK.

When deleting the working-folder "D:\Spirit" folder and "C:\Documents and Settings\***\Application Data\SourceGear\Vault_1\Client" folder, the problem will reappear. This problem is repeatable and prevents me from using Vault in a scheduled build.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Tue Jul 11, 2006 10:31 am

I wasn't able to reproduce any errors with similar commands on my client machine. What version of Vault are you using? In Vault 3.1.6 we added the -workingfolder parameter which allows the creation of a temporary working folder [disk_path] instead of using -destpath. For documentation, cd to the Vault Client directory and type "Vault help Get."

Some other observations: -destpath assumes a get to a non-working folder, so if you're using -destpath and the target directory is also a working directory, it could cause some confusion.

If you're using a non-working folder, you don't have to set the working folder; just specify the destination path in the command line script with -destpath.

If you have set a working folder, then you don't need to refer to the working folder in the command -- Vault.exe uses working folder information from the client cache files.

When you're setting a working folder, the "-merge overwrite -unchanged undocheckout -exclusive" are not needed. For documentation, cd to the Vault Client directory and type "Vault help setworkingfolder."

And when you use -destpath, these parameters are not relevant: "-merge overwrite -unchanged undocheckout," since the get is to a non-working folder.

If you still have problems after modifying your scripts, post back.
Linda Bauer
SourceGear
Technical Support Manager

Locked