Couchbase lite 2.0 DB21, Replicator issues

Hi,

I’m starting a new topic about the replicator 2.0, that I’m using in c# (Xamarin and console windows app).
since 2 days i’m testing my principal application, in which I’m able to add documents with “persons” informations.

I’m using my App with 3 differents Windows 10 (Fall creator version). I also created a simple monitor app that can be find here :
https://github.com/SteeveQuadra/SyncMonitor.wiki.git
I did open 2 issues on the couchbase lite github for some other related problems

My replicator is started always in continuous mode. The SyncMonitor repo contain the config file i’m using on my sync gateway server.

Use case 1 : The initial sync goes well until the end of the 39000 docs
=> The progess numbers stay equal and it seems that the replication work always well.

Use case 2 : (Random issue) I’m adding a person in my program, and save a new document in my local couchbase lite. The replicator status change into Busy, the total progress number increase, but the Completed number stay without increasing.
=> The documeent never go to the Bucket, until I Restart the application or Restart the replicator like that :

private void Restart(ReplicatorStatusMessage obj)
		{
			try
			{
				_replicator.RemoveChangeListener(_token);
				_replicator.Stop();
				_replicator = null;
				_replicator.Dispose();
			}
			catch(Exception)
			{ }
			Connect();
		}

	private void Connect()
	{
		if (_serverInfo == null)
			_serverInfo = _serverDal.Get();
		if (_serverInfo == null)
			return;
		Uri target = new Uri($"blip://{_serverInfo.UrlServer}");
		ReplicatorConfiguration replicationConfig = new ReplicatorConfiguration(_dataBaseGetter.Get(), target);
		replicationConfig.Continuous = true;
		replicationConfig.ReplicatorType = ReplicatorType.PushAndPull;
		replicationConfig.Authenticator = new BasicAuthenticator(_serverInfo.Login, _serverInfo.Password);
		_replicator = new Replicator(replicationConfig);
		if (CrossConnectivity.IsSupported && CrossConnectivity.Current.IsConnected)
			_replicator.Start();
		_token = _replicator.AddChangeListener(_replicator_StatusChanged);
	}

The Result is that the document is store in the bucket, but is not sync in all others sync gateway clients.

Use case 3 : After use case 2 situation, the progress numbers will never be equals.
=> The replication will never work fine anymore in this situation. It seems to watch some changes, the total numbers will increase with the number of changes that it should receive, but the completed number wilt stay at 0.
=> Is that possible to force the replication without killing the local database ?

Use case 4 : After the use case 2 situation : Uninstallation of the application and re installation.
=> If the initial replication goes fine until the end, I can find all the documents even those that wasn’t sync before reinstallation

I can use any computer I want, this random problem happend, and that’s always the starting point of replication issues.

I don’t know how to explain that in an github issues for you to be able to find the trouble. I can send my app folder in a private message if that can help to resolve this issue.

We chose couchbase because of the automatic replication, I really need it to work well.

What can I do to help to resolve this issus ?

Regards

Steeve

If you have something that you would like to share, you can encrypt it and share it using my Couchbase PGP key if you are worried about others seeing it.

Thanks for filing the issues. One of them I think I already know how to fix (and I will add an automated test to prevent it in the future).

One thing I’d like to point out:

_replicator = null;
_replicator.Dispose();

This is almost guaranteed, barring any race conditions, to throw a null reference exception, so you might want to change that. There is a catch all exception swallowing there, but it means that the replicator won’t be disposed until it is garbage collected.

1 Like

Hi,

I added a 7z of my solution mobilotis, crypted with your PGP key, into the repositorie of my app SyncMonitor :
https://github.com/SteeveQuadra/SyncMonitor.wiki.git

Try the UWP version.

