Can not Delete a Document by SyncGateway


#1

documents can not be deleted at all, either by Android couchbase lite sdk or iOS couchbase lite, I even tried by Restfull API by postman.
When I want to delete a documet by postman it returns 409, conflict, document exists, it seems that the delete works as post or so…!!!
I want to delete a document but it seems is going to create another one by the repetitive id.
method: delete
API : https://MySyncGateway/myDbName/fu!1rtg3hi5l5!accn!773339486
Response:
code: 409
{
“error”: “conflict”,
“reason”: “Document exists”
}

AND
below is part of my warning log:
2018-12-22T16:20:54.157+03:30 [WRN] Sync fn exception: TypeError: Cannot access member ‘0’ of undefined; doc = map[_rev:3-210a90c796bc40223753460a835eb7a6 _revisions:map[start:3 ids:[210a90c796bc40223753460a835eb7a6 b8e90780aa1531ca32115b5bb4b4d03c]] _deleted:true _id:fu!1rtg3hi5l5fsggi1ke62bndrno9814!accn!205660443] – db.(*Database).getChannelsAndAccess() at crud.go:1291
2018-12-22T16:20:54.342+03:30 [WRN] Sync fn exception: TypeError: Cannot access member ‘0’ of undefined; doc = map[_revisions:map[start:3 ids:[210a90c796bc40223753460a835eb7a6 b8e90780aa1531ca32115b5bb4b4d03c]] _deleted:true _id:fu!1rtg3hi5l5fsggi1ke62bndrno9814!accn!205660443 _rev:3-210a90c796bc40223753460a835eb7a6] – db.(*Database).getChannelsAndAccess() at crud.go:1291
2018-12-22T16:20:54.376+03:30 [WRN] Sync fn exception: TypeError: Cannot access member ‘0’ of undefined; doc = map[_id:fu!1rtg3hi5l5fsggi1ke62bndrno9814!accn!205660443 _rev:3-210a90c796bc40223753460a835eb7a6 _revisions:map[start:3 ids:[210a90c796bc40223753460a835eb7a6 b8e90780aa1531ca32115b5bb4b4d03c]] _deleted:true] – db.(*Database).getChannelsAndAccess() at crud.go:1291
2018-12-22T16:21:22.114+03:30 [WRN] Sync fn exception: TypeError: Cannot access member ‘0’ of undefined; doc = map[_revisions:map[start:3 ids:[210a90c796bc40223753460a835eb7a6 b8e90780aa1531ca32115b5bb4b4d03c]] _deleted:true _id:fu!1rtg3hi5l5fsggi1ke62bndrno9814!accn!205660443 _rev:3-210a90c796bc40223753460a835eb7a6] – db.(*Database).getChannelsAndAccess() at crud.go:1291
2018-12-22T16:21:22.116+03:30 [WRN] Sync fn exception: TypeError: Cannot access member ‘0’ of undefined; doc = map[_rev:5-9b43acff150554ccb806460716b6adcd _revisions:map[start:5 ids:[9b43acff150554ccb806460716b6adcd eae9841adbbb27642380ba97d23b2abc]] _deleted:true _id:fu!1rtg3hi5l5fsggi1ke62bndrno9814!accn!555584391] – db.(*Database).getChannelsAndAccess() at crud.go:1291
2018-12-22T16:21:22.227+03:30 [WRN] Sync fn exception: TypeError: Cannot access member ‘0’ of undefined; doc = map[_revisions:map[start:3 ids:[210a90c796bc40223753460a835eb7a6 b8e90780aa1531ca32115b5bb4b4d03c]] _deleted:true _id:fu!1rtg3hi5l5fsggi1ke62bndrno9814!accn!205660443 _rev:3-210a90c796bc40223753460a835eb7a6] – db.(*Database).getChannelsAndAccess() at crud.go:1291
2018-12-22T16:21:22.227+03:30 [WRN] Sync fn exception: TypeError: Cannot access member ‘0’ of undefined; doc = map[_rev:3-210a90c796bc40223753460a835eb7a6 _revisions:map[start:3 ids:[210a90c796bc40223753460a835eb7a6 b8e90780aa1531ca32115b5bb4b4d03c]] _deleted:true _id:fu!1rtg3hi5l5fsggi1ke62bndrno9814!accn!205660443] – db.(*Database).getChannelsAndAccess() at crud.go:1291
2018-12-22T16:21:22.228+03:30 [WRN] Sync fn exception: TypeError: Cannot access member ‘0’ of undefined; doc = map[_rev:5-9b43acff150554ccb806460716b6adcd _revisions:map[ids:[9b43acff150554ccb806460716b6adcd eae9841adbbb27642380ba97d23b2abc] start:5] _deleted:true _id:fu!1rtg3hi5l5fsggi1ke62bndrno9814!accn!555584391] – db.(*Database).getChannelsAndAccess() at crud.go:1291
2018-12-22T16:21:22.229+03:30 [WRN] Sync fn exception: TypeError: Cannot access member ‘0’ of undefined; doc = map[_revisions:map[start:5 ids:[9b43acff150554ccb806460716b6adcd eae9841adbbb27642380ba97d23b2abc]] _deleted:true _id:fu!1rtg3hi5l5fsggi1ke62bndrno9814!accn!555584391 _rev:5-9b43acff150554ccb806460716b6adcd] – db.(*Database).getChannelsAndAccess() at crud.go:1291
2018-12-22T17:28:30.542+03:30 [WRN] Sync fn exception: TypeError: Cannot access member ‘0’ of undefined; doc = map[_rev:3-210a90c796bc40223753460a835eb7a6 _revisions:map[start:3 ids:[210a90c796bc40223753460a835eb7a6 b8e90780aa1531ca32115b5bb4b4d03c]] _deleted:true _id:fu!1rtg3hi5l5fsggi1ke62bndrno9814!accn!205660443] – db.(*Database).getChannelsAndAccess() at crud.go:1291
2018-12-22T17:28:30.544+03:30 [WRN] Sync fn exception: TypeError: Cannot access member ‘0’ of undefined; doc = map[_revisions:map[start:5 ids:[9b43acff150554ccb806460716b6adcd eae9841adbbb27642380ba97d23b2abc]] _deleted:true _id:fu!1rtg3hi5l5fsggi1ke62bndrno9814!accn!555584391 _rev:5-9b43acff150554ccb806460716b6adcd] – db.(*Database).getChannelsAndAccess() at crud.go:1291
2018-12-22T17:38:14.855+03:30 [WRN] Client won’t accept JSON, only text/plain,text/html – rest.(*handler).writeJSONStatus() at handler.go:569


#2

Hi,

Please refer to the API documentation for deleting a doc. You need to also specify the revision as a query parameter when you delete a document.

https://docs.couchbase.com/sync-gateway/2.1/rest-api.html#/document/delete__db___doc_