Critical: Applying label failed: FailDBInsert

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
ismangil
Posts: 197
Joined: Wed Jun 30, 2004 10:49 am
Location: Sheffield, UK
Contact:

Critical: Applying label failed: FailDBInsert

Post by ismangil » Tue Dec 13, 2005 3:55 am

----12/13/2005 9:47:22 AM (obfuscated)--SSL Disabled System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint 'unique_tblfsobjectlabels_labelrepidobjid'. Cannot insert duplicate key in object 'tblfsobjectlabels'.
The statement has been terminated.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at VaultServiceSQL.VaultSqlSCC.AddLabel(VaultSqlConn conn, Int32 nRepID, Int32 nUserID, VaultLabelItem vLabel, Int64& nLabelID, Int64& nObjID, String& strExistingRootPath) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at VaultServiceSQL.VaultSqlSCC.AddLabel(VaultSqlConn conn, Int32 nRepID, Int32 nUserID, VaultLabelItem vLabel, Int64& nLabelID, Int64& nObjID, String& strExistingRootPath)
----12/13/2005 9:47:22 AM build3--hartford.fdlearning.com(192.168.25.186)--SSL Disabled AddLabel returned: FailDBInsert

ismangil
Posts: 197
Joined: Wed Jun 30, 2004 10:49 am
Location: Sheffield, UK
Contact:

Post by ismangil » Tue Dec 13, 2005 4:05 am

If I check the table mentioned in the error, there appears to be already an existing label. This is expected. However in this case, that existing label does not show up in "Show Labels", so consequently I can't delete it. Is it safe to delete the records in tblfsobjectlabels that represents this label?

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

Post by jclausius » Tue Dec 13, 2005 7:21 am

unique_tblfsobjectlabels_labelrepidobjid enforces the rule that one object can only have the same labeled name.

A couple of questions:

What version of the Vault server are you using?

Is it possible the label in question is out of view? Did you scan the entire label query results for the label?

Or do you have permissions enabled on the repository? If so, is it possible the label is being filtered out due to a permissions issue?
Jeff Clausius
SourceGear

ismangil
Posts: 197
Joined: Wed Jun 30, 2004 10:49 am
Location: Sheffield, UK
Contact:

Post by ismangil » Tue Dec 13, 2005 8:36 am

jclausius wrote:unique_tblfsobjectlabels_labelrepidobjid enforces the rule that one object can only have the same labeled name.

A couple of questions:

What version of the Vault server are you using?
3.1.1
jclausius wrote: Is it possible the label in question is out of view? Did you scan the entire label query results for the label?
Although the original delete and apply label operation that failed was in a NAnt script, I've also tried the operation from the GUI client. The "Label" operation from GUI client failed with the exact same error, and I am unable to delete because "Show Labels" does not list the label.
jclausius wrote: Or do you have permissions enabled on the repository? If so, is it possible the label is being filtered out due to a permissions issue?
Folder security is not turned on.

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

Post by jclausius » Tue Dec 13, 2005 10:04 am

I don't want to go to deleting it directly from the database just yet. We'll keep that as a last resort.

Can you run the following query:

SELECT * FROM sgvault.dbo.tblfsobjectlabels WHERE label = N'PUT LABEL NAME HERE'

What do the results look like? You can send them in an email if you would like a little more privacy. Just use the email button below this post.
Jeff Clausius
SourceGear

ismangil
Posts: 197
Joined: Wed Jun 30, 2004 10:49 am
Location: Sheffield, UK
Contact:

Post by ismangil » Tue Dec 13, 2005 10:12 am

Same query I did :)

Query result sent via email.

Previously there were two other records in there because there are two other folders that were labeled the same. Those labels are fine, it shows up, and I have deleted them. So I am now left with this one rogue label on this folder.

FYI, that folder has been labeled/delete label-re-apply more than one hundred times before this, never fails.

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

Post by jclausius » Tue Dec 13, 2005 11:17 am

We will be resolving this off line. It seems one of the dependent tables of the label is missing rows.

Since Vault will a label in a transaction, I'm not sure how the rows disappeared.

In any case, we will be removing the label using one of the Vault Server's database procedures.
Jeff Clausius
SourceGear

Locked