Sync is not working

Trying to sync cbl 2.0.0-db020 X sync gateway 1.5 X Couchbase Server 1.5 but it’s not syncing, here is my code:

jsonConfig:

{
	"log": ["*"],
	"adminInterface": "127.0.0.1:4985",
	"interface": "0.0.0.0:4984",
	"databases": {
    "ecomanda": {
      "server": "http://localhost:8091",
      "bucket": "ecomanda",
      "enable_shared_bucket_access": true,
      "import_docs": "continuous",
      "username": "Administrator",
      "password": "alexandrem",
      "users": {
        "GUEST": {
          "disabled": false,
          "admin_channels": [ "*" ]
        }
      },
      "unsupported": {
        "replicator_2": true
      },
      "sync": `function (doc, oldDoc) {
		channel('public');
		console.log(doc);
	  }`
    }
	}
}

If i open http://localhost:4984/ecomanda/ on browser, it shows: (looks ok)

{“committed_update_seq”:1,“compact_running”:false,“db_name”:“ecomanda”,“disk_format_version”:0,“instance_start_time”:1511529249787388,“purge_seq”:0,“state”:“Online”,“update_seq”:1}`

Here is My c# WPF Test:
readonly Database _db;
string id = Guid.NewGuid().ToString();
readonly Replicator _rep;

    public MainWindow()
    {
        InitializeComponent();
        Couchbase.Lite.Support.NetDesktop.Activate();
        _db = new Database("ecomanda");

        var config = new ReplicatorConfiguration(_db, new Uri("ws://localhost:4984/ecomanda"))
        {
            Continuous = true
        };
        //config.Authenticator = new Couchbase.Lite.Sync.BasicAuthenticator("Administrator", "alexandrem");
        _rep = new Replicator(config);
        _rep.Start();

        _rep.StatusChanged += (sender, e) => {
            if (e.Status.Activity == ReplicatorActivityLevel.Stopped)
            {
                Console.WriteLine("Replication has completed.");
            }
        };
    }

    private void Get_Click(object sender, RoutedEventArgs e)
    {
        var doc = _db.GetDocument(id);
        Debug.Write(doc);
        MessageBox.Show(doc.Id.ToString());
    }

    private void Save_Click(object sender, RoutedEventArgs e)
    {
        var doc = new MutableDocument(id);
        doc.Set("xpto", "abc");
        _db.Save(doc);
    }

    protected override void OnClosing(CancelEventArgs e)
    {
        _rep.Stop();
        base.OnClosing(e);
    }

When I hit “Save” The Sync Gateway console does nothing nor CB Server get any data

Here is the SG Console:

Any help?

Tks

The problem is cbl 2.0.0-db020, db019 solve the issue.

What are you getting in _chages request ? If you are not getting anything it means the data is not imported into sync gateway.

Hi guys,

Same problem post today, here my post https://forums.couchbase.com/t/unable-to-connect-sync-gateway-since-couchbase-lite-2-0-db20/14890

Regards,

Steeve

1 Like

@pankaj.sharma I think cbl 2.0.0-db020 is the problem, since cbl 2.0.0-db019 is working in the same environment.

Yes I didnt realize that I broke all this until yesterday. I have fixed it already and the fix will be in db021. As always you can build it yourself too if you want to try it immediately.