Solved

WSUS Sql timeout for GetUpdates() method invocation

Posted on 2007-11-15
2
796 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

929 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

10 Experts available now in Live!

Get 1:1 Help Now