Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WSUS Sql timeout for GetUpdates() method invocation

951 views
Skip to first unread message

RD

unread,
Nov 15, 2007, 4:18:24 PM11/15/07
to
Hello,

I have a very simple WSUS API program (based on WSUS's Update Services API
Samples and Tools\UpdatesToXML solution).

All it does is invoke AdminProxy.GetUpdateServer.GetUpdates() then print the
number of updates in the collection.

Here's the VB code snippet:
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)
...

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


Every other run or so this fails with the error given in the stack trace below;
the other times it works fine.

Thoughts?

Thanks.

-Rich


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

Lawrence Garvin [MVP]

unread,
Nov 16, 2007, 10:20:18 PM11/16/07
to
"RD" <rdef...@gmail.com> wrote in message
news:473CB7A0...@gmail.com...


> 'get the complete list of updates

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

> Error text: Timeout expired.

To be perfectly honest... if you're trying to "get the complete list of
updates" on a WSUS 2.0 server running on 1GB RAM, I'm not at all surprised
that you're getting Timeout errors.

I'd suggest starting by enhancing that script to only retrieve
Non-Declined/Non-Expired updates,
or filter it by Operating System or Application.

Also, if you've never performed any "maintenance" on the WSUS environment,
you might try this procedure:

http://www.wsuswiki.com/mowingthegrass


A third option is UPGRADE to WSUS 3.0, which will get you a couple of
things:
[a] An upgrade from WMSDE to the Windows Internal Database (based on the
SQL2005 engine), which should be good for an instantaneous 50% improvement
in performance.
[b] The removal of the ASP.NET User Interface -- which sucks up some
resources better transferred to a remote MMC client.
[c] Optimized code that simply makes WSUS run faster overall, thus
making more resources in your resource constrained system available for
things like "get the complete list of updates"

--
Lawrence Garvin, M.S., MCTS, MCP
Senior Data Architect, APQC, Houston, Texas
MVP - Software Distribution (2005-2007)

MS WSUS Website: http://www.microsoft.com/wsus
My Websites: http://www.onsitechsolutions.com;
http://wsusinfo.onsitechsolutions.com
My MVP Profile: http://mvp.support.microsoft.com/profile/Lawrence.Garvin

0 new messages