locked
Sync Job Failing with a an error in ReadCred RRS feed

  • Question

  • I recently signed up and received a SQL Azure account and I am trying to use the Sync Framework and Microsoft Sync Framework Power Pack for SQL Azure November CTP.  The setup and provisioning work fine it is just the sync job that fails with this error:

    System.Exception: ReadCred failed with the error code 1312.     at SyncLocalSqlAzureDatabase.Credentials.ReadCred(String key)     at SyncLocalSqlAzureDatabase.Program.CommandLineArgs.ParseArgs(String[] args)     at SyncLocalSqlAzureDatabase.Program.Main(String[] args).  Process Exit Code 1.  The step failed.

    Anyone have any ideas why?

    Setup is Windows 7 64-but with SQL Server 2008 Developer Edition and VS 2008 SP1.
    • Edited by Jack Corbett Thursday, December 3, 2009 8:50 PM Left out pertinent information
    Thursday, December 3, 2009 8:41 PM

Answers

  • Oh, ok that issue is a little easier (I think).  This is due to the fact that we only released a 32-bit version of the Power Pack and I expect you installed 64-bit version of Sync Framework.  There are additional details here:

    http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/94d3360a-3c2f-4725-bf43-8e2caf88481b

    As mentioned in this thread I will try to make this more obvious in the instructions.

    Liam
    Sr. Program Manager, SQL Azure and Sync Framework - http://msdn.microsoft.com/sync/
    • Marked as answer by Jack Corbett Monday, December 7, 2009 7:58 PM
    Friday, December 4, 2009 7:51 PM
  • It does look like there is an issue with using the proxy account when the account is not a domain account and we will look into fixing this for the next release.  The workaround for now is to use one of the domain accounts.  For now if you need to use SQL Agent I would suggest as a temporary workaround to log on as an Admin (such as yourself, meaning choose "This Account" and enter your Admin user and password).

    As mentioned above, you should be able to call this command line used by the SQL Agent externally which also means you could consider looking into running this from some scheduled job like AT (i.e. for more details at cmd line type: AT /?).

    phertel, perhaps you could give some additional details on your exception because I suspect this is differnt than the readcred issue.  FWIW, 99% of the people who have stated they have had an exception have been due to the fact that they needed to install Sync Framework - 32 bit (not 64 bit, even on 64 bit machines).  More details on this here: http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/94d3360a-3c2f-4725-bf43-8e2caf88481b/

    Liam

    Sr. Program Manager, SQL Azure and Sync Framework - http://msdn.microsoft.com/sync/
    Monday, December 7, 2009 7:54 PM
  • Hi Uriah,

    There is more information on the SQL Azure Data Sync CTP tool for synchronizing SQL Server to SQL Azure here:

    http://www.microsoft.com/windowsazure/sqlazure/datasync/default.aspx

    If you are interested in our latest sync service to sync SQL Azure to SQL Azure, you can sign up the SQL Azure Data Sync service here:

    http://sqlazurelabs.com

    Liam


    Sr. Program Manager, SQL Azure and Sync Framework - http://msdn.microsoft.com/sync/
    Tuesday, September 7, 2010 3:33 PM

