Sync Gateway 2.0 invalid memory address or nil pointer dereference


#1

Hi All,

We are getting some error in the sync gateway 2.0.0 and CBS 5.1 and CBL 1.4.1 following is the error

2018-05-25T13:15:05.490Z HTTP: #18657: POST /bucketname/_bulk_get?revs=true&attachments=true (as ADMIN)
2018-05-25 13:15:05.495843 I | http: panic serving 100.96.0.1:59298: runtime error: invalid memory address or nil pointer dereference
goroutine 105494 [running]:
net/http.(*conn).serve.func1(0xc420ad1540)
/usr/local/go/1.8.5/go/src/net/http/server.go:1721 +0xd0
panic(0xbb6020, 0x1246f50)
/usr/local/go/1.8.5/go/src/runtime/panic.go:489 +0x2cf
github.com/couchbase/sync_gateway/db.(*DatabaseContext).revCacheLoaderForDocument(0xc4202df340, 0xc420e94780, 0xc42037f7a0, 0x22, 0xc420e94780, 0x0, 0x0, 0xc420289d90, 0xc4211653e8)
/home/couchbase/jenkins/workspace/sgw-unix-build@2/2.0.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/crud.go:204 +0x1fb
github.com/couchbase/sync_gateway/db.(*DatabaseContext).revCacheLoader(0xc4202df340, 0xc42103ab20, 0x12, 0xc42037f7a0, 0x22, 0x0, 0x10d3540, 0xc4201a2328, 0xc421165400, 0xc4211653f8, …)
/home/couchbase/jenkins/workspace/sgw-unix-build@2/2.0.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/crud.go:183 +0x83
github.com/couchbase/sync_gateway/db.(*DatabaseContext).(github.com/couchbase/sync_gateway/db.revCacheLoader)-fm(0xc42103ab20, 0x12, 0xc42037f7a0, 0x22, 0x0, 0x0, 0xc421165488, 0x6ca8e4, 0xc423378e00, 0x7f)
/home/couchbase/jenkins/workspace/sgw-unix-build@2/2.0.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/database.go:193 +0x55
github.com/couchbase/sync_gateway/db.(*revCacheValue).load(0xc42052cfc0, 0xc420330cc0, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/couchbase/jenkins/workspace/sgw-unix-build@2/2.0.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/revision_cache.go:144 +0x1e5
github.com/couchbase/sync_gateway/db.(*RevisionCache).Get(0xc420289d70, 0xc4201578a0, 0x12, 0xc424675b00, 0x22, 0x7f, 0x0, 0x0, 0x7f, 0x87)
/home/couchbase/jenkins/workspace/sgw-unix-build@2/2.0.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/revision_cache.go:58 +0x9b
github.com/couchbase/sync_gateway/db.(*Database).GetRevWithHistory(0xc4201571c0, 0xc4201578a0, 0x12, 0xc424675b00, 0x22, 0x7fffffff, 0x0, 0x0, 0x0, 0xc4217c76c0, …)
/home/couchbase/jenkins/workspace/sgw-unix-build@2/2.0.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/db/crud.go:249 +0x8a
github.com/couchbase/sync_gateway/rest.(*handler).handleBulkGet.func1(0xc420176450, 0xc99c7b, 0xc)
/home/couchbase/jenkins/workspace/sgw-unix-build@2/2.0.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/rest/bulk_api.go:430 +0x81c
github.com/couchbase/sync_gateway/rest.(*handler).writeMultipart(0xc42096c280, 0xc930f5, 0x5, 0xc421165950, 0xc41d3f5ad6, 0x1257ea0)
/home/couchbase/jenkins/workspace/sgw-unix-build@2/2.0.0/enterprise/godeps/src/github.com/couchbase/sync_gateway/rest/handler.go:646 +0x232
github.com/couchbase/sync_gateway/rest.(*handler).handleBulkGet(0xc42096c280, 0x0, 0x0)

Can you help out knowing what should be the reason and what should be the work around for the same.

CC:- @househippo

Regards
Pankaj Sharma


#2

That’s potentially a bug, but we’d need to get a closer look at the full logs to understand the context.

If you’ve got a SLA, I’d recommend raising this issue there.

If not, please file a github issue in https://github.com/couchbase/sync_gateway/issues


#3

I have filed a ticket at support. Thanks Adam.