Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-57125

panic when updating dcp agent details inside initiateStreamEx for server versions < 7.0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • master
    • None
    • cbgt
    • None
    • Untriaged
    • 0
    • Unknown

    Description

      Incompatibility has been found between server versions that don't have collections support and dcp handling inside cbgt. In sync gateway we disable dcp streamIDs when connecting to a bucket from a server version < 7.0.  During initialisation of sync gateway import feed using cbgt we have hit a panic using server version < 7.0. As we disableStreamIDs for those versions we then hit this line inside cbgt -> https://github.com/couchbase/cbgt/blob/48f41f9f9d8529d8b72582a8bf6bb4aabd6bad79/feed_dcp_gocbcore.go#LL978C11-L978C11 which expects a streamID to be set. But in the case of this version of server it has been disabled and thus we panic trying to access a value on a nil struct.

      Full panic output below:

      panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xbbe48a] goroutine 1209 [running]: github.com/couchbase/cbgt.(*GocbcoreDCPFeed).initiateStreamEx.func1({0xc000747860, 0xf, 0x4edf87?}, {0x0, 0x0?})         /home/couchbase/jenkins/workspace/sgw-unix-build/3.1.0/enterprise/godeps/pkg/mod/github.com/couchbase/cbgt@v1.3.2-0.20230405201040-c0ede9925e46/feed_dcp_gocbcore.go:976 +0x64a github.com/couchbase/gocbcore/v10.(*dcpComponent).OpenStream.func1(0xc00ded89c0, 0xc000788d78?, {0x0?, 0x0?})         /home/couchbase/jenkins/workspace/sgw-unix-build/3.1.0/enterprise/godeps/pkg/mod/github.com/couchbase/gocbcore/v10@v10.2.3-0.20230412164057-d9c465de8911/dcpcomponent.go:82 +0x1317 github.com/couchbase/gocbcore/v10.(*memdQRequest).tryCallback(0xc00de3fc20, 0xc00dec8720?, {0x0, 0x0})         /home/couchbase/jenkins/workspace/sgw-unix-build/3.1.0/enterprise/godeps/pkg/mod/github.com/couchbase/gocbcore/v10@v10.2.3-0.20230412164057-d9c465de8911/memdqpackets.go:237 +0xf0 github.com/couchbase/gocbcore/v10.(*memdClient).resolveRequest(0xc00001ce00, 0xc00ded89c0)         /home/couchbase/jenkins/workspace/sgw-unix-build/3.1.0/enterprise/godeps/pkg/mod/github.com/couchbase/gocbcore/v10@v10.2.3-0.20230412164057-d9c465de8911/memdclient.go:378 +0x865 github.com/couchbase/gocbcore/v10.(*memdClient).run.func2()         /home/couchbase/jenkins/workspace/sgw-unix-build/3.1.0/enterprise/godeps/pkg/mod/github.com/couchbase/gocbcore/v10@v10.2.3-0.20230412164057-d9c465de8911/memdclient.go:488 +0x997 created by github.com/couchbase/gocbcore/v10.(*memdClient).run         /home/couchbase/jenkins/workspace/sgw-unix-build/3.1.0/enterprise/godeps/pkg/mod/github.com/couchbase/gocbcore/v10@v10.2.3-0.20230412164057-d9c465de8911/memdclient.go:415 +0x12a 

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              abhinav Abhi Dangeti
              gregory.newmansmith Gregory Newman-Smith
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty