Issues with basic replication, with Couchbase lite 2.5 to sync-gateway

Hi, I am trying to get a simple couchbase lite -> sync-gateway -> couchbase setup to function.
I have used the docker commands from to setup the couchbase and sync-gateway with the exact config file.

I am able to issue curl commands to the sync-gateway and it gets updated in the couchbase server so that aspect seems to function. However when creating a simple android studio app to attempt to interface nothing happens.

code is here: aswell as the config file used

Issue seems to stem from the replicator onchangelistener where the error is: " Got LiteCore error: WebSocket error 1001 “WebSocket connection closed by peer”

And a more general error code of 11001 which apparently translates to Datastore : namespace not found [msg] System Datastore: Namespace not found.

Any pointers to the issue would be most appreciated.

That’s not what that error means. I’m curious where you found that definition. For network related errors, they are based on real error codes from HTTP and WebSocket standards, with 10000 added as a base, so 11001 is actually 1001 as the message indicates, which means that the other side hung up unexpectedly. Can you show what CURL command you issue to Sync Gateway? In particular, what address are you using?

curl -s -g -u ‘admin:pass’ -X PUT -H ‘Content-Type: application/json’ -d ‘{ “my”: “doc”, “entry”: “test” }’ localhost:4984/demobucket/jd_doc

Ah I googled the error code and I got that, I’ll try to find where I found it.

I don’t imagine that our error codes are listed anywhere that you would find on Google. They are our own proprietary error codes, and they are enumerated for every language. For example here is the entry for Java. Actually it means that the client side is going to hang up. Actually I see that you create a replicator but don’t save it into a variable anywhere, so once you exit the onCreate method it’s going to be eligible for garbage collection. I imagine that if it gets collected that the replication will stop.

Oh, ok. I literally just pasted in this code : and figured it would function, but that does make sense.

Hmm well you aren’t wrong, it does say to simply copy it! I’ll file an issue to see if that wording can be improved.

Are there any simple samples of how to get a replicator listener around?

I must not understand the question because to me there is a sample in the link you posted.