Solved

WSUS Sql timeout for GetUpdates() method invocation

Posted on 2007-11-15
2
790 Views
Last Modified: 2013-11-21
Hello,

I have a simple VB program that fetches the update collection from WSUS (Windows Server Update Services) via the Microsoft.UpdateServices.Administration's AdminProxy.GetUpdateServer.GetUpdates() method (see the code snippet below).

About half the time, this program fails with the following timeout error (see below for the full stack trace):
     Error text: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

I am running on "Windows Server 2003 Standard Edition Service Pack 2" with 1GB of memory.

I am running the following version of WSUS:
Microsoft Windows Update Services Version 2.0.0.2620 / Windows Server Update Services Service Pack 1

Here is the complete stack trace:
Getting list of updates
An error occured:
Error text: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
Stack trace:    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, TdsParserState state)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, TdsParserState state)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.ReadNetlib(Int32 bytesExpected)
   at System.Data.SqlClient.TdsParser.ReadBuffer()
   at System.Data.SqlClient.TdsParser.ReadByteArray(Byte[] buff, Int32 offset, Int32 len)
   at System.Data.SqlClient.TdsParser.ReadString(Int32 length)
   at System.Data.SqlClient.TdsParser.ReadValue(_SqlMetaData md, Int32 length)
   at System.Data.SqlClient.TdsParser.ProcessRow(_SqlMetaData[] columns, Object[] buffer, Int32[] map, Boolean useSQLTypes)
   at System.Data.SqlClient.SqlDataReader.PrepareRecord(Int32 i)
   at System.Data.SqlClient.SqlDataReader.GetValue(Int32 i)
   at Microsoft.UpdateServices.Internal.DatabaseAccess.GenericReadableRow.ReadRow(IDataRecord record)
   at Microsoft.UpdateServices.Internal.MultipleResultSetsSPHandler.ExecuteStoredProcedure(DBConnection connection)
   at Microsoft.UpdateServices.Internal.GenericDataAccess.ExecuteSP(String spName, DBParameterCollection args, IExecuteSPHandler handler, Int32 queryTimeoutInSeconds)
   at Microsoft.UpdateServices.Internal.GenericDataAccess.ExecuteSP(String spName, DBParameterCollection args, IExecuteSPHandler handler)
   at Microsoft.UpdateServices.Internal.DataAccess.ExecuteSPMultipleResultSets(String spName, DBParameterCollection args, Type[] resultTypes)
   at Microsoft.UpdateServices.Internal.DatabaseAccess.AdminDataAccess.ExecuteSPCompleteUpdatesResult(String spName, DBParameterCollection args)
   at Microsoft.UpdateServices.Internal.DatabaseAccess.AdminDataAccess.ExecuteSPGetAllUpdates(String preferredCulture, Int32 approvedStates, DateTime fromSyncDate, DateTime toSyncDate, Guid[] updateCategoryIds, Guid[] updateClassificationIds, Int32 publicationState)
   at Microsoft.UpdateServices.Internal.BaseApi.Update.GetAll(ApprovedStates approvedStates, DateTime fromSyncDate, DateTime toSyncDate, UpdateCategoryCollection updateCategories, UpdateClassificationCollection updateClassifications, ExtendedPublicationState publicationState)
   at Microsoft.UpdateServices.Internal.BaseApi.Update.GetAll(ApprovedStates approvedStates, DateTime fromSyncDate, DateTime toSyncDate, UpdateCategoryCollection updateCategories, UpdateClassificationCollection updateClassifications)
   at Microsoft.UpdateServices.Internal.BaseApi.UpdateServer.GetUpdates(ApprovedStates approvedStates, DateTime fromSyncDate, DateTime toSyncDate, UpdateCategoryCollection updateCategories, UpdateClassificationCollection updateClassifications)
   at Microsoft.UpdateServices.Internal.BaseApi.UpdateServer.GetUpdates()
   at UpdatesToXML.UpdatesToXML.Main() in C:\Program Files\Update Services API Samples and Tools\Testing GetUpdates -- based on UpdatesToXML\UpdatesToXML.vb:line 35
Imports Microsoft.UpdateServices.Administration
 

        Dim iUpdateServer As IUpdateServer

        Dim AdminProxy As AdminProxy

...

            'connect to the local server

            AdminProxy = New AdminProxy

            iUpdateServer = AdminProxy.GetUpdateServer

            

            'get the complete list of updates

            UpdateCollection = iUpdateServer.GetUpdates()

            ' Print the number of updates and exit...

            Console.WriteLine("GetUpdates() returned {0} updates.", UpdateCollection.Count)

            Environment.Exit(-1)

...

Open in new window

0
Comment
Question by:rdefuria
2 Comments
 
LVL 31

Accepted Solution

by:
James Murrell earned 500 total points
ID: 20292348
my 1st thought is to add a timeout to the script........

2nd http://support.microsoft.com/kb/919004
0
 

Author Comment

by:rdefuria
ID: 20292528
The .vb code is listed above.  There is no way to increase the timeout via the Microsoft.UpdateServices.Administration object (that I can see).  That object abstracts all the underlying sql connectivity stuff for the SUSDB.

The other link you gave refers to a solution resolved with WSUS SP1, as I understand it.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Group policy not applying 5 29
sql query 7 36
shadow copies 7 19
add 1 to a field for 100 rows 11 24
Remote Apps is a feature in server 2008 which allows users to run applications off Remote Desktop Servers without having to log into them to run the applications.  The user can either have a desktop shortcut installed or go through the web portal to…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now