Resolved – SharePoint Profile Sync Problems

I have just resolved a very annoying profile sync problem, although the solution is not 100% clear:

 

Issue:

Data in users' profiles was not syncing into a Site Collection from the profile database.  Other Site Collections in the same Content Database were syncing fine, but one particular Site Collection was not.  The following errors were added to the logs each time a full sync was attempted (I recommend for testing running “stsadm -o sync -synctiming m:1″ but remember to set it back when you are done):

 

SyncLog70670000000002 WebApp SharePoint – dasitstassp(0316b518-97dc-4291-b229-94d6723cc40b), ContentDB WSS_Content_dasitstassp(ff034579-1c81-4a60-9f5c-2daa8b21f28d): Exception creating user and/or membership change collection for site – most likely due to falling off the end of the change log (repeated failure to sync this site incrementally?).  Will do full synchronization.  Exception follows: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.SPChangeToken..ctor(String strChangeToken)     at Microsoft.Office.Server.UserProfiles.SiteSynchronizerCollection.GetSynchInfoForSite(SqlDataReader dr, SynchInfo info)    

 

ProfSynch: Exception attempting to enumerate site d8b1cae6-e169-4f07-ab44-5cb719ac4917 for ContentDB 78c875bf-ffdc-4a14-b0da-2f1328d29dae: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.SPSite.PreinitializeServer(SPRequest request)     at Microsoft.SharePoint.SPSite.GetSPRequest()     at Microsoft.SharePoint.SPSite.get_Request()     at Microsoft.SharePoint.SPSite.get_ReadLocked()     at Microsoft.Office.Server.UserProfiles.SiteSynchronizerCollection.GetSynchInfoForSite(SqlDataReader dr, SynchInfo info)     at Microsoft.Office.Server.UserProfiles.SiteSynchronizerCollection.<get_Elements>d__0.MoveNext()    

 

2 Possible Causes:

I cannot say for sure what the cause was as it required a timer service restart to make the fix actually work.  Having profiled the database while the profile sync executed, I noticed that it wasn't reading in a user list, or doing anything of relevance in fact, so I figured I would need to restart the timer service to get any changes to take effect i.e. it must cache the user list on first run.  On doing that, the problem went away.  There were two things that might have made it work:

 

1) “stsadm -o sync -deleteolddatabases 0″

2) There were users in the User Information List that did not exist within the domain. in my case, not just users that were deleted from the domain but users who were in a completely different domain – I had restored a backup from another domain and it caused there to be redundant users in the database from the previous domain – so I deleted those users.

 

Without re-creating the problem and testing all over again, I cannot be sure what exactly resolved the issue – and I have spent more than long enough on this now!

 

I hope this helps!

Leave a Reply