WSUS Support Forums: Error connecting to the WSUS database (FIX!) - WSUS Support Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Error connecting to the WSUS database (FIX!)

#1 User is offline   laserspeeddemon 

  • Member
  • PipPip
  • Group: Regular Members
  • Posts: 6
  • Joined: 22-Jun-07

Posted 05 Jul 2007, 14:04

I've seen this quite a bit lately and I figured out how to fix the problem WITHOUT losing everything from your database.
(skip to the next post for a solution without explaination)

So here is the error in question.

Quote

Error connecting to the Windows Server Update Services database
There was an error connecting to the Windows Server Update Services
database. Either the database is not available or you do not have the correct
privileges to access the database.

If you believe you have received this message in error, please check with
your system administrator


For some reason, when my WSUS server applied patches to itself, that is the error I got when I tried to open the WSUS admin console.

So after I did some research I found that I had some errors in my Event Viewer related to Microsoft SQL Server Desktop Environment 2000(MSDE 2000).
(To open Event Viewer go to Start --> Adminstrative Tools --> Event Viewer) This is the Error.

Quote

EVENT: 421
Connection to database failed. Reason=Cannot open database requested in login 'SUSDB'. Login fails.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.. Connection string: Data Source=GTCMPM;Initial Catalog=SUSDB;Connection Timeout=60;Application Name=WSUS SQL Connection;Trusted_Connection=Yes;Pooling='true'; Max Pool Size = 100

For more information, see Help and Support Center at http://go.microsoft....link/events.asp.


So I checked to see if the MSSQLSERVER Service was running, not only was it NOT running, but it was gone altogether.
(To open Services go to Start --> Adminstrative Tools --> Services).

I ran a search for MSDE on the C: to see if I can locate the database, an instance, or anything MSDE related. The search results pulled up a log file in C:\Program Files\Update Services\LogFiles. I reviewed a few of the log files (not really knowing what I was looking at), when I came across a relatively recent log file named WSUSSetup_070629_0403.log The portion of the filename "070629_0403" is just a date stamp, so you want to look for "WSUSSetup" in the directory C:\Program Files\Update Services\LogFiles.

This is what the file said.

Quote

2007-06-29 04:03:24 Success MWUSSetup WSUS Server Setup Started.
2007-06-29 04:03:24 Success MWUSSetup Parsing command line arguments
2007-06-29 04:03:24 Success MWUSSetup WSUS Setup: Performing maintainance
2007-06-29 04:03:40 Success MWUSSetup Determing the installation details
2007-06-29 04:03:50 Error MWUSSetup Failed to delete path C:\Program Files\Update Services\Selfupdate2, error code 1026 (Error 0x00000000: The operation completed successfully.)
2007-06-29 04:07:33 Success MWUSSetup Database backup has beenn created at E:\WSUS\SUSDB.Dat. You can use this file to restore the database, if there is an upgrade failure
2007-06-29 04:08:35 Success MWUSSetup WMSDE Uninstall Succeeded
2007-06-29 04:08:35 Success MWUSSetup WMSDE SP3 Uninstalled successfully
2007-06-29 04:08:35 Success MWUSSetup Installing WMSDE
2007-06-29 04:09:19 Error MWUSSetup WMSDE Installation Failed (Error 0x80070643: Fatal error during installation.)
2007-06-29 04:09:19 Error MWUSSetup InstallWMSDE Failed (Error 0x80070643: Fatal error during installation.)
2007-06-29 04:09:19 Error MWUSSetup Failed to install WMSDE (Error 0x80070643: Fatal error during installation.)
2007-06-29 04:09:21 Error MWUSSetup PerformUpgrade failed (Error 0x80070643: Fatal error during installation.)
2007-06-29 04:09:21 Error MWUSSetup Failed to upgrade Windows Server Update Services from RTM to SP1 (Error 0x80070643: Fatal error during installation.)
2007-06-29 04:09:21 Error MWUSSetup WSUS Setup: Performing Maintenance Failed. (Error 0x80070643: Fatal error during installation.)
2007-06-29 04:09:21 Error MWUSSetup WSUS Setup Failed. (Error 0x80070643: Fatal error during installation.)


