locked
Another Sync exception - need help ? RRS feed

  • Question

  • Hi all

    I have exception like this, when install sync to another development environment.

    Before it work fine in my development environment.

    I don't know why, please help.

    Thank you

    <ServiceError xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Synchronization.Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ErrorDescription>System.IndexOutOfRangeException&#xD;
    An SqlParameter with ParameterName '@sync_update_peer_key' is not contained by this SqlParameterCollection.&#xD;
    at System.Data.SqlClient.SqlParameterCollection.GetParameter(String parameterName)&#xD;
    at System.Data.SqlClient.SqlParameterCollection.get_Item(String parameterName)&#xD;
    at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.ExecuteCommandWithParameters(SqlSyncTableProvisioning table)&#xD;
    at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.CheckScopeParameters()&#xD;
    at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.ApplyScope(SqlConnection connection)&#xD;
    at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.ApplyInternal(SqlConnection connection)&#xD;
    at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.Apply()&#xD;
    at Microsoft.Synchronization.Services.SqlProvider.SqlSyncProviderService.CreateNewScopeForClient()&#xD;
    at Microsoft.Synchronization.Services.SqlProvider.SqlSyncProviderService.GetChanges(Byte[] clientKnowledgeBlob)&#xD;
    at Microsoft.Synchronization.Services.DownloadChangesRequestProcessor.ProcessRequest(Request incomingRequest)&#xD;
    at Microsoft.Synchronization.Services.SyncService`1.ProcessRequestForMessage(Stream messageBody)&#xD;
    &#xD;
    &#xD;
    </ErrorDescription></ServiceError>

    Friday, December 10, 2010 7:22 AM

Answers

  • Can you enable the diagnostic page using "config.EnableDiagnosticPage = true" in the InitializeService method of the service and then try to hit the service *.svc/$diag. Let me know what you see.
    SDE, Sync Framework - http://www.giyer.com
    Wednesday, December 22, 2010 6:01 PM

All replies

  • Hi

    Another exception

    I use Fidder to trace and see everything find

    But CacheController.RefreshCompleted  throw exception like this

    Unable to find a matching type for entry 'Entityname' in list of KnownTypes.
            StackTrace    "  
       at Microsoft.Synchronization.Services.Formatters.ReflectionUtility.GetObjectForType(EntryInfoWrapper wrapper, Type[] knownTypes)
       at Microsoft.Synchronization.Services.Formatters.ODataAtomReader.GetItem()
       at Microsoft.Synchronization.ClientServices.HttpCacheRequestHandler.OnDownloadGetResponseCompleted(IAsyncResult asyncResult)

    Please help.

    Thank you.

    Friday, December 10, 2010 2:35 PM
  • It looks like your database was provisioned with an older version of Microsoft Sync Framework  than the one used by your current sync service.  Could you please provision the database again using the SyncSvcUtilHelper and retry your scenario?
    Maria del Mar Alvarez Rohena Microsoft Sync Framework
    Friday, December 10, 2010 5:50 PM
  • I using SyncSvcUtilHelper to provision database on tow developer machine, one can work fine, and one throw exception. I really don't know what happen.

    About exception 2, because I changed namespace of file generated by Syn so It throw exception.

    Can I change namespace or name of property of code generated by Sync without error?

    Thank you

    Monday, December 13, 2010 1:55 AM
  • This is exception when I deploy Sync Service to another server

    <ServiceError xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Synchronization.Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ErrorDescription>System.InvalidOperationException&#xD;
    Unable to generate a temporary class (result=1).&#xD;
    error CS1061: 'Microsoft.Synchronization.Data.SqlServer.SqlSyncProviderAdapterConfiguration' does not contain a definition for 'BulkTableTypeName' and no extension method 'BulkTableTypeName' accepting a first argument of type 'Microsoft.Synchronization.Data.SqlServer.SqlSyncProviderAdapterConfiguration' could be found (are you missing a using directive or an assembly reference?)&#xD;
    error CS1061: 'Microsoft.Synchronization.Data.SqlServer.SqlSyncProviderAdapterConfiguration' does not contain a definition for 'BulkTableTypeName' and no extension method 'BulkTableTypeName' accepting a first argument of type 'Microsoft.Synchronization.Data.SqlServer.SqlSyncProviderAdapterConfiguration' could be found (are you missing a using directive or an assembly reference?)&#xD;
    &#xD;
       at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)&#xD;
       at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)&#xD;
       at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)&#xD;
       at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)&#xD;
       at Microsoft.Synchronization.Data.SqlServer.SqlProviderFactory.ReadConfigurationForTemplate(String templateName)&#xD;
       at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.PopulateFromTemplate(String scopeName, String templateName)&#xD;
       at Microsoft.Synchronization.Services.SqlProvider.SqlSyncProviderService.CreateNewScopeForClient()&#xD;
       at Microsoft.Synchronization.Services.SqlProvider.SqlSyncProviderService.GetChanges(Byte[] clientKnowledgeBlob)&#xD;
       at Microsoft.Synchronization.Services.DownloadChangesRequestProcessor.ProcessRequest(Request incomingRequest)&#xD;
       at Microsoft.Synchronization.Services.SyncService`1.ProcessRequestForMessage(Stream messageBody)&#xD;
    &#xD;
    &#xD;
    </ErrorDescription></ServiceError>

    Monday, December 13, 2010 8:13 AM
  • Hi BruceDo,

    In the CTP, you need to have the same namespace for the autogenerated entities class on both the server and the client. You ARE allowed to change it as long as it the same on both sides. This is necessary because there is no namespace mapping component yet on the client to map server and client namespaces if they are different. We may support this in a future release.

    There IS support to change the names of classes or properties of the autogenerated classes. To change the property mapping, you can add the [SyncEntityPropertyMapping] attribute on a property and add the column name in the database. After this, you can change the generated property name to something else. This approach is necessary because when changes need to be applied to the database, we need to know the actual column name in the store.

    For client side, the SyncSvcUIHelper should automatically generate the updated names since those are reflected in the /$metadata results.

    Hope this helps.


    SDE, Sync Framework - http://www.giyer.com
    Monday, December 13, 2010 5:29 PM
  • I investigated error when I change namespace, and I posted answer after. But, as you can see, I post 3 exceptions and the first one still open. I don't know how to fix

    <ServiceError xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Synchronization.Services" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ErrorDescription>System.IndexOutOfRangeException&#xD;
    An SqlParameter with ParameterName '@sync_update_peer_key' is not contained by this SqlParameterCollection.&#xD;
    at System.Data.SqlClient.SqlParameterCollection.GetParameter(String parameterName)&#xD;
    at System.Data.SqlClient.SqlParameterCollection.get_Item(String parameterName)&#xD;
    at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.ExecuteCommandWithParameters(SqlSyncTableProvisioning table)&#xD;
    at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.CheckScopeParameters()&#xD;
    at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.ApplyScope(SqlConnection connection)&#xD;
    at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.ApplyInternal(SqlConnection connection)&#xD;
    at Microsoft.Synchronization.Data.SqlServer.SqlSyncScopeProvisioning.Apply()&#xD;
    at Microsoft.Synchronization.Services.SqlProvider.SqlSyncProviderService.CreateNewScopeForClient()&#xD;
    at Microsoft.Synchronization.Services.SqlProvider.SqlSyncProviderService.GetChanges(Byte[] clientKnowledgeBlob)&#xD;
    at Microsoft.Synchronization.Services.DownloadChangesRequestProcessor.ProcessRequest(Request incomingRequest)&#xD;
    at Microsoft.Synchronization.Services.SyncService`1.ProcessRequestForMessage(Stream messageBody)&#xD;
    &#xD;
    &#xD;
    </ErrorDescription></ServiceError>

    Thank you.
    Wednesday, December 15, 2010 12:22 PM
  • Hi BruceDo,

    1. Is this a different database instance or are you pointing to the same database that worked with the first service you developed?

    2. Can you go into the database that you provisioned and check if all the *_selectchanges stored procedures have a @sync_update_peer_key input parameter. An absence of this parameter would indicate that the database was not provisioned correctly.


    SDE, Sync Framework - http://www.giyer.com
    Wednesday, December 15, 2010 6:19 PM
  • I user same database, but difference development computers. Although both of them installed  same Sync pakages, but one can work, and one can not.
    Thursday, December 16, 2010 6:36 AM
  • Can you go into the database that you provisioned and check if all the *_selectchanges stored procedures have a @sync_update_peer_key input parameter. An absence of this parameter would indicate that the database was not provisioned correctly.

     


    SDE, Sync Framework - http://www.giyer.com
    Thursday, December 16, 2010 5:20 PM
  • I don't think the database was not provisioned correctly.

    As I said, I have a database server was provisioned, and some development environments.

    But, some of them can run sync normally, and other can not run.

    Tuesday, December 21, 2010 6:20 AM
  • Can you enable the diagnostic page using "config.EnableDiagnosticPage = true" in the InitializeService method of the service and then try to hit the service *.svc/$diag. Let me know what you see.
    SDE, Sync Framework - http://www.giyer.com
    Wednesday, December 22, 2010 6:01 PM
  • Yes, I know, I looked that page and every is OK.

    and as I said I can work in some machine, and can not work on some.

    Thursday, December 23, 2010 6:28 AM
  • In my case, that exception was thrown because my table´s name was different from the entity name. For example, table´s name = "Clients" but entity name = "Client"
    Friday, January 17, 2014 7:08 PM