Can't UNSETWORKINGFOLDER

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
BSayatovic
Posts: 47
Joined: Thu Jun 25, 2009 12:02 pm

Can't UNSETWORKINGFOLDER

Post by BSayatovic » Mon Oct 28, 2013 7:50 am

I'm running Jenkins as a continuous integration server, leveraging the vault.exe command line.

We've recently renamed some branches. "Prod" got renamed to "G.12", and "QA" got renamed to "Prod". Now when the CI script attempts to set the working folder for "Prod" to the workspace path we use for production builds, it complains that another repository path is already set to that same path:

Code: Select all

[workspace] $ C:\Progra~2\SourceGear\VaultC~1\vault.exe SETWORKINGFOLDER -host vault.creditinfonet.com -username XXXXXXXX -password YYYYYYYY -repository ZZZZZZZZ -forcesubfolderstoinherit $/Gatwick/branches/Prod "C:\.hudson\jobs\Prod\workspace"
Exit code: -1
Exit code -1 unsuccessful; throwing IOException: <vault>
  <error>
    <exception>VaultClientOperationsLib.WorkingFolderConflictException: The following repository path is already assigned to this working folder: $/branches/G.12
   at VaultClientIntegrationLib.ServerOperations.SetWorkingFolder(String repositoryFolderPath, String diskPath, Boolean createDiskPath, Boolean forceSubfoldersToInherit)
   at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Args curArg)
   at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)</exception>
  </error>
  <result>
    <success>False</success>
  </result>
</vault>
I've tried everything I can to unset the working folder:
  • vault.exe UNSEWORKINGFOLDER as user XXXXXXXX
  • runas /user:XXXXXXXX vault.exe UNSETWORKINGFOLDER
  • Run VaultGUIClient.exe, log in as XXXXXXXX, unset working folder
  • Run VaultGUIClient.exe, log in as XXXXXXXX, set working folder to another path
  • runas /user:XXXXXXXX VaultGUIClient.exe, log in as XXXXXXXX, unset working folder
  • runas /user:XXXXXXXX VaultGUIClient.exe, log in as XXXXXXXX, set working folder to another path
No matter what I try, I can't get the local path that had been mapped to $/branches/Prod before Prod got renamed to G.12 to be cleared so I can re-map it to a new branch of the same name.

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

Re: Can't UNSETWORKINGFOLDER

Post by lbauer » Mon Oct 28, 2013 12:45 pm

You may need to delete the cache file that stores the location of the working folder.
First, find the repository GUID with this query:

use sgvault
go
select * from tblrepositories
go

The file is in the User's local settings folder on the client machine. On Windows 7, for instance:

C:\Users\[WindowsUsername]\AppData\Local\SourceGear\VaultPro_1\Client\{Repository GUID}\[vaultuser]

The file is:

CacheMember_WorkingFolderAssignments

Delete that file. The Vault client should be closed before you make any changes to the cache.
Linda Bauer
SourceGear
Technical Support Manager

SlyW
Posts: 16
Joined: Fri Feb 17, 2006 4:57 pm

Re: Can't UNSETWORKINGFOLDER

Post by SlyW » Mon Apr 16, 2018 3:25 pm

Vault Standard version 10.0.1.793

Not sure what happened, but we are now in a similar situation.

Our Jenkins server reports the following:

Code: Select all

[ComposevNextDemoBuild] $ "C:\Program Files (x86)\SourceGear\Vault Client\vault.exe" GET -host srv-dcs-vss -user builduser -password ******** -repository Compose__Base -makewritable -merge overwrite -setfiletime checkin -nonworkingfolder S:\ComposevNextDemoBuild $/Compose/vNext
<vault>
  <error>
    <exception>System.Exception: You have supplied a destPath which matches the working folder already associated with this object.  Remove the destpath argument when updating a local working folder, or remove the working folder association for $/Compose/vNext
   at VaultClientIntegrationLib.GetOperations.ProcessCommandGetToLocationOutsideWorkingFolder(String[] objectPaths, GetOptions getOptions, String destPath)
   at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Args curArg)
   at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)</exception>
  </error>
  <result>
    <success>False</success>
  </result>
</vault>
I have removed _every_ CacheMember_WorkingFolderAssignments file on the server and have gone so far as to remove every SourceGear\Vault_1\Client\{repoid}\builduser\ folder entirely.

When running the command line:

Code: Select all

vault LISTWORKINGFOLDERS [...]
we get the following:

Code: Select all

<vault>
  <listworkingfolders />
  <result>
    <success>True</success>
  </result>
</vault>
So, where is Vault picking up the this mystical working folder and how can I get rid of it?!

EDIT: I can run the command to GET from a Powershell window and it succeeds. But, if I try it from within Jenkins, it fails with the above error. I have restarted Jenkins to no avail.

Second EDIT: I may have fixed my problem by crafting a call to 'vault UNSETWORKINGFOLDER ...' run from within the Jenkins Groovy script window (http://{jenkinsserver}/script). This is a very sketchy solution, but it seems to have worked - it would put my mind at ease if I knew how Vault was holding the working folder settings if the Cache file was removed entirely.
Last edited by SlyW on Mon Apr 16, 2018 3:55 pm, edited 1 time in total.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Can't UNSETWORKINGFOLDER

Post by Beth » Mon Apr 16, 2018 3:51 pm

If you're using the Vault Java command-line client, then it works differently.

Try using Unsetworkingfolder first to remove the working folder you have set. Also, you can only use nonworkingfolder where you have a working folder set. If you don't have one set, then Vault will want to set one.
Beth Kieler
SourceGear Technical Support

SlyW
Posts: 16
Joined: Fri Feb 17, 2006 4:57 pm

Re: Can't UNSETWORKINGFOLDER

Post by SlyW » Mon Apr 16, 2018 3:57 pm

Assuming the Jenkins plugin uses the Java-client vs. the Windows client, where would I look to remove the associated working folders?

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Can't UNSETWORKINGFOLDER

Post by Beth » Tue Apr 17, 2018 8:28 am

The best route there is to use the unsetworkingfolder command. You can use the listworkingfolders if you are unsure of what you have set.
Beth Kieler
SourceGear Technical Support

SlyW
Posts: 16
Joined: Fri Feb 17, 2006 4:57 pm

Re: Can't UNSETWORKINGFOLDER

Post by SlyW » Tue Apr 17, 2018 9:38 am

Thank you, Beth. I did end up getting Jenkins to issue the "unsetworkingfolder" command but it wasn't as straightforward as I had hoped (and not something easily reproducible as it required manual intervention via the Jenkins scripting page).

It sure seems that the Jenkins plug-in for Vault is different than the vault.exe command line for windows.

Anyway, thank you for the pointers and help.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Can't UNSETWORKINGFOLDER

Post by Beth » Tue Apr 17, 2018 1:24 pm

Thank you for the update. I'm happy to hear you are working.
Beth Kieler
SourceGear Technical Support

Post Reply