Error using GETLABELDIFFS from CLC

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

Moderator: SourceGear

Post Reply
NTTAKR
Posts: 10
Joined: Wed Oct 26, 2005 6:41 am

Error using GETLABELDIFFS from CLC

Post by NTTAKR » Thu Feb 23, 2006 1:32 pm

To whom it may concern,

I am using SGV version 3.1.2 (3511) and I have some problem regarding GETLABELDIFF:

We have an automated system for integration builds that is using consecutive label names for each build.

I can get all labels created using the HISTORY command:

vault HISTORY -host <HOST> -user <USER> -repository <REPOSITORY> $/<Project> -norecursive -rowlimit 15 -datesort desc

The command is listing me LABELS used in <item> elements.
I see the LABEL AUC1030 there.

If I try to do

vault GETLABELDIFFS -host <HOST> -user <USER> -repository <REPOSITORY> $/<Project> AUC1030

I get the following error:


<vault>
<error>
Invalid label: AUC1030
</error>
<exception>
System.ArgumentException: Invalid label: AUC1030
at VaultCmdLineClient.VaultCmdLineClient.GetLabelTimeStamps(String item, Stri
ng label1, String label2, DateTime& timestamp1, DateTime& timestamp2)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommandGetLabelDiffs(String s
trReposPath, String strLabel1, String strLabel2)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Args curArg)
at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)
</exception>
<result success="no" />
</vault>

If I use AUC1031 or AUC1029 it all works well.

What is the problem with the above command???

Thanks for you help,
Andreas Kroll

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

Post by lbauer » Thu Feb 23, 2006 1:42 pm

Is there anything in the Vault server log file that corresponds to failed command?
Linda Bauer
SourceGear
Technical Support Manager

NTTAKR
Posts: 10
Joined: Wed Oct 26, 2005 6:41 am

Error using GETLABELDIFFS from CLC

Post by NTTAKR » Thu Feb 23, 2006 3:41 pm

No, there are not entries in the logfile indicating any error at all.

The steps are reproducable, not as another customer stated "every second time".

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

Post by lbauer » Thu Feb 23, 2006 4:23 pm

What is the problem with the above command???
There may not be anything wrong with the command, if the same command works with labels AUC1031 or AUC1029. There may be something wrong with the label.

Can you do a successful "Getlabel" on AUC1029?
Linda Bauer
SourceGear
Technical Support Manager

NTTAKR
Posts: 10
Joined: Wed Oct 26, 2005 6:41 am

Post by NTTAKR » Thu Feb 23, 2006 4:57 pm

lbauer wrote: There may not be anything wrong with the command, if the same command works with labels AUC1031 or AUC1029. There may be something wrong with the label.
Can you do a successful "Getlabel" on AUC1029?
Yes, that may be the case. But why isn't any error cause given?
As the labels are all set by the same workflow (CCNET) I do not understand why most of the labels "work" but SOME won't.

I can do a GETLABEL on AUC1029 AND AUC1030 wihtout any problems.
So why is the GETLABELDIFF failing on the AUC1030 ???

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

Post by lbauer » Fri Feb 24, 2006 5:30 pm

Is it possible the zero is really the letter O? Or, perhaps there is a space after the name of the label?

Our GETLABELDIFFS code is still a work in progress. It just does a query on the folder for all history and searches for the matching label on the client side. You could try to bring up the command line client in the debugger and figure out why it isn't matching the label.

We're plannning to make improvements so that getting a label through the API works better in the future.
Linda Bauer
SourceGear
Technical Support Manager

NTTAKR
Posts: 10
Joined: Wed Oct 26, 2005 6:41 am

Post by NTTAKR » Fri Feb 24, 2006 7:27 pm

lbauer wrote:Is it possible the zero is really the letter O? Or, perhaps there is a space after the name of the label?
No, that is not possible. CCNET does give the labels a unique naming schema.
I also said that I CAN do a GETLABEL on the AUC1030, so the name of the label HAS to be right, doesn't it?
lbauer wrote: Our GETLABELDIFFS code is still a work in progress. It just does a query on the folder for all history and searches for the matching label on the client side. You could try to bring up the command line client in the debugger and figure out why it isn't matching the label.
What do I have to do to get the Commandline Client in the debugger?
lbauer wrote: We're plannning to make improvements so that getting a label through the API works better in the future.
Since you are talking about API and Commandline Client here....
I observed that I do get different results if I get a label using the API and if I use the vault.exe commandline client.
Just recently we had the problem that I could reproduce a get Label from the API does get a wrong (old) version of a single file over 3000 correct ones. If I repeated the command from commandline I got the right version of the file.

Don't you have UNIT tests in your code which should find such errors?

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Sun Feb 26, 2006 2:50 pm

NTTAKR wrote: What do I have to do to get the Commandline Client in the debugger?
Just download the "Client API" installer from the Vault download page on SourceGear website at http://www.sourcegear.com/vault/downloads.html. The solution file is in there with the command line client code.
NTTAKR wrote: Since you are talking about API and Commandline Client here....
I observed that I do get different results if I get a label using the API and if I use the vault.exe commandline client.
Just recently we had the problem that I could reproduce a get Label from the API does get a wrong (old) version of a single file over 3000 correct ones. If I repeated the command from commandline I got the right version of the file.
The command line client uses the Vault API, so if the CLC works, then the problem is probably in the program that uses the API. We'd need more info on what you are doing.

fbielsik
Posts: 2
Joined: Fri Sep 03, 2004 11:38 am

Re: Error using GETLABELDIFFS from CLC

Post by fbielsik » Wed Mar 01, 2006 6:41 pm

NTTAKR wrote:If I try to do

vault GETLABELDIFFS -host <HOST> -user <USER> -repository <REPOSITORY> $/<Project> AUC1030

I get the following error:

<vault>
<error>
Invalid label: AUC1030
</error>
<exception>
System.ArgumentException: Invalid label: AUC1030
at VaultCmdLineClient.VaultCmdLineClient.GetLabelTimeStamps(String item, Stri
ng label1, String label2, DateTime& timestamp1, DateTime& timestamp2)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommandGetLabelDiffs(String s
trReposPath, String strLabel1, String strLabel2)
at VaultCmdLineClient.VaultCmdLineClient.ProcessCommand(Args curArg)
at VaultCmdLineClient.VaultCmdLineClient.Main(String[] args)
</exception>
<result success="no" />
</vault>

If I use AUC1031 or AUC1029 it all works well.

What is the problem with the above command???
I began having the same problem with GETLABELDIFFS from the CLC recently, and looking at the source code found out why: the -rowlimit argument is ignored in the history item query in the GetLabelTimeStamps function... instead it is hard-coded to 10K. So if your labels don't fall in the first 10K items (mine were at around 20K), the label(s) won't be found. I replaced this with a 0, and got the diffs.

Frank

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

Post by lbauer » Thu Mar 02, 2006 10:11 am

Thanks for the information!

I'll log a bug and we'll try to get this fixed in a future release, or at least document the workaround.
Linda Bauer
SourceGear
Technical Support Manager

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Wed Mar 15, 2006 1:50 pm

Not sure if anyone is still looking at this topic, but note that a HISTORY command using -beginlabel and -endlabel will give you the same results as GETLABELDIFFS, and is much more efficient.

In fact, GETLABELDIFFS will probably be deprecated in the next version of Vault, since it isn't really needed anymore (now that history supports labels)

Post Reply