locked
Value cannot be null. Parameter name: sourceForgottenKnowledge RRS feed

  • Question

  • I’m receiving the following error from Sync Services: "Value cannot be null. Parameter name: sourceForgottenKnowledge".  The error is thrown from the Synchronize method call on a PeerDataProvider. 

     

    I’m guessing that the ForgottenKnowledge property of the SyncScope is not being set.  But I can’t find anywhere saying that I should be setting it to anything.

    I’m wondering if anyone has any thoughts on how I can prevent this error from occurring.

     

    Stack Trace:

       at Microsoft.Synchronization.ChangeBatch..ctor(SyncIdFormatGroup idFormats, SyncKnowledge destinationKnowledge, ForgottenKnowledge sourceForgottenKnowledge)

       at Microsoft.Synchronization.Data.Peer.PeerDataSyncProviderProxy.BuildChangeBatch(SyncKnowledge destinationKnowledge, ForgottenKnowledge sourceForgottenKnolwedge)

       at Microsoft.Synchronization.Data.Peer.PeerDataSyncProviderProxy.GetChangeBatch(UInt32 batchSize, SyncKnowledge destinationKnowledge, Object& changeDataRetriever)

       at Microsoft.Synchronization.KnowledgeProviderProxy.GetChangeBatch(UInt32 dwBatchSize, ISyncKnowledge pSyncKnowledge, ISyncChangeBatch& ppChangeBatch, Object& ppUnkDataRetriever)

       at Microsoft.Synchronization.CoreInterop.ISyncSession.Start(CONFLICT_RESOLUTION_POLICY resolutionPolicy, _SYNC_SESSION_STATISTICS& pSyncSessionStatistics)

       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(SyncIdFormatGroup sourceIdFormats, SyncIdFormatGroup destinationIdFormats, KnowledgeSyncProviderConfiguration destinationConfiguration, SyncCallbacks DestinationCallbacks, ISyncProvider sourceProxy, ISyncProvider destinationProxy, Int32& changesApplied, Int32& changesFailed)

       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWayKnowledgeSync(SyncProvider sourceProvider, SyncProvider destinationProvider, Int32& changesApplied, Int32& changesFailed)

       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.Synchronize()

       at Microsoft.Synchronization.SyncOrchestrator.Synchronize()

     

    Pierre

    • Moved by Max Wang_1983 Friday, April 22, 2011 4:48 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Thursday, July 3, 2008 9:09 PM

All replies

  • Alright, I give up.   I’m completely at a lose trying to figure out why I get this sourceForgottenKnowledge error.  Can anyone tell me

     

    1-      What condition would cause Sync Services for ADO.NET to require that the sourceForgottenKnowledge property of the PeerDataSyncProviderProxy be initialized?

    2-      How can I provide a PeerDataSyncProviderProxy with a KnowledgeScope object that it can use to initialize it’s sourceForgottenKnowledge property?

    3-      Since this error message is internal to Sync Service, why does it not create the object as required or identify the deficiency at design time?

     

    Any help will be greatly appreciated.

    Pierre

    Tuesday, July 8, 2008 3:12 PM
  •  

    Hi Pierre,

     

    SourceForgottenKnowledge is stored in the Scope table and fetched by SelectScopeInfoCommand. If you forget the "sync_scope_cleanup_knowledge" column when creating scope table or constructing the select query, the SourceForgottenKnowledge will be null. Please check your table schema and SelectScopeInfoCommand query.

     

    If you cannot find any problem in your code, please share your code and database setup scripts. We will take a look.

     

    Thanks,

    Dong

    Tuesday, July 8, 2008 7:14 PM
    Moderator
  • Thank you for the reply.

     

    My scope table does contain a sync_scope_cleanup_knowledge column.  Here is the create script for it

    Code Snippet
    CREATE TABLE [dbo].sync_SCOPE(
     [scope_id] [uniqueidentifier] NULL DEFAULT (newid()),
     [scope_name] [nvarchar](100) NULL,
     [scope_sync_knowledge] [varbinary](max) NULL,
     [scope_tombstone_cleanup_knowledge] [varbinary](max) NULL,
     [scope_timestamp] [timestamp] NOT NULL
    ) ON [PRIMARY]

     

     

     

    And the SelectScopeInfo command does return the value

    Code Snippet

    CREATE Procedure [dbo].[sync_SCOPE_selectRow]
     (
      @sync_scope_name NVarChar(100),
      @sync_scope_id UniqueIdentifier Output,
      @sync_scope_knowledge VarBinary(8000) Output,
      @sync_scope_cleanup_knowledge VarBinary(8000) Output,
      @sync_scope_timestamp BigInt Output

     )
    AS

     SELECT
              @sync_scope_id = scope_Id,
              @sync_scope_knowledge = scope_sync_knowledge,
              @sync_scope_cleanup_knowledge = scope_tombstone_cleanup_knowledge,
              @sync_scope_timestamp = scope_timestamp
      FROM
       sync_SCOPE
      WHERE
       scope_name = @sync_scope_name
    GO

     

     

    That being said, the value returned is still NULL for the initial execution.  This is the capture of the output of the command by SQL Profiler.

    Code Snippet
    declare @p2 uniqueidentifier
    set @p2='AAB62278-3BD3-4311-9E20-CCED64982DA1'
    declare @p3 varbinary(8000)
    set @p3=NULL
    declare @p4 varbinary(8000)
    set @p4=NULL
    declare @p5 bigint
    set @p5=53001
    exec sync_SCOPE_selectRow @sync_scope_name=N'PRS.WC_TYPE',@sync_scope_id=@p2 output,@sync_scope_knowledge=@p3 output,@sync_scope_cleanup_knowledge=@p4 output,@sync_scope_timestamp=@p5 output
    select @p2, @p3, @p4, @p5

     

     

    Should I be setting it to default value for the column?

     

    Pierre

    Tuesday, July 8, 2008 8:02 PM
  • Your code snippets look good to me. I think that my original guess is wrong. It is difficult to tell why you get null sourceForgottenKnowledge with the current information. Can you share me a simlified repro?

     

    Before GetChangeBatch is called in the source provider, GetSyncBatchParameters has been called in destination provider already. It reads the scope_info table too. From you case, that call seems ok. It means that the problem may not be relatd to the scope_info table.

     

    Thanks,

    Dong

    Wednesday, July 9, 2008 11:54 PM
    Moderator
  • Did you make any progress with this issue?
    Thursday, September 25, 2008 12:08 AM
  • I solved this issue. It was the result of a poorly constructed query. Now onto my next problem: 
    "Deserialization failed, typically due to invalid serialization data supplied to the deserializer." 
    Thursday, September 25, 2008 9:10 PM