locked
CTP2 issue (COM Exception while syncronizing) RRS feed

  • Question

  • When we use syncronization using DbPeerSync over WCF we got this error(we also got this error using filesync as well).

    System.Runtime.Serialization.SerializationException: Exception from HRESULT: 0x8004100C ---> System.Runtime.InteropServices.COMException (0x8004100C): Exception from HRESULT: 0x8004100C

       at Microsoft.Synchronization.CoreInterop.SyncServicesClass.DeserializeSyncKnowledge(Byte[] pbKnowledge, UInt32 cbKnowledge, IReplicaKeyMap pReplicaKeyMap)

       at Microsoft.Synchronization.SyncKnowledge.DeserializeHelper(SyncIdFormatGroup idFormats, Byte[] data, IReplicaKeyMap replicaKeyMap)

       --- End of inner exception stack trace ---

       at Microsoft.Synchronization.SyncKnowledge.DeserializeHelper(SyncIdFormatGroup idFormats, Byte[] data, IReplicaKeyMap replicaKeyMap)

       at Microsoft.Synchronization.SyncKnowledge.Deserialize(SyncIdFormatGroup idFormats, Byte[] data)

       at Microsoft.Synchronization.Data.Peer.DbPeerSyncProvider.ReadScopeInfo(SyncScopeMetadata scopeMetadata)

       at Microsoft.Synchronization.Data.Peer.DbPeerSyncProvider.GetChanges(SyncScopeMetadata scopeMetadata, PeerDataSyncSession PeerDataSyncSession)

       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)

     

     

    We also got this error using CTP1 but the following config section fixed the issue but for CTP2 is continue to same error even after adding the following config section.

    <system.runtime.serialization>

        <dataContractSerializer>

          <declaredTypes>

            <add type="Microsoft.Synchronization.ForgottenKnowledge, Microsoft.Synchronization">

              <knownType type="Microsoft.Synchronization.SyncIdFormatGroup, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

              <knownType type="Microsoft.Synchronization.SyncId, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

            </add>

            <add type="Microsoft.Synchronization.SyncKnowledge, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91">

              <knownType type="Microsoft.Synchronization.SyncIdFormatGroup, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

              <knownType type="Microsoft.Synchronization.SyncId, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

            </add>

          </declaredTypes>

        </dataContractSerializer>

      </system.runtime.serialization>

    • Moved by Tina_Tian Friday, April 22, 2011 8:00 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, March 10, 2008 12:04 AM

Answers

  • Hi Udai,

     

    Your configuration file looks good too. Is it possible for you to prepare a repro? We tested the OCS peer sync provider with WCF and did not see any issues. We need to debug your scenario to figure out the root cause. 

     

    Thanks,

    Dong

    Tuesday, March 11, 2008 4:45 PM
    Moderator

