VMware Cloud Community
unsigned1138
Enthusiast
Enthusiast

Upgrade from 4.1U1 to 5.1U1 SQL DB error, installation aborts

During the vCenter upgrade, after all the info is put in, during the database upgrade section, a window pops that says "Exception thrown while executing SQL script"

Click ok, and it 'rolls back' and exits the installer.

This is the error. I've verified the index does exist, and I don't think there is a permission issue. vCenter is using windows mode auth and seems to work fine. I've restored my DB, and ahve a working 4.1 vCenter, but I need to get by this for the 5.1 upgrade.

Anyone have any thoughts?

<snip>

IF NOT EXISTS(SELECT 0 FROM VPX_STAT_ID WHERE MOID IS NULL)

   BEGIN

     DROP INDEX VPX_STAT_ID_M1 ON VPX_STAT_ID;

     ALTER TABLE VPX_STAT_ID ALTER COLUMN MOID NVARCHAR(255) NOT NULL;

     CREATE INDEX VPX_STAT_ID_M1 ON VPX_STAT_ID(MOID);

   END

[6/21/2013 3:51:17 PM] Error: Failed to execute command: IF NOT EXISTS(SELECT 0 FROM VPX_STAT_ID WHERE MOID IS NULL)

   BEGIN

     DROP INDEX VPX_STAT_ID_M1 ON VPX_STAT_ID;

     ALTER TABLE VPX_STAT_ID ALTER COLUMN MOID NVARCHAR(255) NOT NULL;

     CREATE INDEX VPX_STAT_ID_M1 ON VPX_STAT_ID(MOID);

   END

[6/21/2013 3:51:17 PM] Got exception: ERROR [42S02] [Microsoft][SQL Native Client][SQL Server]Cannot drop the index 'VPX_STAT_ID.VPX_STAT_ID_M1', because it does not exist or you do not have permission.

[6/21/2013 3:51:17 PM] Error while upgrading: ERROR [42S02] [Microsoft][SQL Native Client][SQL Server]Cannot drop the index 'VPX_STAT_ID.VPX_STAT_ID_M1', because it does not exist or you do not have permission.

[6/21/2013 3:51:17 PM] Info: Exiting Upgrade Wizard

</snip>

0 Kudos
3 Replies
JagadeeshDev
Hot Shot
Hot Shot

This issue occurs if an index named INDX_TIME_ID in the VPX_HIST_STAT1 table was not deleted in a previous upgrade and continues to exist. The script to upgrade the table fails because of the index's constraint on the TIME_ID column.

VMware KB: Upgrading from vCenter Server 4.1 to 5.0 fails with the Error: Exception Thrown while exe...

http://www.myitblog.in/
unsigned1138
Enthusiast
Enthusiast

Wow. Somehow I found KB 1003960, Troubleshooting vCenter Server database configuration issues but not that one.

Looks spot on, I'll verify in a bit. Thank you, I don't know how I didn't find it. My search-fu must have been bad.

0 Kudos
unsigned1138
Enthusiast
Enthusiast

That actually wasn't it.... and I'm not sure what did it in the end. The index wasn't present, so I ended up creating the index, only to have the upgrade fail again. I restored the DB yet again, verified there was no index on the restored DB and ran the upgrade one more time before I was going to contact support.... and that time it ran to the end without issue. I have various log files showing the problem, and then it just ran through. I don't get it at all, but I guess that doesn't matter, as the service is upgraded and running.

My guess is that in the original work last Friday, something had made the installer choose the wrong DB upgrade script, and when I ran it yesterday and it was successful, the correct script was chosen.

I say this because of the log entries from the start of the first run with the upgrade failure. My DB version was absolutely v4.1, and it ran the 5.0 script.

[6/21/2013 3:50:58 PM] Info: Upgrading database from version 5.0 to version 5.1

[6/21/2013 3:50:58 PM] Upgrade-vMN-to-vMN-Next\MSSQL\upgrade_mssql.sql

Then this from the first failed run yesterday where I had erroneously put the index in place in attempt to fix it:

[6/26/2013 9:41:41 AM] Info: Upgrading database from version 4.1 to version 5.0

[6/26/2013 9:41:41 AM] Upgrade-v410-to-vMN\MSSQL\upgrade_mssql.sql

I don't have the log from the success, as it cleaned it up. But something was wacked out on 6/21.

0 Kudos