Deleted document not sync to app

Hello All,

I have upgraded Couchbase 4.5 to the 5.5 enterprise version(planning to upgrade to the 7.0.3 version) and sync gateway from 1.4 to 1.5.
After the upgrade some documents I need to delete manually from Couchbase server. But it still appears on our app which is using Couchbase lite. It was working earlier when I was using sync gateway 1.4 version.
If I submit the document through app then it get sync on couchbase server, after that I am using view to get the submitted document using the status=summited and deleting it through node js API and document get disappear from app. this is working fine.
Now If I delete the document from Couchbase server using the Admin credential from the DB. Document gets deleted from the DB but it still appears in the app.

Also tried enable_shared_bucket_access =true and import_docs = true/continuous but no luck.

Can you please help?

below are my sync gateway configurations:

“adminInterface”: “”,
“interface”: “”,
“databases”: {
“sg_db2”: {
“server”: “”,
“bucket”: “db2”,
“username”: “Administrator”,
“password” : “xxxxx”,
“sync”: "function(doc) {if (doc.docType != undefined) { channel

(doc.docType); if(doc.docType == ‘SO’) { if(doc.status == ‘SUBMITTED’) {channel

(‘close’);} else {channel(;}} if(doc.docType == ‘IHours’) {

channel(doc.engId); } }}",
“users”: {
“GUEST”: {
“disabled”: false,
“admin_channels”: [ “" ]
“eng”: {
“password”: “xxxxxxx”,
“admin_channels”: [ "
” ],
“disabled”: false



The last supported version of Sync Gateway 1.x was released over 6 years ago, and went end of life in Apr 2020. Similarly, the last supported version of Couchbase Server 5.x was released over 5 years ago, and went End of Life in Oct 2021.

See the Enterprise Support Policy for more information: Enterprise Software Support Policy | Couchbase

Note, Sync Gateway 2.x continues to have backwards-compatibility/support for Couchbase Lite 1.x clients, so there is no requirement to stay on these older versions, even if you have to support old clients.

See the Compatibility Matrix for more information: Compatibility | Couchbase Docs

With that said, what you’re attempting to do (server-side document changes) will require enable_shared_bucket_access and import_docs. You should be able to observe the document delete being imported by Sync Gateway in the logs if things are working correctly.

1 Like