Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

WSUS Sql timeout for GetUpdates() method invocation

Posted on 2007-11-15
2
Medium Priority
?
880 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 1500 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

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

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

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

688 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