Commit Failed error on checkin

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

Moderator: SourceGear

Post Reply
bob@morningdew.net
Posts: 4
Joined: Sun Aug 05, 2018 7:50 am

Commit Failed error on checkin

Post by bob@morningdew.net » Sun Aug 05, 2018 8:02 am

Hi,
l
We just upgraded to Vault version 10,and now my api calls are failing. I'm running the following command:
ServerOperations.ProcessCommandCheckIn(new string[] { srcPath }, UnchangedHandler.Checkin, bKeepCheckedOut, LocalCopyType.Leave);

and getting failure "Commit Failed".

I used to use the ProcessCommandCommit, but that seemed to change in this version and wants a changesetcollection as param 1 instead of a filepath like it used to use. (This ode worked in prev version but not in 10):
ServerOperations.ProcessCommandCommit(new string[] { srcPath }, UnchangedHandler.UndoCheckout, false, LocalCopyType.Replace, false, out committedItems);


My questions are:
1) why is my chekin failing using the ProcessCommandCheckin.
2) or how do I use the ProcessCommandCommit (how do i create a changesetcollection for this opertaion).

Thanks,

Bob

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Commit Failed error on checkin

Post by jclausius » Mon Aug 06, 2018 8:29 am

It wasn't stated what version of Vault you're coming from, but you could try replacing your API with the following:

Code: Select all

ProcessCommandCommit(string[] objectPaths, UnchangedHandler unchanged, bool keepCheckedOut, bool? removeLocalCopy, bool resolveMerge, out ChangeSetItemColl csicRemove)

Note, you don't need to allocate csicRemove, just pass in a parameter that was previously assigned to null.

In regards to the failure for

Code: Select all

ProcessCommandCheckin(string[] objectPaths, UnchangedHandler unchanged, bool keepCheckedOut, LocalCopyType localCopy, bool resolveMerge)
Is there something in your server's log that helps identify the problem?

Place a try/catch around your call to ProcessCommandCheckin(), is there any information within the exception?
Jeff Clausius
SourceGear

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Commit Failed error on checkin

Post by jclausius » Mon Aug 06, 2018 8:30 am

BTW, I have moved this to the Development Tips -> Questions (API) forum since this is more related to that subject matter.
Jeff Clausius
SourceGear

bob@morningdew.net
Posts: 4
Joined: Sun Aug 05, 2018 7:50 am

Re: Commit Failed error on checkin

Post by bob@morningdew.net » Mon Aug 06, 2018 11:28 am

I di state my version Vault STandard 10. The ProcessCommandCommit you provided me is invalid, as the 1st parm no longer accepts string[], it wants a changesetcollection. My try ctach just reports "Commit Failed". How do I use the ProcessCommandCommit in Vault 10, not sure how to create a changesetcollection to pass in to the 1st param.

Thanks, Bob Feller

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Commit Failed error on checkin

Post by jclausius » Mon Aug 06, 2018 12:42 pm

Sorry I wasn't clear in my post... What version of the API you were using *previous* to version 10.

In any case, let's get back to the issue at hand. ProcessCommandCommit() is overloaded with multiple methods. If you have the Client API, can you open the client API zip file? In there, take a look at CommandLineClientCode\VaultCmdLineClient.cs at line:552.

It makes a call to ServerOperations.ProcessCommandCommit(...) using the same arguments I mentioned in the previous post. Hopefully there is enough there to help you solve the issue.
Jeff Clausius
SourceGear

bob@morningdew.net
Posts: 4
Joined: Sun Aug 05, 2018 7:50 am

Re: Commit Failed error on checkin

Post by bob@morningdew.net » Thu Aug 09, 2018 7:45 am

I tried the ProcessCommandCommit with the Unchangedhandler set to Checkin, and it worked. It continued to work with this option. However when I changed the UnchangedHandler to UndoCheckin, it worked the first time, but failed with "Commit Failed" on successive runs. I'd like to use the UndoCheckin to keep unchanged files from being checked in over and over, as it makes it hard to go back to your changes with so much history.

Thanks, Bob

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Commit Failed error on checkin

Post by jclausius » Mon Aug 13, 2018 8:33 am

What was the reason for the failure? Does the server log have any information? Have you enabled client side logging to see what those logs indicate?
Jeff Clausius
SourceGear

bob@morningdew.net
Posts: 4
Joined: Sun Aug 05, 2018 7:50 am

Re: Commit Failed error on checkin

Post by bob@morningdew.net » Thu Aug 23, 2018 4:30 pm

The only error I got was Commit Failed. How do you implement client side loggimg?

Thanks, Bob

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Commit Failed error on checkin

Post by jclausius » Fri Aug 24, 2018 7:26 am

It really depends on your binary type. If you're building a .exe, you should have something like appName.exe.config. In the <appSettings>, you'll need to add extra attributes to enable logging. Using the contents of VaultGUIClient.exe.config as a guide, you should see all of the various settings related to logging. Then by enabling logging and setting these other attributes, you should be able to generate a log file.


I would also recommend building a debug version of the Command Line Client, and setting a break point to step through VaultCmdLineClient.cs, the first line of code in Main(). Hopefully some of this will help in your API usage

Code: Select all

SimpleLogger.Log.ConfigureFromAppSettings("VaultCLC");
On a related note, did you place a try/catch (Exception e) around the failure? Does it enter the catch statement? If so, look at the Exception, e. Does it have any details? Look at all inner exceptions of that exception. Does that contain any information.

Also, I would suggest compiling, and setting break through the Vault Command Line Client project, and issue any commands in a debugger. Check out the exception handling, and note any exceptions encountered during a debug session. Does it have any details? Look at all inner exceptions of that exception. Does that contain any information.
Jeff Clausius
SourceGear

Post Reply