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
Solved

WSUS Sql timeout for GetUpdates() method invocation

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

860 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