Upgrade fails - 3.0.7 to 3.1.2

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

Moderator: SourceGear

Locked
SWolfe
Posts: 4
Joined: Wed Sep 21, 2005 2:14 pm

Upgrade fails - 3.0.7 to 3.1.2

Post by SWolfe » Wed Sep 21, 2005 2:27 pm

OK
Configuring your new Vault Installation
Checking for IIS Version...Requesting Vault Admin user password...OK
Connecting to the SQL Server...OK
Verifying the SQL Server requirements...OK
Checking for an existing Vault database...Found.
Asking for database's fate...Keep existing.
Upgrading the existing Vault database...
This may take a long time. Do NOT stop this process!
Checking the installed database version...OK
Grant database access to RAMA\ASPNET...OK
Upgrading SourceGear Vault database schema...OK
Checking Vault share information...OK
Checking Vault folder entry information...OK
Running upgrade SourceGear Vault database schema after checking shares and folder entries...Cannot insert the value NULL into column 'parentpathhash', table 'sgVault.dbo.tbltreerevisionfolders'; column does not allow nulls. INSERT fails.
Cannot insert the value NULL into column 'newfolderfullpath', table 'sgVault.dbo.tblfsobjectshares_3102'; column does not allow nulls. UPDATE fails.
Type added.
Caution: Changing any part of an object name could break scripts and stored procedures.
The column was renamed to 'licensekey'.
The statement has been terminated.
The statement has been terminated.
Vault Setup is exiting due to a failure or cancellation. Error Code = 453
I am reverting DB back and moving back to 3.0.7 for the moment, until I can get this fixed.

-SWolfe

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

Post by jclausius » Wed Sep 21, 2005 2:37 pm

SWolfe:

We're going to have to take a look at what is going on in the database.

We have two options
a) We can upload the database in for inspection, so we can see what sharing information is out of sync. Note, we can also remove all files from this database to make the upload smaller and provide you with some security.

b) Or we can try to do this manually with a lot of back and forth with SQL statements.

Which way would be the most convenient?
Jeff Clausius
SourceGear

SWolfe
Posts: 4
Joined: Wed Sep 21, 2005 2:14 pm

Post by SWolfe » Wed Sep 21, 2005 2:39 pm

SQL statements for now, I guess. We are trying to get things locked down for Rita.

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

Post by jclausius » Wed Sep 21, 2005 2:56 pm

OK... Let's try this for now. Can you run / create an tab delimitted file for the following query.

Code: Select all

SELECT txid, treelevel, fullpathhash, objverid, parentpathhash FROM [sgvault].[dbo].[tbltreerevisionfolders]
You can send it by email. To contact me by mail, use the email button below this post.
Jeff Clausius
SourceGear

mlippert
Posts: 252
Joined: Wed Oct 06, 2004 10:49 am
Location: Cambridge, MA

Post by mlippert » Wed Sep 21, 2005 4:49 pm

Yikes!
I saw this just after I started the same 3.0.7 to 3.1.2 upgrade. And my upgrade just failed also.

Here's the text:
OK
Upgrading your Vault configuration.
Connecting to the SQL Server...OK
Verifying the SQL Server requirements...OK
Requesting Vault Admin user password...OK
Upgrading the existing Vault database...
This may take a long time. Do NOT stop this process!
Checking the installed database version...OK
Upgrading SourceGear Vault database schema...Violation of PRIMARY KEY constraint 'PK__#trf_3100__66B54314'. Cannot insert duplicate key in object '#trf_3100___________________________________________________________________________________________________________0002000005A3'.
Type added.
Caution: Changing any part of an object name could break scripts and stored procedures.
The column was renamed to 'licensekey'.
The statement has been terminated.
Vault Upgrade Setup is exiting due to a failure or cancellation. Error Code = -1001
Please press OK to continue installing the Client and Admin Tools (if selected).


Mike

I'm going to restore my 3.0.7 database backup, and I guess talk to SourceGear support tomorrow.

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

Post by jclausius » Wed Sep 21, 2005 7:52 pm

Mike:

Your error is a bit different from SWolfe. Let's take a look at something else on your end.

We'll need to run two queries:

Code: Select all

USE sgvault
GO

SET NOCOUNT ON
DECLARE c CURSOR FOR SELECT repid FROM dbo.tblrepositories
OPEN c

DECLARE @repid int
DECLARE @t TABLE
( treelevel int not null,
pph int not null,
objverid bigint not null,
objid bigint not null,
objversion bigint not null,
name nvarchar(256) not null,
objprops smallint not null,
pinnedfromobjverid bigint not null,
fph int not null,
fullpath nvarchar(1024) null,
primary key (treelevel, pph, fph, objverid)
)

FETCH FROM c INTO @repid
WHILE (@@FETCH_STATUS = 0)
BEGIN
   DELETE FROM @t

   PRINT @repid

   INSERT INTO @t (treelevel, pph, objverid, objid, objversion, name,
objprops, pinnedfromobjverid, fph)
   SELECT treelevel, parentpathhash, objverid, objid, objversion, LOWER(name), objprops, pinnedfromobjverid,
fullpathhash FROM dbo.ufngettreestructure(@repid, -1, default)
   
   FETCH NEXT FROM c INTO @repid
END

CLOSE c
DEALLOCATE c