All replies

  • Hi Udai,

     

    May you post your full WCF configuration and contract definition? Can you also verify that you have updated both client and server sides to use the CTP2 assemblies?

     

    Thanks,

    Dong

    Monday, March 10, 2008 7:51 PM
    Moderator
  •  

    I have completely uninstall CTP1 before re-install CTP2.  We have this issue both FileSync as well as DbSync. It will work first time because the syncknowledge and cleanupknowledge stored as null.  Once the value is stored by provider after first sync it will fail on subsequent sync.  We have this problem in both file and db sync.  Note: This code worked in CTP1Refresh and i have removed several lines to keep this message very simple.  In addition to the actual thread info the targetted os is Windows XP sp2 andalso both server and client side are hosted in same computer (hence they both ctp2). The contract looks as follows:

    CONTRACT:

    [ServiceContract]

    public interface ISyncService

    {

    [OperationContract]

    PeerDataSyncContext GetChanges(SyncScopeMetadata scopeMetadata, PeerDataSyncSession syncSession);

     

    [OperationContract]

    PeerDataSyncContext ApplyChanges(SyncScopeMetadata scopeMetadata, DataSet dataSet, PeerDataSyncSession syncSession);

     

    [OperationContract]

    SyncScope GetScope(PeerDataSyncSession syncSession);

    [OperationContract(IsOneWay = true)]

    void InitializeParam(String param, bool stage);

    }

     

     

    IMPLEMENTATION:

    public class SyncService : ISyncService

    {

    DbPeerSyncProvider _peerProvider;

    #region ISyncService Members

    public void InitializeParam(String param, bool stage)

    {

    try

    {

    //This method will be called once the service instance is created to Initialize the DbPeerSyncProvider commands.

    //code block here will be executed before assigning to serviceproxy.

    }

    catch (Exception)

    {

    }

    }

    public PeerDataSyncContext GetChanges(SyncScopeMetadata scopeMetadata, PeerDataSyncSession syncSession)

    {

    try

    {

    return _peerProvider.GetChanges(scopeMetadata, syncSession);

    }

    catch (Exception ex)

    {

    }

    }

    public PeerDataSyncContext ApplyChanges(SyncScopeMetadata scopeMetadata, DataSet dataSet, PeerDataSyncSession syncSession)

    {

    try

    {

    return _peerProvider.ApplyChanges(scopeMetadata, dataSet, syncSession);

    }

    catch (Exception ex)

    {

    }

    }

    public SyncScope GetScope(PeerDataSyncSession syncSession)

    {

    try

    {

    return _peerProvider.GetScope(syncSession);

    //Possible failure will happen due the change inforamtion

    }

    catch (Exception ex)

    {

    }

    }

    }
    Monday, March 10, 2008 8:32 PM
  • Hi Udai,

     

    I did not see anything wrong in your contract. Can you share me your Web.config file as well? I also want to know if you host your WCF service with IIS or your own executable.

     

    Thanks
    Dong

    Monday, March 10, 2008 10:13 PM
    Moderator
  • The problem produced using both windows service and also vs2008 WcfSvcHost.exe(a tool comes with 2008).  The problem simply occurs with ChangeBatch it seems there is a serialization issue with this method.  As i said it is worked with CTP1 there is no change from our code expect class re-factoring as per CTP2.  Copy of config section is as follows:

    SERVER CONFIG:

    <system.runtime.serialization>

    <dataContractSerializer>

    <declaredTypes>

    <add type="Microsoft.Synchronization.ForgottenKnowledge, Microsoft.Synchronization">

    <knownType type="Microsoft.Synchronization.SyncIdFormatGroup, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    <knownType type="Microsoft.Synchronization.SyncId, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    </add>

    <add type="Microsoft.Synchronization.SyncKnowledge, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91">

    <knownType type="Microsoft.Synchronization.SyncIdFormatGroup, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    <knownType type="Microsoft.Synchronization.SyncId, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    </add>

    </declaredTypes>

    </dataContractSerializer>

    </system.runtime.serialization>

    <system.serviceModel>

    <behaviors>

    <serviceBehaviors>

    <behavior name="DbSyncServiceBehavior">

    <serviceDebug includeExceptionDetailInFaults="true" />

    <serviceMetadata httpGetEnabled="true" />

    </behavior>

    </serviceBehaviors>

    </behaviors>

    <bindings>

    <wsHttpBinding>

    <binding name="DbSyncServiceBinding" maxReceivedMessageSize="2147483647" />

    </wsHttpBinding>

    </bindings>

    <services>

    <service behaviorConfiguration="DbSyncServiceBehavior" name="Service.SyncService">

    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="DbSyncServiceBinding"

    name="wsHttpBinding_SyncService" contract="Service.ISyncService" />

    <host>

    <baseAddresses>

    <add baseAddress=http://localhost:8000/Services/Sync />

    </baseAddresses>

    </host>

    </service>

    </services>

    </system.serviceModel>

    .......

     

    CLIENT CONFIG

    <system.runtime.serialization>

    <dataContractSerializer>

    <declaredTypes>

    <add type="Microsoft.Synchronization.ForgottenKnowledge, Microsoft.Synchronization">

    <knownType type="Microsoft.Synchronization.SyncIdFormatGroup, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    <knownType type="Microsoft.Synchronization.SyncId, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    </add>

    <add type="Microsoft.Synchronization.SyncKnowledge, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91">

    <knownType type="Microsoft.Synchronization.SyncIdFormatGroup, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    <knownType type="Microsoft.Synchronization.SyncId, Microsoft.Synchronization, Version=0.94.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />

    </add>

    </declaredTypes>

    </dataContractSerializer>

    </system.runtime.serialization>

    <system.serviceModel>

    <bindings>

    <wsHttpBinding>

    <binding name="wsHttpBinding_SyncService" closeTimeout="00:01:00"

    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"

    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"

    maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647"

    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"

    allowCookies="false">

    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

    maxBytesPerRead="4096" maxNameTableCharCount="16384" />

    <reliableSession ordered="true" inactivityTimeout="00:10:00"

    enabled="false" />

    <security mode="Message">

    <transport clientCredentialType="Windows" proxyCredentialType="None"

    realm="" />

    <message clientCredentialType="Windows" negotiateServiceCredential="true"

    algorithmSuite="Default" establishSecurityContext="true" />

    </security>

    </binding>

    </wsHttpBinding>

    </bindings>

    <client>

    <endpoint address=http://localhost:8000/Services/Sync binding="wsHttpBinding"

    bindingConfiguration="wsHttpBinding_SyncService" contract="SyncService.ISyncService"

    name="wsHttpBinding_SyncService">

    </endpoint>

    </client>

    </system.serviceModel>

    ....

    I am positive some serialization issue in ctp2 because we see this problem with file sync as well on ChangeBatch method.

     

    Your help is appricated.

     

    Thanks,

    Udai.

    Monday, March 10, 2008 11:22 PM
  • Hi Udai,

     

    Your configuration file looks good too. Is it possible for you to prepare a repro? We tested the OCS peer sync provider with WCF and did not see any issues. We need to debug your scenario to figure out the root cause. 

     

    Thanks,

    Dong

    Tuesday, March 11, 2008 4:45 PM
    Moderator
  • Hi Dong,

    You are right, I had changed the UpdateScopeInfoCommand after adding ctp2 that caused this issue.  It works fine.  Thanks for your help.

     

    Regards,

    Udai.

    Wednesday, March 12, 2008 3:27 PM
  • Hi Udai,

     

    May I know what is wrong with your UpdateScopeInfoCommand? It will help us assist other customers in case they hit a similar issue.

     

    Thanks,
    Dong

     

    Friday, March 14, 2008 5:06 AM
    Moderator
  • I'd really like to know how you solved this please!
    Friday, September 26, 2008 1:13 AM
  • COM Exception are quite obvious if the the system has misplaced or old reference.  Try uninstall all the old versions of the sync assembly give a reboot to the system and do a clean install you should be all set.  If you are using 64 bit computer make sure you have marked your assembly is Neutral or X64, mixing will also cause this problem.

     

    Thanks.

     

    Friday, September 26, 2008 4:31 PM
  • hello

    i am not much familiar with  sync services of microsoft. how to start developing of this. can u please help me. its very urgent.

    i developed P2P sync with CTP1. but i have not very depth knowledge of CTP2.
    please you give reference/URL where i will get help.

    thanks and regards
    Luxmi
    Thursday, October 23, 2008 5:06 AM
  • hello

    i am not much familiar with  sync services of microsoft. how to start developing of this. can u please help me. its very urgent.

    i developed P2P sync with CTP1. but i have not very depth knowledge of CTP2.
    please you give reference/URL where i will get help.

    thanks and regards
    Luxmi
    Thursday, October 23, 2008 11:30 AM