"DBFail" error on folder history

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

Moderator: SourceGear

DarrenS
Posts: 49
Joined: Wed Mar 17, 2004 4:56 pm
Location: Inglewood, CA

"DBFail" error on folder history

Post by DarrenS » Fri Apr 02, 2004 12:51 pm

This is not a showstopper for us but it's a little annoying.

Scenario: GUI client, right click a folder, select "Show History..." Accept defalt options and click "OK" on resulting dialog -> "A database error has occurred (FailDBFault)"

I turned on debug logging and the following it getting logged:

Code: Select all

----4/2/2004 10:46:19 AM     darrens--using-07-122a.hrbl.net(10.1.107.151)--SSL Disabled
	Violation of PRIMARY KEY constraint 'PK__@@securityrights__6982EB8C'. Cannot insert duplicate key in object '#688EC753'.
----4/2/2004 10:46:19 AM     darrens--using-07-122a.hrbl.net(10.1.107.151)--SSL Disabled
	BeginHistoryQuery returned: FailDBFault
One thing that may be important: we recently moved our Vault database to a different SQL server, using the procedure given by Sourcegear on these forums. History worked OK earlier today though, which was after the move was done.

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

Post by jclausius » Fri Apr 02, 2004 2:26 pm

Darren:

I'm not sure why, but there are multiple security rights assignments coming back for the history query.

I'll need some time to investigate this a little further.

Thanks,
Jeff Clausius
SourceGear

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

Post by jclausius » Wed May 05, 2004 9:13 am

Darren:

Is this still happening? I couldn't re-create it here. If so, can I get some info from you related to your user permissions? We can do this off list.
Jeff Clausius
SourceGear

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

Post by jclausius » Wed May 05, 2004 9:21 am

Darren:

A quick follow up here.

1) Are you using group security as well as user security?
2) Do you have shared folders within your repository?
Jeff Clausius
SourceGear

DarrenS
Posts: 49
Joined: Wed Mar 17, 2004 4:56 pm
Location: Inglewood, CA

Post by DarrenS » Wed May 05, 2004 11:46 am

Haven't had this problem for a few weeks now. For the record, we are using group security, and we do have a few shared folders. I think we removed all individual user security (we want everything to be done by groups) but I'm not 100% sure.

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

Post by jclausius » Wed May 05, 2004 12:03 pm

i've recreated a problem, but it involved having security set for a shared folder.

i'm fixing this for vault 2.0.3. i was hoping this problem is the same issue which you uncovered.

do you happen to remember if you possibly assigned security rights to a primarily shared folder?
Jeff Clausius
SourceGear

DarrenS
Posts: 49
Joined: Wed Mar 17, 2004 4:56 pm
Location: Inglewood, CA

Post by DarrenS » Wed May 05, 2004 5:46 pm

Sorry - don't remember if we did that. It is very possible that we did, given our setup though.

Ironically - I just started having the problem again. This time, it's when I click any folder and select "show labels". On this occasion, I was able to remedy the issue by closing the Vault client and re-opening it.

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

Post by jclausius » Wed May 05, 2004 8:41 pm

Anything showing in the sgvault.log file which may explain the error? I don't believe the Label code path suffers from the same problems as history.
Jeff Clausius
SourceGear

DarrenS
Posts: 49
Joined: Wed Mar 17, 2004 4:56 pm
Location: Inglewood, CA

Post by DarrenS » Thu May 06, 2004 12:25 pm

Looks like the same FK issue as before:

Code: Select all

----5/5/2004 4:27:46 PM      darrens--using-hpw3kdev(10.1.107.151)--SSL Disabled
	INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'fk_tblsessionlabelqueries_tblsessions'. The conflict occurred in database 'sgvault', table 'tblsessions', column 'sessionid'.
The statement has been terminated.
----5/5/2004 4:27:46 PM      darrens--using-hpw3kdev(10.1.107.151)--SSL Disabled
	BeginLabelQuery returned: FailDBInsert

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

Post by jclausius » Thu May 06, 2004 12:37 pm

interesting. this is a foreign key error, not primary key error. logging off, and back on will clear the immediate problem.

its almost as if the client was able to execute a label query w/ out being logged in, hence the foreign key violation (your session was removed from tblsessions).

i'll investigate this further.

thanks,
Jeff Clausius
SourceGear

DarrenS
Posts: 49
Joined: Wed Mar 17, 2004 4:56 pm
Location: Inglewood, CA

Post by DarrenS » Thu May 06, 2004 1:33 pm

its almost as if the client was able to execute a label query w/ out being logged in
When you said that, a light bulb went off in my head.

We have been customizing the Vault command line client to do, amongst other things, queries against labels for history and wildcard file searching. I have been running this client on my machine, sometimes in close proximity to running the Vault IDE client; I wonder if that could explain this behavior? As far as I know, the command line client is logging on and off correctly (I'm using the code provided).

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

Post by jclausius » Thu May 06, 2004 2:05 pm

the error is then coming from the clc?

it would have to since the normal msscci - vault ide client is not capable of issuing a label request.
Jeff Clausius
SourceGear

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

Post by jclausius » Thu May 06, 2004 2:10 pm

is it possible the custom clc has a race condition? that is it executes a beginlabelquery, and a logoff request before the beginlabelquery has returned?

i'm modifying the stored procedure to check for a valid session before storing the label results. this will avoid the fk problem. the server will log an error that the results could not be stored due to an invalid session id.
Jeff Clausius
SourceGear

DarrenS
Posts: 49
Joined: Wed Mar 17, 2004 4:56 pm
Location: Inglewood, CA

Post by DarrenS » Wed May 12, 2004 2:47 pm

This happens from the Vault client.

It just happened again - then I signed out and signed in as a different user, and all was OK for that user. I think it has something to do with signing into Vault as the same user from two different places at the same time.

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

Post by jclausius » Thu May 13, 2004 7:49 am

are you issuing the history command on a folder? if so, is the folder shared?

if you look at the server's log file (sgvault.log), what is the error message? is it a primary key violation on PK__@@securityrights__XYZ?

if so, i put in a fix in Vault 2.0.3, which should be available in the very near future.
Jeff Clausius
SourceGear

Locked