Rebuild Master failed with error -1:

The other day I was trying to rebuild the master database for a SQL Server 2000 box. Everything was going well until the “Configuring Server” dialog popped up.

D0B9A22DC37EAE4F_164_0

The progress bar went across about 4 times and then an error message popped up.

D0B9A22DC37EAE4F_164_1

That’s weird, I have rebuilt the master database a few times before and I have never encountered errors like this one. I looked for the error details and started with the cnfgsvr.out log file located in C:\Program Files\Microsoft SQL Server\MSSQL\Install

D0B9A22DC37EAE4F_164_2

By looking at the log file, I could confirm the error, but it didn’t help to explain as why the connections had failed. So I ran eventvwr. One of the system log error mentioned something about MSSQLSERVER service failed to start.

D0B9A22DC37EAE4F_164_3

At that point, I was still not sure what’d happened, so I then ran services.msc and tried to start the MSSQLSERVER service manually.

D0B9A22DC37EAE4F_164_4

The error message matched what I had seen in the event viewer. Path? What path? Suddenly as if stricken by lightening, I noticed “Path to executable:” had the short file names for the path. The question became obvious, what was MICROS~3?

D0B9A22DC37EAE4F_164_5

A quick look in the explorer revealed 5 long name folders starting with the word “Microsoft”.

D0B9A22DC37EAE4F_164_6

MICROS~3 happened to be “Microsoft Office” instead of “Microsoft SQL Server”. Now the cause of the issue had been identified, I needed a way to work around it. For what I was doing at the time, I could not just reinstall SQL Server, therefore I decided to move the “80” and “mssql” folders into “Microsoft Office”.

D0B9A22DC37EAE4F_164_7

What I had effectively done was making C:\PROGRA~1\MICROS~3\MSSQL\binn\sqlservr.exe a valid path.

Then I reran rebuildm.exe and as expected, everything worked.

D0B9A22DC37EAE4F_164_8

–oo00oo–

For more info on short file names, please refer to the following Microsoft Knowledge Base articles:
How Windows Generates 8.3 File Names from Long File Names
8.3 Short File Names not Retained after Tape Restore
How to Disable Automatic Short File Name Generation