I have bolded 3 lines. So you can understand what I am talking about. First, the line that caught my eye was "WMSDE SP3 Uninstalled successfully." And then "WMSDE Installation Failed." This tells me WSUS has removed the database probably to install an upgraded version of MSDE, but then has problems installing the new version. So now I know, that WSUS has a console but no database to connect to. The errors in the Event Viewer and the lack of the service MSSQLSERVER confirms this. The 3rd bolded line is what's gonna save you from doing ALOT of extra work when it comes to restoring WSUS. The database is backed up and now we know where.

So now how did I fix this? Go on to the next post.
0

#2 User is offline   laserspeeddemon 

  • Member
  • PipPip
  • Group: Regular Members
  • Posts: 6
  • Joined: 22-Jun-07

Posted 06 Jul 2007, 07:14

First off, the legal jargun.
I am not responible in any shape, way, or form through statement; expressed or implied, if you incur damages by following these steps regardless of what OS or version of WSUS. These steps are only what fixed the problem through my own expirence and are offered only as an suggestion.

Ok to fix this first you need to understand what I am using.

I am running Windows Server 2003 Standard Edition SP1 with WSUS 2.0 supported by MSDE thats built-in to WSUS 2.0. If you are not running this OS or version of WSUS you may want to research a little more before continuing with this procedure.

This is what you will need:
1) Microsoft Windows Server 2003 Standard Edition CD
2) At least 1GB worth of space on the C: drive.
3) The wsus2-kb919004-x86.exe file
4) Luck!

The first thing I did was uninstall WSUS. There is how it's done (fully).

Go to Start --> Control Panel --> Add or Remove Programs.
Posted Image

Posted Image

Select Micorsoft Windows Server Update Services and click Remove.

Posted Image

WITHOUT checking any boxes click next.

Posted Image

After the "Add or Remove Program" window does its thing click "Finish".

Posted Image

Next click on "Add/Remove Windows Components."

Posted Image

When the "Windows Componet Wizard" window opens, select "Application Server," and click "Details."

Posted Image

Ensure that "ASP.NET" and "Internet Information Services (IIS)" are unchecked, and click "Ok."

Posted Image

The "Application Server" Window will close and you will be returned to the "Windows Componet Wizard" window. Click "Next>"

Posted Image

These Windows Components will now be removed.

Posted Image
0

#3 User is offline   laserspeeddemon 

  • Member
  • PipPip
  • Group: Regular Members
  • Posts: 6
  • Joined: 22-Jun-07

Posted 06 Jul 2007, 07:31

When the "Windows Componet Wizard" processing is completed. Click "Finish."

Posted Image

AT THIS POINT YOU NEED TO HAVE THE "WINDOWS SERVER 2003 STANDARD EDITION" CD IN YOUR WSUS SERVER.

We are now going to do the reverse of what we just did. The "Add or Remove Programs" window should still be open. Click on
"Add/Remove Windows Components"

Posted Image

Select "Application Server" and click details.

Posted Image

Ensure that "ASP.NET" and "Internet Information Services" is checked and click "Ok"

Posted Image

When the "Application Server" window closes, you will be returned to the "Windows Component Wizard" window. Click "Next>"

Posted Image

Allow the components to install.

Posted Image

Then click "Finish.

Posted Image
0

#4 User is offline   laserspeeddemon 

  • Member
  • PipPip
  • Group: Regular Members
  • Posts: 6
  • Joined: 22-Jun-07

Posted 06 Jul 2007, 07:41

Here is how you get the WSUS installation setup file.

WSUS 2.0 SP1

Click on that link. Now you can either run it or save it and run it. It's up to you. I will give instructions for both.

