Commit Failed error on checkin
Moderator: SourceGear
-
- Posts: 4
- Joined: Sun Aug 05, 2018 7:50 am
Commit Failed error on checkin
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
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
Re: Commit Failed error on checkin
It wasn't stated what version of Vault you're coming from, but you could try replacing your API with the following:
In regards to the failure for
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?
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)
Place a try/catch around your call to ProcessCommandCheckin(), is there any information within the exception?
Jeff Clausius
SourceGear
SourceGear
Re: Commit Failed error on checkin
BTW, I have moved this to the Development Tips -> Questions (API) forum since this is more related to that subject matter.
Jeff Clausius
SourceGear
SourceGear
-
- Posts: 4
- Joined: Sun Aug 05, 2018 7:50 am
Re: Commit Failed error on checkin
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
Thanks, Bob Feller
Re: Commit Failed error on checkin
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.
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
SourceGear
-
- Posts: 4
- Joined: Sun Aug 05, 2018 7:50 am
Re: Commit Failed error on checkin
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
Thanks, Bob
Re: Commit Failed error on checkin
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
SourceGear
-
- Posts: 4
- Joined: Sun Aug 05, 2018 7:50 am
Re: Commit Failed error on checkin
The only error I got was Commit Failed. How do you implement client side loggimg?
Thanks, Bob
Thanks, Bob
Re: Commit Failed error on checkin
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
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.
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");
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
SourceGear