Hi, Suddenly today my sync gatway stopped responding. so i stopped and started again. But now it is showing running. But still it is not working. even my couchbase server showing empty bucket as well. Is it mean of did i lost my entire data on server?
How SG stopped responding. Did it return errors from the API, or just hang on requests?
Provide, or look in the Sync Gateway logs to see if thereâs anything indicating why it stopped responding in the first place? SG shouldnât need to be restarted, so it suggests an underlying problem elsewhere.
It appears youâre not authenticating with Couchbase server correctly from Sync Gateway.
2018-05-11T14:13:41.308Z Opening db /db as bucket âdefaultâ, pool âdefaultâ, server http://myipaddress:8091
2018-05-11T14:13:41.308Z GoCBCustomSGTranscoder Opening Couchbase database default on http://myipaddress:8091 as user âdefaultâ
2018-05-11T14:13:41.311Z WARNING: Error opening bucket: default. Error: authentication error â base.GetCouchbaseBucketGoCB() at bucket_gocb.go:118
Make sure you have an RBAC user created in Couchbase Server that has the âBucket Adminâ role, and specify that username and password in your Sync Gateway config.
This will solve the authentication issue youâre seeing.
As for the empty bucket, check if you have any filters set in the Couchbase Server UI that would be hiding things, and also check the values on the main âBucketâ page to verify the number of documents you have:
Your logs show the first run of Sync Gateway was using a Walrus database, which is an in-memory store that is not persisted by default. This explains why you see no documents in Couchbase Server, and this also explains your out of memory error, as you would have put in more documents than can fit in your system memory.
You need to connect Sync Gateway to a Couchbase server for persistence of documents. Youâre still facing the same authentication issues, so check the RBAC user you created in Couchbase has the correct permissions for the bucket youâre connecting to, and verify that the username and password used in your sync gateway config are correct.
Yes, the username and password you specified when you created an RBAC user are the ones you need to add into the config.
The default data store for Sync Gateway is Walrus so that developers can get started without the need for Couchbase Server to be running. However, as noted in the âGetting Startedâ page of the documentation, documents in Walrus are not persisted, and Walrus is not intended to be used for production data.