Couchbase Lite 2.0 version DB21, Replicator Is not connecting vs Db19 version

Hi,

I just upgraded my application xamarin forms c# into couchabse Lite 2.0 DB21, comming from the db19. I kept a DB19 version so I’m able to start the 2 in paralel.

Here is my replicator connection code in version DB19 :

Uri target = new Uri("blip://192.168.53.100:4984//mobilotis");
			ReplicatorConfiguration replicationConfig = new ReplicatorConfiguration(_dataBaseGetter.Get(), target);
			replicationConfig.Continuous = true;
			replicationConfig.ReplicatorType = ReplicatorType.PushAndPull;
			replicationConfig.Authenticator = new BasicAuthenticator("MyLogin", "MyPassword");
			_replicator = new Replicator(replicationConfig);
			if (CrossConnectivity.IsSupported && CrossConnectivity.Current.IsConnected)
				_replicator.Start();
			_replicator.StatusChanged += _replicator_StatusChanged;

Here is the vode for the Db21 Version :

Uri target = new Uri("blip://192.168.53.100:4984//mobilotis");
			ReplicatorConfiguration replicationConfig = new ReplicatorConfiguration(_dataBaseGetter.Get(), target);
			replicationConfig.Continuous = true;
			replicationConfig.ReplicatorType = ReplicatorType.PushAndPull;
			replicationConfig.Authenticator = new BasicAuthenticator("MyLogin", "MyPassword");
			_replicator = new Replicator(replicationConfig);
			if (CrossConnectivity.IsSupported && CrossConnectivity.Current.IsConnected)
				_replicator.Start();
			_replicator.AddChangeListener(_replicator_StatusChanged);

As you can see, the only change is about how I’m listenning the changes.

But, the log of sync gateway don’t play the same music, when I start the db19 version :

 GET /mobilotis/_blipsync
2017-12-20T10:02:00.379Z HTTP: #130:     --> 401 Login required  (0.6 ms)
2017-12-20T10:02:00.442Z HTTP:  #131: GET /mobilotis/_blipsync  (as mobilotis)
2017-12-20T10:02:01.624Z changes_view: Query took 1.128384772s to return 59221 rows, options = db.Body{"stale":false, "startkey":[]interface {}{"*", 0x1c4}, "endkey":[]interface {}{"*", 0xe918}}

When I start the sd21 version :

GET //mobilotis/_blipsync
2017-12-20T11:59:19.273Z HTTP: #134:     --> 404 unknown URL  (0.1 ms)

Do I need to change my connection with sync Gateway since I upgraded from db19 to db 21 ?

Regards

Steeve

This is probably due to a recent lite core change, but the new behavior is correct. Your URL has an extra slash in it and is invalid. Change it to blip://192.168.53.100:4984/mobilotis (4984//mobilotis -> 4984/mobilotis).

1 Like

ok, all my respects, you’re too sweet (in french : Balaise) and strong.

Hope this will help some other guys …

Steeve

1 Like