Tuesday 24 June 2014

WSUS Sync Fails at some random patch or percentage

Problem Statement:
After a Site Rebuild, all your SCCM services are up and running with clients reporting as well, when you install WSUS and Sync, there are no issues but the moment you install SUP role, the Sync halts at a particular patch and throws operation timed out error after 60 minutes, this behavior keeps happening even after multiple reinstallation of WSUS and SUP
 

Symptoms:
The Wsyncmgr.log shows the following error:

*** EXEC sp_MigrateSDMPackage 49656, 387495, 0
*** [HYT00][0][Microsoft][ODBC SQL Server Driver]Timeout expired
STATMSG: ID=6703 SEV=E LEV=M SOURCE="SMS Server" COMP="SMS_WSUS_SYNC_MANAGER" SYS=ALSMS SITE=ALL PID=2636 TID=5064 GMTDATE=Mon Jun 23 03:16:43.426 2014 ISTR0="" ISTR1="The operation has timed out" ISTR2="" ISTR3="" ISTR4="" ISTR5="" ISTR6="" ISTR7="" ISTR8="" ISTR9="" NUMATTRS=0
Sync failed. Will retry in 60 minutes

Applies to: SCCM 2007
 
 
Troubleshooting Steps:
1. Take a complete Site backup
2. Open SQL Server Management Studio
3. Expand you SMS_<sitecode> database(Your SCCM Database)
4. Create New Query
5. Type “Select * from CI_ConfigurationItems Where CIType_ID in (1, 6, 8)”
6. You will see many rows in your result relating to all the Metadata from Microsoft Updates
7. Type “Delete from CI_ConfigurationItems Where CIType_ID in (1, 6, 8)”
8. The process will take nearly 15 to 20 minutes depending on the number of entries you have
9. Type “Update CI_SDMPackages set IsDeleted = 1 where SourceSite = '<sitecode>”
10. Type “Exec sp_DeleteOldSDMPackageData 0”
11. It will take a while to delete all the old SDM package data
12. Post this Run the WSUS Sync.
Note: Before performing all this step ensure that the WSUS Sync Manager is not trying to sync or running an active sync, it is recommended to stop the component before performing this activity.
 
Root Cause Analysis:
Certain tables in the Site database will get updated when SCCM tries to perform a Sync, these CI’s will not get updated when Wsyncmgr component tries to update these values in SQL, hence the operation times out and the Sync never happens no matter how many times you reinstall the WSUS and SUP. Hence removing these particular entries from Database will make sure that Sync completes.