Solved

WSUS Sql timeout for GetUpdates() method invocation

Posted on 2007-11-15
2
817 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

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.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

735 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