Working Folder Exception on ProcessCommandCheckout

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
nbuckle
Posts: 15
Joined: Thu Mar 26, 2009 1:15 pm

Working Folder Exception on ProcessCommandCheckout

Post by nbuckle » Fri Jul 13, 2012 3:42 pm

We're encountering exceptions intermittently when the following code is executed:

GetOptions getOptions2 = new GetOptions();
getOptions2.Recursive = true;
log.Debug("Checking out : " + solutionfilePath);
ServerOperations.ProcessCommandCheckout(new string[] { solutionfilePath }, true, true, getOptions2);

2012-07-13 16:01:20,510 [10] DEBUG ReconcileDependencyDialog - Checking out : $/Playstuff/branchtest/branches/branch_1.0.5.1/play.sln
2012-07-13 16:01:20,925 [10] ERROR ReconcileDependencyDialog - ReconcileDependencies() - CRASH There is no working folder specified for $/Playstuff/branchtest/branches/branch_1.0.5.1/play.sln
You can set one using SETWORKINGFOLDER or use a temporary working folder by using the -workingfolder option with GET.
at VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckout(String[] objectPaths, Boolean checkoutExclusive, Boolean getLatest, GetOptions getOptions)
at FortressBranchingAddIn.ReconcileDependencyDialog.ReconcileDependencies()

This is happening for some users although they have working folders set within the Vault client. They have all inherited the working folder from the $ (root)

I can't tell from the interface if there is a way to specify that we want to use that inherited working folder. I need suggestions please

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

Re: Working Folder Exception on ProcessCommandCheckout

Post by Beth » Fri Jul 13, 2012 3:54 pm

Are you using Vault integrated with Visual Studio also? If so, then there could be conflicting working folders or VS could be binding a project at a different level than what the working folder is set for in Vault.
Beth Kieler
SourceGear Technical Support

nbuckle
Posts: 15
Joined: Thu Mar 26, 2009 1:15 pm

Re: Working Folder Exception on ProcessCommandCheckout

Post by nbuckle » Tue Jul 24, 2012 2:14 pm

Beth,

Yes, we're using the Fortress Visual Studio Enhanced Client integration.

Here is the call I'm making in code. It's a very simple checkout on a .sln file

Code: Select all

log.Debug("Checking out the solution file started");
                    log.Debug("Vault Server Login");
                    GetOptions getOptions2 = new GetOptions();
                    getOptions2.Recursive = true;
                    bool bExclusive = true;
                    bool bGetLatest = true;                    
                    log.Debug("Checking out : " + solutionfilePath);
                    //solutionfilePath is $/Playstuff/RisPortTest/branches/APP_RPT_DEV_1.0.5.1/RisPortTest.sln
                    ServerOperations.ProcessCommandCheckout(new string[] { solutionfilePath }, bExclusive, bGetLatest, getOptions2);
                    log.Debug("Checking out : " + projectfilePath);
                    ServerOperations.ProcessCommandCheckout(new string[] { projectfilePath }, bExclusive, bGetLatest, getOptions2);
                    log.Debug("Vault Server Logout");

at the point where ServerOperations.ProcessCommandCheckout is called I get the following exception

2012-07-23 15:58:29,474 [26] DEBUG ReconcileDependencyDialog - Checking out : $/Playstuff/RisPortTest/branches/APP_RPT_DEV_1.0.5.1/RisPortTest.sln
2012-07-23 15:58:29,655 [26] ERROR ReconcileDependencyDialog - ReconcileDependencies() - CRASH
There is no working folder specified for $/Playstuff/RisPortTest/branches/APP_RPT_DEV_1.0.5.1/RisPortTest.sln
You can set one using SETWORKINGFOLDER or use a temporary working folder by using the -workingfolder option with GET.
at VaultClientIntegrationLib.ServerOperations.ProcessCommandCheckout(String[] objectPaths, Boolean checkoutExclusive, Boolean getLatest, GetOptions getOptions)
at FortressBranchingAddIn.ReconcileDependencyDialog.ReconcileDependencies()


I do not encounter this exception on my machine, but when I deploy, other folks on my team encounter the above mentioned exception

Based on your post, I compared side my side the working folder bindings in VS2010 with the Fortress client. I also attempted to checkout the file directly from fortress with no issues or complaints about a working folder.

Thank you for your help Beth

nbuckle
Posts: 15
Joined: Thu Mar 26, 2009 1:15 pm

Re: Working Folder Exception on ProcessCommandCheckout

Post by nbuckle » Wed Jul 25, 2012 8:28 am

Just a bit of additional information.

I was able to successfully check out the offending file via the vault client as well as via visual studio with no issues.

I also used the command line to perform the checkout with no errors. No exceptions related to working folder settings

nbuckle
Posts: 15
Joined: Thu Mar 26, 2009 1:15 pm

Re: Working Folder Exception on ProcessCommandCheckout

Post by nbuckle » Thu Jul 26, 2012 1:15 pm

is anyone looking at this?

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

Re: Working Folder Exception on ProcessCommandCheckout

Post by Beth » Thu Jul 26, 2012 2:07 pm

The working folder is machine and user specific, so you may need to add the setting of working folders to your code.

When you were getting a success with the Vault GUI client, were you on the exact same machine, using the exact same user, checking out to the exact same location, and connecting to the same Vault server?
Beth Kieler
SourceGear Technical Support

nbuckle
Posts: 15
Joined: Thu Mar 26, 2009 1:15 pm

Re: Working Folder Exception on ProcessCommandCheckout

Post by nbuckle » Thu Jul 26, 2012 3:48 pm

I did my troubleshooting on the machines which were causing the exception to be thrown. I was able to checkout successfully on these machines using the Vault GUI client, Visual Studio 2010, and the command line tool. All test were performed with the machine users log in credentials to connect to the Vault server and yes we're all connected to the same server.

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

Re: Working Folder Exception on ProcessCommandCheckout

Post by Beth » Fri Jul 27, 2012 11:01 am

Just to make sure I understand then, the issue will happen on a machine that the command-line client appears to be working fine on, correct?

Is the working folder set at $ or on individual folders? Is it possible that the errors are happening just on areas that don't have a working folder or that any area is missing a working folder?

Can you have a particular file work fine and that same file then give an error (same user/machine/working folder/etc)?
Beth Kieler
SourceGear Technical Support

nbuckle
Posts: 15
Joined: Thu Mar 26, 2009 1:15 pm

Re: Working Folder Exception on ProcessCommandCheckout

Post by nbuckle » Mon Jul 30, 2012 2:05 pm

I was able to work around this issue by adding these additional lines of code:

Code: Select all

WorkingFolder currentWorkingFolder = null;

//Verify working folder exist for the file
VaultClientFolder vaultFolder = ServerOperations.ProcessCommandListFolder(projectRepositoryPathWithoutCodeLine + "/branches/" + targetBranchName, true);

if (vaultFolder != null)
    currentWorkingFolder = ServerOperations.client.ClientInstance.GetWorkingFolder(vaultFolder);

if (currentWorkingFolder == null)
    ServerOperations.SetWorkingFolder(projectRepositoryPathWithoutCodeLine + "/branches/" + targetBranchName, _solutionWorkingFilePath, false, true);
Thanks for helping me work through this

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

Re: Working Folder Exception on ProcessCommandCheckout

Post by Beth » Mon Jul 30, 2012 3:44 pm

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

Post Reply