After starting the app, clic on the button with the little red antenna : antenna_red, you will be able to enter user, password and url (without blip://) of your sync gateway server, and to clic on the connection button.

Sorry, all texts will be in French.

On the first page, you have 6 bigs buttons, only the 2 blue ones are active for now.
The gray button with recherche give you a resume, If you’re using my bucket mobilotis, you will have Pays=4, Financement=10, Situation familiale=5, Commune=38880, Futur Aq=n

I rarely obtain 38880 document type of “Commune” (Town in english), because of the sync trouble (Issus #945 on github). My last test, starting from scratch, I hade 38859 documents type of Commune, and the Sync progess total number show “21”, it’s exactly the number of documents type of commune I’m missing !

Hope this will help.

Regards

Steeve

Hope this will help.

Regards

Steeve

Hi Jim,

Do you want me to create an issue on github for this sync problems ?

Regards

Steeve

Hi,

I launch my application c# xamarin, Android part.

I have got the freeze problem of the raplicator with status Idle, and the progress numbers staying still, after some exceptions.

The advantage of android in debug is that we have a trace,  

Here is some infos that may help you :

WARNING: {N8litecore9websocket12C4SocketImplE#6}==> N8litecore9websocket12C4SocketImplE blip:192.168.53.100:4984/mobilotis/_blipsync
00:32:41.684087| [WS] WARNING: {N8litecore9websocket12C4SocketImplE#6} Unexpected or unclean socket disconnect! (reason=WebSocket status, code=1000)
00:32:41.684369| [WS]: {N8litecore9websocket12C4SocketImplE#6} sent 75078 bytes, rcvd 757704, in 4.448 sec (16880/sec, 170354/sec)
00:32:41.684535| [BLIP]: {N8litecore4blip10ConnectionE#5} Closed with WebSocket status 1006: 
00:32:41.684684| [BLIP]: {N8litecore4blip6BLIPIOE#7}==> N8litecore4blip6BLIPIOE 0x921872c0
00:32:41.684778| [BLIP]: {N8litecore4blip6BLIPIOE#7} Notifying 14 incoming messages they're canceledThread finished:  #573

    00:32:41.686911| [Sync] ERROR: {Repl#8}==> N8litecore4repl10ReplicatorE ->blip:192.168.53.100:4984/mobilotis/_blipsync
    00:32:41.687258| [Sync] ERROR: {Repl#8} Got LiteCore error: connection closed abnormally (7/1006)
    00:32:41.692414| [WS] WARNING: {N8litecore9websocket12C4SocketImplE#6} Unexpected or unclean socket disconnect! (reason=WebSocket status, code=1000)
    00:32:41.692688| [WS]: {N8litecore9websocket12C4SocketImplE#6} sent 75078 bytes, rcvd 757704, in 4.448 sec (16880/sec, 170354/sec)Thread finished:  #574

Regards

Steeve

Hey - can you file a GitHub ticket if you haven’t already done with details of the steps to repro the issue , sample code if possible . We have fixed some replication issues since DB021 so its possible that your issue is resolved but would be good to confirm the same

Hi @priya.rajagopal,

Yes I did it, but my tickets were closed suspecting that the DB22 will correct the problem. But there’s no DB22 for me to test it for now !
I’m always in coulds with the troubles, trying to give you as many informations as possible to help to correct them.
I’m trying to teach patience to my clients too, but it’s not super easy :wink:

Any infos will be appreciated !

Regards

Steeve

I understand. Can you build the latest version from source yourself ? It would be great to verify if the latest did infact fix your issue

Sorry about the db022 wait. This is not normal. There has been quite a shake up that is causing massive delays. The good news is that it means db022 will be far more well tested than db021, but the bad news is what you’ve already been experiencing. This sort of long delay between dbs should be a one time thing and after db022 things should get back to normal. If you have difficulties building the source let me know. I also wrote a blog post about building if you are curious (the link is the first part, which is .NET Core, but links to the other parts are in the comments).

1 Like

Can you please elaborate a little on the nature of the shakeup?
Thanks;
nat

I won’t go a lot into detail, but suffice to say that as programmers we tend to forgot many other considerations that need to be taken into account when making software (business, legal, etc). Sometimes these things come at inconvenient times, or too slowly for our liking…

1 Like