All replies

  • Thanks for posting Jack, we are looking into this issue.

    Liam
    Sr. Program Manager, SQL Azure and Sync Framework - http://msdn.microsoft.com/sync/
    Friday, December 4, 2009 12:13 AM
  • Hi Jack,
    The sync job needs to log in to the credential cache to access the username and password for the azure database. For this the sync job must be set to operate under the same account as the SQL server. Here is the excertp from the walkthrough doc.

    " a.       In order for the job to run successfully, the credentials used by the SQL Server Agent service must match the credentials of the account running the job. A workaround to this limitation would be to create a SQL Server proxy account under which the job can be run. The credentials for this proxy account would then have to match the credentials used by SQL Server Agent."

    Can you ensure that the job has the rigth credentials.

    Maheshwar Jayaraman - WCF -- http://blogs.msdn.com/dotnetremoting
    Friday, December 4, 2009 12:17 AM
  • The job is executing as the SQL Server Agent Service Account which is LocalSystem, so I would think that the account would not be the issue, but I'm willing to try something else if you think it will help.
    Friday, December 4, 2009 2:43 AM
  • Hi Jack,

    Another thing you might want to try (just as a test) is to run the sync manually (outside of SQL Agent).  To do this:

    1) From SSMS right click on the properties of the SQL Agent
    2) Choose Steps | Edit and copy the entire command line from the Command: text box
    3) Open a cmd prompt (you might to run the cmdbox as Administrator just as an initial test)
    4) Paste in the command line and execute it

    The results from the command line should look something like this:

    Local Table: dbo.videos Progress: SelectingChanges
    Session Progress: ChangeEnumeration
    Session Progress: ChangeApplication
    Remote Table: dbo.videos Progress: SelectingChange
    Session Progress: ChangeEnumeration
    Session Progress: ChangeApplication

    Sync stats:

    Sync time: 0.0553722033333333
    Uploaded - Total : 0, Succeed = 0 ,Failed : 0
    Downloaded - Total : 0, Succeed = 0 ,Failed : 0

    Liam


    Sr. Program Manager, SQL Azure and Sync Framework - http://msdn.microsoft.com/sync/
    Friday, December 4, 2009 4:38 PM
  • One of the requirements is SQL Server 2008 R2 Nov-CTP yours is different. Could this be the reason?
    mysorian
    Friday, December 4, 2009 7:37 PM
  • Liam,

    Ran from the cmd line as administrator (yes, I right-clicked and did "Run Administrator).  Here's the result (lots more error information):

    C:\Windows\system32>"C:\Program Files (x86)\Microsoft Sync Framework\Power Pack
    For SQL Azure November CTP\SyncLocalSqlAzureDatabase.exe" -localServer localhost
     -localDb adventureworks -SqlAzureDb ad -scope Sync_adventureworks -SqlAzureServ
    er aemgixc0t7.database.windows.net -SqlAzureUser unclebiguns -SqlAzurePassword p
    asswordbf7b04b9-8371-4560-9790-6e98606a0064 -ConflictResolutionPolicy LocalServe
    rWins

    Microsoft.Synchronization.SyncException: Retrieving the COM class factory for co
    mponent with CLSID {046C184F-2188-4C99-A95A-9C0DCDC19050} failed due to the foll
    owing error: 80040154. ---> System.Runtime.InteropServices.COMException (0x80040
    154): Retrieving the COM class factory for component with CLSID {046C184F-2188-4
    C99-A95A-9C0DCDC19050} failed due to the following error: 80040154.
       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(Syn
    cIdFormatGroup sourceIdFormats, SyncIdFormatGroup destinationIdFormats, Knowledg
    eSyncProviderConfiguration destinationConfiguration, SyncCallbacks DestinationCa
    llbacks, ISyncProvider sourceProxy, ISyncProvider destinationProxy, ChangeDataAd
    apter callbackChangeDataAdapter, SyncDataConverter conflictDataConverter, Int32&
     changesApplied, Int32& changesFailed)
       --- End of inner exception stack trace ---
       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(Syn
    cIdFormatGroup sourceIdFormats, SyncIdFormatGroup destinationIdFormats, Knowledg
    eSyncProviderConfiguration destinationConfiguration, SyncCallbacks DestinationCa
    llbacks, ISyncProvider sourceProxy, ISyncProvider destinationProxy, ChangeDataAd
    apter callbackChangeDataAdapter, SyncDataConverter conflictDataConverter, Int32&
     changesApplied, Int32& changesFailed)
       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWayKnowledgeSync(
    SyncDataConverter sourceConverter, SyncDataConverter destinationConverter, SyncP
    rovider sourceProvider, SyncProvider destinationProvider, Int32& changesApplied,
     Int32& changesFailed)
       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.Synchronize()
       at Microsoft.Synchronization.SyncOrchestrator.Synchronize()
       at SyncLocalSqlAzureDatabase.Program.Main(String[] args)
    Friday, December 4, 2009 7:38 PM
  • Oh, ok that issue is a little easier (I think).  This is due to the fact that we only released a 32-bit version of the Power Pack and I expect you installed 64-bit version of Sync Framework.  There are additional details here:

    http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/94d3360a-3c2f-4725-bf43-8e2caf88481b

    As mentioned in this thread I will try to make this more obvious in the instructions.

    Liam
    Sr. Program Manager, SQL Azure and Sync Framework - http://msdn.microsoft.com/sync/
    • Marked as answer by Jack Corbett Monday, December 7, 2009 7:58 PM
    Friday, December 4, 2009 7:51 PM
  • Apparently you can only have 1 version of the sync framework installed.  I got a newer version exists error when trying to install the 32-bit version with the 64-bit version installed.

    Uninstalled the 64-bit version and installed 32-bit version.  

    Then I re-ran the sync utility to re-create the database on Azure, provision the local database, and create the sync job.

    Runs from cmd prompt, but still fails from SQLAgent job with the ReadCred error.

    The way I read the walkthrough, it should work with 2008, but prefers 2008 R2.  I just have 2008 could this be the issue?

    If I create a credential and proxy for the job what does it need to be?  I don't think the instructions quoted above are real clear.  The job is running under the SQL Server Agent Service account and the SQL Server Agent is running the job, so they match at this point.  Could it be a Windows 7 UAC problem?



    Friday, December 4, 2009 10:48 PM
  • I really don't think that the problem is related to 2008 vs 2008 R2 since I have primarily been using it lately with 2008.  Just as a quick test can you stop the SQL Agent, change the SQL Server SQL Agent to log on as yourself (meaning choose "This Account" and enter your Admin user and password), restart it and try again?

    Liam
    Sr. Program Manager, SQL Azure and Sync Framework - http://msdn.microsoft.com/sync/
    Friday, December 4, 2009 10:58 PM
  • Worked with SQL Server Agent Service running under my login.  

    I should note that this is my personal laptop, not on a domain.

    Earlier I tried creating a credential using my account and setup a proxy to run the job using that credential.  This was when SQL Server Agent was running under local system and failed then as well.  
    Friday, December 4, 2009 11:25 PM
  • Hi Jack,

    First off, thank-you for being so patient while we work to resolve this issue for you and also for the feedback. 

    I did want to let you know that I have been able to reproduce the "ReadCred" error when using a SQL Server proxy account.  I am now trying to work with the engineers to determine what the proper way to accomplish this is when using a proxy account and will get back to you soon on this.

    Hopefully in the meantime you will be able to use the "workaround" to use your own login.

    Liam
    Sr. Program Manager, SQL Azure and Sync Framework - http://msdn.microsoft.com/sync/
    Friday, December 4, 2009 11:53 PM
  • No problem.  This isn't a production issue or anything, just trying to learn how to make it work.

    I'll definitely be interested in how to make a proxy work.  I'm also interested in why the local system login for the service account doesn't work, I would think that it should.

    Certainly for now the workaround is acceptable.

    Thanks for your help.
    Saturday, December 5, 2009 12:43 AM
  • It may very well work with SQL Servefr 2008, but why don't you install SSMS for SQL Server 2008 R2 Nov-CTP and give it a try.
    mysorian
    Saturday, December 5, 2009 3:58 PM
  • I am having the same readCred problem with error code 1168. When I try to cut and paste the command into the command prompt and run it from there, the command hangs for a while and then a time out exception is thrown. I am running on SQL Server 2008 on Windows Vista Ultimate using the new SSMS release (R2 NOV-CTP).

    Most of my interactions with SQL Server are through ADO.Net, and I generally do not handle the server set up so I am not sure what you mean by the various credentials which should be used. Could you please clarify this. My computer only has one user and that user has administrator privileges. So I do not understand while this readCred error is occurring.

    I am really excited to get this working. I have been manually scripting my DB and uploading it to the cloud that way, each time I make some changes to the DB's structure. This is going to be a huge time saver once I get it up and running! Thanks for making these new tools!
    Sunday, December 6, 2009 8:30 AM
  • It does look like there is an issue with using the proxy account when the account is not a domain account and we will look into fixing this for the next release.  The workaround for now is to use one of the domain accounts.  For now if you need to use SQL Agent I would suggest as a temporary workaround to log on as an Admin (such as yourself, meaning choose "This Account" and enter your Admin user and password).

    As mentioned above, you should be able to call this command line used by the SQL Agent externally which also means you could consider looking into running this from some scheduled job like AT (i.e. for more details at cmd line type: AT /?).

    phertel, perhaps you could give some additional details on your exception because I suspect this is differnt than the readcred issue.  FWIW, 99% of the people who have stated they have had an exception have been due to the fact that they needed to install Sync Framework - 32 bit (not 64 bit, even on 64 bit machines).  More details on this here: http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/94d3360a-3c2f-4725-bf43-8e2caf88481b/

    Liam

    Sr. Program Manager, SQL Azure and Sync Framework - http://msdn.microsoft.com/sync/
    Monday, December 7, 2009 7:54 PM
  • Thanks for all the work Liam.  The work around's available are acceptable.  
    Monday, December 7, 2009 8:00 PM
  • I have been having the ReadCred problem as well, so I changed the agent service to the admin login. Unfortunately in the Job monitor, the synch will still not work, and I get this from the command line (maybe its a timeout issue?)

    C:\Users\Administrator>"C:\Program Files (x86)\Microsoft Sync Framework\Power Pa
    ck For SQL Azure November CTP\SyncLocalSqlAzureDatabase.exe" -localServer localh
    ost -localDb AZBLANK -SqlAzureDb AZBLANK -scope Sync_AZBLANK -SqlAzureServer f7r
    tdxk26z.database.windows.net  -SqlAzureUser **USER** -SqlAzurePassword **PWD**-ConflictResolutionPolicy LocalServerWins
    Local Table: dbo.GUpdates Progress: SelectingChanges
    Local Table: dbo.SalesActions Progress: SelectingChanges
    Local Table: dbo.Docs Progress: SelectingChanges
    Local Table: dbo.Actions Progress: SelectingChanges
    Local Table: dbo.WorkDetail Progress: SelectingChanges
    Local Table: dbo.Install Progress: SelectingChanges
    Local Table: dbo.WorkGroup Progress: SelectingChanges
    Local Table: dbo.BidCodes Progress: SelectingChanges
    Local Table: dbo.CustSub Progress: SelectingChanges
    Local Table: dbo.ServiceSub Progress: SelectingChanges
    Local Table: dbo.RentalItems Progress: SelectingChanges
    Local Table: dbo.SalesBase Progress: SelectingChanges
    Local Table: dbo.ROOrder Progress: SelectingChanges
    Local Table: dbo.MaintEQ Progress: SelectingChanges
    Local Table: dbo.Zones Progress: SelectingChanges
    Local Table: dbo.CustSystem Progress: SelectingChanges
    Local Table: dbo.PMEQ Progress: SelectingChanges
    Local Table: dbo.SubContact Progress: SelectingChanges
    Local Table: dbo.BillStat Progress: SelectingChanges
    Local Table: dbo.CustCont Progress: SelectingChanges
    Local Table: dbo.ShipMeth Progress: SelectingChanges
    Local Table: dbo.SalesContacts Progress: SelectingChanges
    Local Table: dbo.Package Progress: SelectingChanges
    Local Table: dbo.SubContractor Progress: SelectingChanges
    Local Table: dbo.BusType Progress: SelectingChanges
    Local Table: dbo.MatDetail Progress: SelectingChanges
    Local Table: dbo.CustTrunk Progress: SelectingChanges
    Local Table: dbo.CustCustomLayout Progress: SelectingChanges
    Local Table: dbo.SLACategory Progress: SelectingChanges
    Local Table: dbo.QBFile Progress: SelectingChanges
    Local Table: dbo.SalesReasons Progress: SelectingChanges
    Local Table: dbo.TechBase Progress: SelectingChanges
    Local Table: dbo.OrderPack Progress: SelectingChanges
    Local Table: dbo.PO Progress: SelectingChanges
    Local Table: dbo.ROServices Progress: SelectingChanges
    Local Table: dbo.Defaults Progress: SelectingChanges
    Local Table: dbo.CallBack Progress: SelectingChanges
    Local Table: dbo.ProjStatus Progress: SelectingChanges
    Local Table: dbo.RentalTerms Progress: SelectingChanges
    Local Table: dbo.SalesStages Progress: SelectingChanges
    Local Table: dbo.TechType Progress: SelectingChanges
    Local Table: dbo.CustCustomTable Progress: SelectingChanges
    Local Table: dbo.SMPLink Progress: SelectingChanges
    Local Table: dbo.QBPayment Progress: SelectingChanges
    Local Table: dbo.SubDetail Progress: SelectingChanges
    Local Table: dbo.MatLink Progress: SelectingChanges
    Local Table: dbo.PropDetail Progress: SelectingChanges
    Local Table: dbo.Repair Progress: SelectingChanges
    Local Table: dbo.CustDefaults Progress: SelectingChanges
    Local Table: dbo.Service Progress: SelectingChanges
    Local Table: dbo.PropPack Progress: SelectingChanges
    Local Table: dbo.Terms Progress: SelectingChanges
    Local Table: dbo.PackItem Progress: SelectingChanges
    Local Table: dbo.Classes Progress: SelectingChanges
    Local Table: dbo.RecurDetail Progress: SelectingChanges
    Local Table: dbo.OrderServices Progress: SelectingChanges
    Local Table: dbo.SubFOS Progress: SelectingChanges
    Local Table: dbo.RecurServices Progress: SelectingChanges
    Local Table: dbo.SMPLinkSetup Progress: SelectingChanges
    Local Table: dbo.Reports Progress: SelectingChanges
    Local Table: dbo.InvenTrans Progress: SelectingChanges
    Local Table: dbo.RoTask Progress: SelectingChanges
    Local Table: dbo.Code Progress: SelectingChanges
    Local Table: dbo.Territories Progress: SelectingChanges
    Local Table: dbo.POItem Progress: SelectingChanges
    Local Table: dbo.SubLocation Progress: SelectingChanges
    Local Table: dbo.Parts Progress: SelectingChanges
    Local Table: dbo.RMA Progress: SelectingChanges
    Local Table: dbo.PropMat Progress: SelectingChanges
    Local Table: dbo.CommonService Progress: SelectingChanges
    Local Table: dbo.PropServices Progress: SelectingChanges
    Local Table: dbo.ToDo Progress: SelectingChanges
    Local Table: dbo.SubRegion Progress: SelectingChanges
    Local Table: dbo.CustDocs Progress: SelectingChanges
    Local Table: dbo.RecurMat Progress: SelectingChanges
    Local Table: dbo.PayDetail Progress: SelectingChanges
    Local Table: dbo.Emm Progress: SelectingChanges
    Local Table: dbo.ContPrefs Progress: SelectingChanges
    Local Table: dbo.SysDetails Progress: SelectingChanges
    Local Table: dbo.RecurTask Progress: SelectingChanges
    Local Table: dbo.RMAItem Progress: SelectingChanges
    Local Table: dbo.InvenXfer Progress: SelectingChanges
    Local Table: dbo.OrderStatus Progress: SelectingChanges
    Local Table: dbo.CustEQ Progress: SelectingChanges
    Local Table: dbo.UserGroups Progress: SelectingChanges
    Local Table: dbo.ContRoles Progress: SelectingChanges
    Local Table: dbo.InvoiceD Progress: SelectingChanges
    Local Table: dbo.SysMisc Progress: SelectingChanges
    Local Table: dbo.MatLinkD Progress: SelectingChanges
    Local Table: dbo.OrderTask Progress: SelectingChanges
    Local Table: dbo.POLink Progress: SelectingChanges
    Local Table: dbo.UserINI Progress: SelectingChanges
    Local Table: dbo.InvenXferD Progress: SelectingChanges
    Local Table: dbo.ContStatus Progress: SelectingChanges
    Local Table: dbo.EmmEvents Progress: SelectingChanges
    Local Table: dbo.PropSubs Progress: SelectingChanges
    Local Table: dbo.SysVersion Progress: SelectingChanges
    Local Table: dbo.Modules Progress: SelectingChanges
    Local Table: dbo.ROTech Progress: SelectingChanges
    Local Table: dbo.Issue Progress: SelectingChanges
    Local Table: dbo.VContact Progress: SelectingChanges
    Local Table: dbo.PropOrderLink Progress: SelectingChanges
    Local Table: dbo.CustEQTrans Progress: SelectingChanges
    Local Table: dbo.POStatus Progress: SelectingChanges
    Local Table: dbo.CPU Progress: SelectingChanges
    Local Table: dbo.Payment Progress: SelectingChanges
    Local Table: dbo.PropTask Progress: SelectingChanges
    Local Table: dbo.TaskStatus Progress: SelectingChanges
    Local Table: dbo.EmmLog Progress: SelectingChanges
    Local Table: dbo.mSearch Progress: SelectingChanges
    Local Table: dbo.InvFreqs Progress: SelectingChanges
    Local Table: dbo.RecurPack Progress: SelectingChanges
    Local Table: dbo.Vehicle Progress: SelectingChanges
    Local Table: dbo.PriceBook Progress: SelectingChanges
    Local Table: dbo.Proposal Progress: SelectingChanges
    Local Table: dbo.CustEquip Progress: SelectingChanges
    Local Table: dbo.TaxCodes Progress: SelectingChanges
    Local Table: dbo.CPUHard Progress: SelectingChanges
    Local Table: dbo.EmmRecip Progress: SelectingChanges
    Local Table: dbo.RMALink Progress: SelectingChanges
    Local Table: dbo.RecurTech Progress: SelectingChanges
    Local Table: dbo.InvKits Progress: SelectingChanges
    Local Table: dbo.Notify Progress: SelectingChanges
    Local Table: dbo.IssueNotify Progress: SelectingChanges
    Local Table: dbo.VendItem Progress: SelectingChanges
    Local Table: dbo.CPUMaint Progress: SelectingChanges
    Local Table: dbo.FAAssign Progress: SelectingChanges
    Local Table: dbo.SMPSystem Progress: SelectingChanges
    Local Table: dbo.IssueStatus Progress: SelectingChanges
    Local Table: dbo.OrderTax Progress: SelectingChanges
    Local Table: dbo.Projects Progress: SelectingChanges
    Local Table: dbo.Invoice Progress: SelectingChanges
    Local Table: dbo.PayMethod Progress: SelectingChanges
    Local Table: dbo.NotifyTypes Progress: SelectingChanges
    Local Table: dbo.ROCustEQ Progress: SelectingChanges
    Local Table: dbo.Recurring Progress: SelectingChanges
    Local Table: dbo.Vendor Progress: SelectingChanges
    Local Table: dbo.FADep Progress: SelectingChanges
    Local Table: dbo.TaxGroup Progress: SelectingChanges
    Local Table: dbo.CPUSoft Progress: SelectingChanges
    Local Table: dbo.SMPUser Progress: SelectingChanges
    Local Table: dbo.ItemStatus Progress: SelectingChanges
    Local Table: dbo.PayRoll Progress: SelectingChanges
    Local Table: dbo.OrderTech Progress: SelectingChanges
    Local Table: dbo.InvenCondition Progress: SelectingChanges
    Local Table: dbo.PropTax Progress: SelectingChanges
    Local Table: dbo.OrderAssets Progress: SelectingChanges
    Local Table: dbo.TaxGroupL Progress: SelectingChanges
    Local Table: dbo.Label Progress: SelectingChanges
    Local Table: dbo.RODetail Progress: SelectingChanges
    Local Table: dbo.CreditCards Progress: SelectingChanges
    Local Table: dbo.PayTypes Progress: SelectingChanges
    Local Table: dbo.FAMaint Progress: SelectingChanges
    Local Table: dbo.InvenDetail Progress: SelectingChanges
    Local Table: dbo.Tech Progress: SelectingChanges
    Local Table: dbo.LDCarriers Progress: SelectingChanges
    Local Table: dbo.PropTech Progress: SelectingChanges
    Local Table: dbo.Cust Progress: SelectingChanges
    Local Table: dbo.OrderDetail Progress: SelectingChanges
    Local Table: dbo.PayWages Progress: SelectingChanges
    Local Table: dbo.VFuel Progress: SelectingChanges
    Local Table: dbo.Fixed Progress: SelectingChanges
    Local Table: dbo.CustHours Progress: SelectingChanges
    Local Table: dbo.Department Progress: SelectingChanges
    Local Table: dbo.LeadSource Progress: SelectingChanges
    Local Table: dbo.PBDetail Progress: SelectingChanges
    Local Table: dbo.InvenGroup Progress: SelectingChanges
    Local Table: dbo.RoloDex Progress: SelectingChanges
    Local Table: dbo.Deposit Progress: SelectingChanges
    Local Table: dbo.LeadStatus Progress: SelectingChanges
    Local Table: dbo.Views Progress: SelectingChanges
    Local Table: dbo.CustIP Progress: SelectingChanges
    Local Table: dbo.ROMat Progress: SelectingChanges
    Local Table: dbo.InvenStatus Progress: SelectingChanges
    Local Table: dbo.Sales Progress: SelectingChanges
    Local Table: dbo.OrderInvLink Progress: SelectingChanges
    Local Table: dbo.PM Progress: SelectingChanges
    Local Table: dbo.Location Progress: SelectingChanges
    Local Table: dbo.CustItems Progress: SelectingChanges
    Local Table: dbo.DirectSales Progress: SelectingChanges
    Local Table: dbo.GUpdateGroup Progress: SelectingChanges
    Local Table: dbo.Inventory Progress: SelectingChanges
    Local Table: dbo.VMaint Progress: SelectingChanges
    Local Table: dbo.Accounts Progress: SelectingChanges
    Local Table: dbo.ServiceItem Progress: SelectingChanges
    Local Table: dbo.Division Progress: SelectingChanges
    Local Table: dbo.RentalHist Progress: SelectingChanges
    Local Table: dbo.OrderMat Progress: SelectingChanges
    Local Table: dbo.Maint Progress: SelectingChanges
    Local Table: dbo.CustServices Progress: SelectingChanges
    Session Progress: ChangeEnumeration
    System.InvalidOperationException: ExecuteNonQuery requires an open and available
     Connection. The connection's current state is closed.
       at System.Data.SqlClient.SqlConnection.GetOpenConnection(String method)
       at System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(String me
    thod, SqlCommand command)
       at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean as
    ync)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult res
    ult, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.Synchronization.Data.SqlAzure.SqlAzureTVPChangeHandler.ExecuteCo
    mmandReturnRowcount(IDbCommand command, Boolean& found)
       at Microsoft.Synchronization.Data.SqlAzure.SqlAzureTVPChangeHandler.ExecuteCh
    angeApplicationCommandBase(IDbCommand command, SyncRowMetadata rowMetadata, Stri
    ng commandName)
       at Microsoft.Synchronization.Data.SqlAzure.ChangeHandlerBase.ExecuteChangeApp
    licationCommand(IDbCommand command, SyncRowMetadata rowMetadata, String commandN
    ame)
       at Microsoft.Synchronization.Data.SqlAzure.SqlAzureTVPChangeHandler.ApplyInse
    rt()
       at Microsoft.Synchronization.Data.SqlAzure.ChangeHandlerBase.ApplyChange()
       at Microsoft.Synchronization.Data.SqlAzure.SqlAzureSyncProvider.ApplyChangesO
    fType(DataSet changes, DbSyncScopeMetadata scopeMetadata, SqlAzureChangeApplicat
    ionType applyType)
       at Microsoft.Synchronization.Data.SqlAzure.SqlAzureSyncProvider.ApplyChangesF
    orDataSet(DataSet changes, DbSyncScopeMetadata scopeMetadata, Boolean isDataBatc
    hed)
       at Microsoft.Synchronization.Data.SqlAzure.SqlAzureSyncProvider.ApplyChangesI
    nternal(DataSet changes, DbSyncScopeMetadata scopeMetadata, Boolean isDataBatche
    d, Boolean isLastBatch)
       at Microsoft.Synchronization.Data.SqlAzure.SqlAzureSyncProvider.ProcessChange
    Batch(ConflictResolutionPolicy resolutionPolicy, ChangeBatch sourceChanges, Obje
    ct changeDataRetriever, SyncCallbacks syncCallbacks, SyncSessionStatistics sessi
    onStatistics)
       at Microsoft.Synchronization.KnowledgeProviderProxy.ProcessChangeBatch(CONFLI
    CT_RESOLUTION_POLICY resolutionPolicy, ISyncChangeBatch pSourceChangeManager, Ob
    ject pUnkDataRetriever, ISyncCallback pCallback, _SYNC_SESSION_STATISTICS& pSync
    SessionStatistics)
       at Microsoft.Synchronization.CoreInterop.ISyncSession.Start(CONFLICT_RESOLUTI
    ON_POLICY resolutionPolicy, _SYNC_SESSION_STATISTICS& pSyncSessionStatistics)
       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWaySyncHelper(Syn
    cIdFormatGroup sourceIdFormats, SyncIdFormatGroup destinationIdFormats, Knowledg
    eSyncProviderConfiguration destinationConfiguration, SyncCallbacks DestinationCa
    llbacks, ISyncProvider sourceProxy, ISyncProvider destinationProxy, ChangeDataAd
    apter callbackChangeDataAdapter, SyncDataConverter conflictDataConverter, Int32&
     changesApplied, Int32& changesFailed)
       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.DoOneWayKnowledgeSync(
    SyncDataConverter sourceConverter, SyncDataConverter destinationConverter, SyncP
    rovider sourceProvider, SyncProvider destinationProvider, Int32& changesApplied,
     Int32& changesFailed)
       at Microsoft.Synchronization.KnowledgeSyncOrchestrator.Synchronize()
       at Microsoft.Synchronization.SyncOrchestrator.Synchronize()
       at SyncLocalSqlAzureDatabase.Program.Main(String[] args)


    Wednesday, December 9, 2009 3:48 AM
  • I, too, am getting the ReadCred error.

    Hope this isn't too much to ask, but can someone provide me with the steps I need to take to make sure  that the credentials used by the SQL Server Agent service must match the credentials of the account running the job.?
    Tuesday, December 15, 2009 12:36 AM
  • That definitely looks like a Timeout issue to me as you are connected and getting some tables synced.  I'd recommend posting that error on it's own thread. 

    As far as the Job, I have to SQL Agent it under my domain/PC account which is sysadmin on the sql server and an admin on the box.  I didn't try setting up a specific account for SQL Server agent, but I probably should.
    Tuesday, December 15, 2009 2:02 AM
  • That line is definitely not clear in the instructions.  The second of the 2 posts by Liam that I marked as answers I think answers the question.  You need to run SQL Agent as your account. 
    Tuesday, December 15, 2009 2:04 AM
  • Thanks, Jack. Setting the SQL Server Agent Service to my account seems to have me back on track.
    Tuesday, December 15, 2009 5:13 AM
  • Hi ,

               I am facing same issue ,which is giving me error stating that "ReadCred failed with the error code 1168 : at SyncLocalAzureDatabase.Credentials.Credentials.ReadCred " and even i tried to login as administrator but still i am not getting root cause of problem.

     

    thanks

     

    Tuesday, June 15, 2010 12:13 PM
  • Hi Shanu,

    You need to set the SQL Agent job to run as the user that you were logged in as when you set up synchronization.  For example if you were logged in as MyDomain\User1 then you would go into Services (services.msc) and set SQL Server Agent to run as MyDomain\User1.

    Can you give that a try and see if it resolves your issue?

    Liam


    Sr. Program Manager, SQL Azure and Sync Framework - http://msdn.microsoft.com/sync/
    • Proposed as answer by aheneghan Thursday, June 24, 2010 5:56 PM
    Tuesday, June 15, 2010 2:03 PM
  • Hi Uriah,

    There is more information on the SQL Azure Data Sync CTP tool for synchronizing SQL Server to SQL Azure here:

    http://www.microsoft.com/windowsazure/sqlazure/datasync/default.aspx

    If you are interested in our latest sync service to sync SQL Azure to SQL Azure, you can sign up the SQL Azure Data Sync service here:

    http://sqlazurelabs.com

    Liam


    Sr. Program Manager, SQL Azure and Sync Framework - http://msdn.microsoft.com/sync/
    Tuesday, September 7, 2010 3:33 PM