"serverBlob is empty" error

Jul 5, 2014 at 4:01 PM
I've written a WinRT app based on the samples provided and I've come across this issue. On the SQL Server (service) side, I have an empty database provisioned, but on the client (SQLite) side I have rows in the table already. When I attempt to sync, I get this exception from the server:
serverBlob is empty
at Microsoft.Synchronization.Services.SqlProvider.SqlSyncProviderService.ApplyChanges(Byte[] serverBlob, List1 entities) at Microsoft.Synchronization.Services.UploadChangesRequestProcessor.ProcessRequest(Request incomingRequest) at Microsoft.Synchronization.Services.SyncService1.ProcessRequestForMessage(Stream messageBody)"
It seems to be because the serverBlob that the client is sending up is an empty byte array. If I enter a row on the SQL Server side, it seems to work as expected and I can sync from then on.

Is this expected behavior? I'm trying to look into this to see I can do a fix and send a PR, but I'm not sure what the purpose of the syncBlob is.

(I also entered an issue for this on Github but it seems like the discussions here are more active)
Jul 7, 2014 at 9:02 AM
Yes, you are right.
THE Very first sync MUST BE from Server to Client, to initialize the client database and send it the Server Blob

So If you have any preconfigured database, I suggest you to create a readonly client db, then Create a client database which will be synced with the server (at least for haveing the server blob) and then insert into this new database, the lines from your client. If you don't need to sync thoses lines with the server, don't forget to change all the metadatas