SET NOCOUNT OFF
From this, we'll need to identify the repository id(s) that may have a folder sync issue. Assuming you've been able to identify the repository ID, I'll need the results saved in a tab-delimited format file.

Code: Select all

DECLARE @repid [int]
SELECT @repid = <PUT_REPOSITORY_ID_HERE>

DECLARE @t TABLE
( treelevel int not null,
pph int not null,
objverid bigint not null,
objid bigint not null,
objversion bigint not null,
name nvarchar(256) not null,
objprops smallint not null,
pinnedfromobjverid bigint not null,
fph int not null,
fullpath nvarchar(1024) null,
primary key (treelevel, pph, fph, objverid)
)

INSERT INTO @t (treelevel, pph, objverid, objid, objversion, name,
objprops, pinnedfromobjverid, fph) SELECT treelevel, parentpathhash,
objverid, objid, objversion, LOWER(name), objprops, pinnedfromobjverid,
fullpathhash FROM sgvault.dbo.ufngettreestructure(@repid, -1, default)

DECLARE @treelevel int, @rowsaffected int

SET @treelevel = 0
UPDATE @t SET fullpath = name WHERE treelevel = @treelevel 
SET @rowsaffected = @@ROWCOUNT 
WHILE ( @rowsaffected > 0 ) 
BEGIN
   UPDATE t SET t.fullpath = prev.fullpath + N'/' + t.name
      FROM @t t 
      INNER JOIN @t prev ON (prev.treelevel = @treelevel) AND (prev.fph = t.pph)
      WHERE (t.treelevel = (@treelevel + 1))

   SELECT @rowsaffected = @@ROWCOUNT, @treelevel = @treelevel + 1
END -- WHILE

SELECT * FROM @t ORDER BY treelevel, pph, name;
edit: changed key of table in first query
Jeff Clausius
SourceGear

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

Post by jclausius » Thu Sep 22, 2005 12:42 pm

A preliminary report on Mike.

It appears as if his repository has a name collision on some empty folders (This is one of the items corrected in Vault 3.1.x). So we're going to have him delete/obliterate one of the empty folders, and then re-attempt the upgrade. After the upgrade has completed, he will re-create the empty folder.
Jeff Clausius
SourceGear

mlippert
Posts: 252
Joined: Wed Oct 06, 2004 10:49 am
Location: Cambridge, MA

Post by mlippert » Thu Sep 22, 2005 11:19 pm

I deleted one of the folders which was causing the collision and obliterated it.

I have just finished running the 3.1.2 upgrade and the database update went smoothly.

Everything else looks good so far as well. I haven't tried installing the new client yet, but the old 3.0.7 client still works. I'll be testing out the new client and then sending out a message to all of our Vault users to upgrade their clients tomorrow.

Thanks Jeff,
Mike

SWolfe
Posts: 4
Joined: Wed Sep 21, 2005 2:14 pm

Post by SWolfe » Mon Sep 26, 2005 9:30 am

Ok, I sent the results of the query.

Also of note, we have come across a single file in the DB that we can't do anything with. The client gives a (FailDBInsert) whenever we try to do anything to it.

$/StorageX/Current/Include/dfsReplication/ManifestPostProcessor.h

Not sure if it is related or not, just thought I mention it since we just found it.

-Steve

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

Post by jclausius » Tue Oct 04, 2005 8:14 pm

A quick follow up here. After examination of the database, we discovered one of the shared folders was out of sync.

We sent SWolfe the Fix Share Utility to bring the database back into sync. Then proceeded with the upgrade which ran correctly this time through.
Jeff Clausius
SourceGear

SWolfe
Posts: 4
Joined: Wed Sep 21, 2005 2:14 pm

Post by SWolfe » Mon Oct 10, 2005 1:17 pm

Sorry I haven't gotten back here since we got things working, but things have been very busy.

Thanks for all the work in getting us back up and running.

-Steve

ctacke
Posts: 13
Joined: Mon Nov 08, 2004 4:47 pm

Post by ctacke » Tue Dec 06, 2005 8:24 am

I'm trying to upgrade my server from 3.0.1 to 3.1.5 and I'm also getting an error during the database transition phase.

The error text is as follows:

OK
Configuring your new Vault Installation
Checking for IIS Version...Requesting Vault Admin user password...OK
Connecting to the SQL Server...OK
Verifying the SQL Server requirements...OK
Checking for an existing Vault database...Found.
Asking for database's fate...Keep existing.
Upgrading the existing Vault database...
This may take a long time. Do NOT stop this process!
Checking the installed database version...OK
Ensuring that sgvaultuser has access to the Vault database... Grant database access to sgvaultuser...OK
Upgrading SourceGear Vault database schema...Violation of PRIMARY KEY constraint 'PK__#trf_3100__23DF3156'. Cannot insert duplicate key in object '#trf_3100___________________________________________________________________________________________________________000200000AF1'.
Type added.
Caution: Changing any part of an object name could break scripts and stored procedures.
The column was renamed to 'licensekey'.
The statement has been terminated.
Error during Vault upgrade script.
Vault Setup is exiting due to a failure or cancellation. Error Code = -1280

ian_sg
Posts: 787
Joined: Wed May 04, 2005 10:55 am
Location: SourceGear
Contact:

Post by ian_sg » Tue Dec 06, 2005 10:07 am

ctacke,

Please email me (using the button below) and we'll figure out the trouble.

Thanks,
Ian Olsen
SourceGear

Locked