To Save it (recommended).

Click on the above link. And the "File Download" Window will open. Click "Save."

Posted Image

Select a name & location to save the file (in this case, we are going to save it to the desktop with the default name). And click "Save."

Posted Image

Double-click the file and move onto the next post.

Posted Image

To open it directly

Click on the above link. And the "File Download" Window will open. Click "Open."

Posted Image

Windows will download the file into a temporary location. You will see this window.

Posted Image

A Security Warning will pop-up. Click "Yes."

Posted Image

Now move on to the next post.
0

#5 User is offline   laserspeeddemon 

  • Member
  • PipPip
  • Group: Regular Members
  • Posts: 6
  • Joined: 22-Jun-07

Posted 06 Jul 2007, 08:12

Either way you choose to run the WSUS Setup. You will see this window.

Posted Image

In the "Microsoft Windows Server Update Services Service Pack 1 Setup Wizard" window. Click "Next>"

Posted Image

Select "I accept the terms of the License agreeement" and click "Next>"

Posted Image

Here you need to configure where you want to store the Updates. I decided to store it local in the "E:\WSUS\" directory. Put it where ever you want it and click "Next>"

Posted Image

Again this is another personal choice as to what form of database you intend to you to run WSUS. I choose to use Microsoft SQL Server Desktop Engine (MSDE) 2000. In order to do that I must choice to install it on the "Microsoft Windows Server Update Services Service Pack 1 Setup Wizard" window. Select "Install SQL Server desktop engine (Windows) on this computer. I again select "E:\WSUS\" to store the data. Put it where ever you want it and click "Next>"

Posted Image

Select "Use the existing ISS Default site (recommende) and click "Next>."

Posted Image

Click "Next>"

Posted Image

Click "Next>"

Posted Image

Allow WSUS to install (this may take 20-30 mintues).

Posted Image

When the installation is complete. Click "Finish"

Posted Image
0

#6 User is offline   laserspeeddemon 

  • Member
  • PipPip
  • Group: Regular Members
  • Posts: 6
  • Joined: 22-Jun-07

Posted 06 Jul 2007, 08:43

Now WSUS is installed. The issue is everything is empty. The computers will report in the a few hours, but all of the updates and some form of the configurations will be gone.

Posted Image

Go to Start --> Run...

Posted Image

Type "cmd" and click "OK"

Posted Image

A command prompt window will open.

Posted Image

Change directories by typing "cd C:\Program Files\Update Services\Tools\osql" and hit enter.

Posted Image

In the first post, I showed how I found the WSUS database backup.
Now run this command with path of the backup in place of my path (the bolded text):

osql.exe -S %computername%\WSUS -E -Q "USE master ALTER DATABASE SUSDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE RESTORE DATABASE SUSDB FROM DISK=N'E:\WSUS\SUSDB.dat' WITH REPLACE ALTER DATABASE SUSDB SET MULTI_USER"

Posted Image

If you get 100% (see above picture) you are gold. And everything is now restored. Open up the WSUS admin console and everything should be just as it was before you had the error.

Posted Image

If you have any questions. Feel free to PM or email me at:

sean.bailey@lmco.com or laserspeeddemon@yahoo.com
0

#7 User is offline   fluxblocker 

  • Newbie
  • Pip
  • Group: New Members
  • Posts: 1
  • Joined: 13-Jul-07

Posted 13 Jul 2007, 08:12

I found this post in a search - wanted to say thanks - it was helpful. My scenario was different however, in that we have Windows 2000 server (still in the dark ages, lol). Also, the server (with the error message) is a secondary WSUS server. I checked and the SQL database was still there and running. So not being sure what to do, I uninstalled and reinstalled WSUS - I think it's fixed - I just have to re-sync - all the content is still on the server. I think the database got corrupted - I had to create a new database to reinstall WSUS. Thanks again for the post!
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users