Details
-
Bug
-
Resolution: Done
-
Blocker
-
None
-
None
-
None
-
Centos 6
Couchbase server: 5.0.0-3509
Mobile sync gateway: 1.5.0-555
Description
1. Create a 5.0 cluster and create a bucket (travel-sample) and associated users in the cluster.
2. Create a mobile sync gateway and connect to the above connected bucket. Following config was used to connect to the sync gateway:
{
"interface":":4984",
"log": ["*"],
"databases": {
"travel-sample": {
"import_docs": "continuous",
"unsupported":
,
"bucket":"travel-sample",
"server": "http://10.111.170.101:8091",
"username": "test",
"password": "password",
"users":{
"test":
,
"demo":
,
"tester":
,
"GUEST":
}
}
}
}
3. Create documents in the bucket (either using mobile sync rest api or SDKs or using admin console)
4. Validate that the mobile sync function syncs the documents.
5. Now delete a document from the bucket using SDK or from admin console (not mobile sync rest api)
On deleting a document using SDK, the mobile sync gateway crashes with following stack trace.
2017-09-05T11:25:31.051Z Import+: Ignoring delete mutation for test3 - no existing Sync Gateway metadata.
|
2017-09-05T11:25:31.051Z Feed: Got shadow event:test3
|
2017-09-05T11:25:31.051Z CRUD: Importing new doc "test3"
|
panic: assignment to entry in nil map
|
|
goroutine 43 [running]:
|
panic(0xb232e0, 0xc420310930)
|
/usr/local/go/1.7.4/go/src/runtime/panic.go:500 +0x1a1
|
github.com/couchbase/sync_gateway/db.(*Database).initializeSyncData(0xc4201f89c0, 0xc42047c100, 0x0, 0xd)
|
/home/couchbase/jenkins/workspace/sgw-unix-build/1.5.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/crud.go:541 +0x115
|
github.com/couchbase/sync_gateway/db.(*DatabaseContext).assimilate.func1(0xc42047c100, 0xc420379340, 0x8, 0x476d01, 0xc4203108a8)
|
/home/couchbase/jenkins/workspace/sgw-unix-build/1.5.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/assimilator.go:41 +0x7a
|
github.com/couchbase/sync_gateway/db.(*Database).updateAndReturnDoc.func1(0xc42047c100, 0x100, 0x0, 0x0, 0x0, 0xc42047c100, 0x0)
|
/home/couchbase/jenkins/workspace/sgw-unix-build/1.5.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/crud.go:755 +0xff
|
github.com/couchbase/sync_gateway/db.(*Database).updateAndReturnDoc.func2(0x0, 0x0, 0x0, 0xbeee52, 0x7, 0xc42011df90, 0xd, 0x0, 0x0)
|
/home/couchbase/jenkins/workspace/sgw-unix-build/1.5.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/crud.go:976 +0x10c
|
github.com/couchbase/sync_gateway/base.CouchbaseBucketGoCB.WriteUpdate(0xc42007cd80, 0xc420135d20, 0x1a, 0xbeee52, 0x7, 0xc42011df90, 0xd, 0x0, 0x0, 0xfc29c0, ...)
|
/home/couchbase/jenkins/workspace/sgw-unix-build/1.5.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/base/bucket_gocb.go:1352 +0x17e
|
github.com/couchbase/sync_gateway/base.(*CouchbaseBucketGoCB).WriteUpdate(0xc4202126e0, 0xc420310780, 0x5, 0x0, 0xc4203a3500, 0x44, 0x33)
|
<autogenerated>:477 +0xc9
|
github.com/couchbase/sync_gateway/db.(*Database).updateAndReturnDoc(0xc4201f89c0, 0xc420310780, 0x5, 0xbeb301, 0x0, 0xc4201f89e0, 0x410b18, 0x20, 0xb5bce0, 0xc4201f8901, ...)
|
/home/couchbase/jenkins/workspace/sgw-unix-build/1.5.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/crud.go:986 +0x213e
|
github.com/couchbase/sync_gateway/db.(*Database).updateDoc(0xc4201f89c0, 0xc420310780, 0x5, 0x1, 0xc4201f89e0, 0x1, 0x1, 0xc4201f8840, 0x0)
|
/home/couchbase/jenkins/workspace/sgw-unix-build/1.5.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/crud.go:717 +0x70
|
github.com/couchbase/sync_gateway/db.(*DatabaseContext).assimilate(0xc4201aaf00, 0xc420310780, 0x5)
|
/home/couchbase/jenkins/workspace/sgw-unix-build/1.5.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/assimilator.go:45 +0x1ba
|
created by github.com/couchbase/sync_gateway/db.(*DatabaseContext).watchDocChanges
|
/home/couchbase/jenkins/workspace/sgw-unix-build/1.5.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/assimilator.go:26 +0x325
|
|
The mobile sync should not crash even if delete from sdk is not supported (which should be supported since all other operations are supported and work)