Connecting to SyncGateway using gocb


#1

I’m trying to estabilish a connection to the sync gateway using the Go SDK.
When connecting, even if I do

cluster, err := gocb.Connect("http://localhost:4984")

the sdk connects to couchbase directly, follows the debug’s output:

Host {localhost 4984}
DEBUG: Attempting to connect...
DEBUG: Trying server at localhost:11210
DEBUG: Trying to connect
DEBUG: Attempting to connect pipeline to localhost:11210
DEBUG: Connected.
DEBUG: Authenticating...
DEBUG: Performing SASL authentication. PLAIN [0 116 101 115 116 0]
DEBUG: Beginning pipeline runner
DEBUG: Writing request to queue!
DEBUG: Writer loop starting...
DEBUG: Reader loop starting...
DEBUG: Got a request to dispatch.
DEBUG: Got response to resolve.
DEBUG: Dispatching response callback.
DEBUG: Attempting to request CCCP configuration
DEBUG: Writing request to queue!
DEBUG: Got a request to dispatch.
DEBUG: Got response to resolve.
DEBUG: Dispatching response callback.
DEBUG: Successfully connected

DEBUG: Switching routing data (update)...
DEBUG:   Revision ID: 0
DEBUG:   Queues:
DEBUG:   Servers:
DEBUG:     0: localhost:11210 (ACTIVE)
DEBUG:   Pending Servers:
DEBUG:   Has WaitQueue? NO
DEBUG:   Has DeadQueue? NO
DEBUG:   Capi Eps:
DEBUG:   Mgmt Eps:
DEBUG: To new data...
DEBUG:   Revision ID: 0
DEBUG:   Queues:
DEBUG:     0: WaitQueue
DEBUG:   Servers:
DEBUG:   Pending Servers:
DEBUG:     0: localhost.local:11210
DEBUG:   Has WaitQueue? YES
DEBUG:   Has DeadQueue? NO
DEBUG:   Capi Eps:
DEBUG:     - http://localhost.local:8092/test
DEBUG:   Mgmt Eps:
DEBUG:     - http://localhost.local:8091
DEBUG: Attempting to connect pipeline to localhost.local:11210
DEBUG: Server read error: read tcp 127.0.0.1:11210: use of closed network connection
DEBUG: Switching routing data (update)...
DEBUG:   Revision ID: 0
DEBUG:   Queues:
DEBUG:     0: WaitQueue
DEBUG:   Servers:
DEBUG:   Pending Servers:
DEBUG:     0: localhost.local:11210
DEBUG:   Has WaitQueue? YES
DEBUG:   Has DeadQueue? NO
DEBUG:   Capi Eps:
DEBUG:     - http://localhost.local:8092/test
DEBUG:   Mgmt Eps:
DEBUG:     - http://localhost.local:8091
DEBUG: To new data...
DEBUG:   Revision ID: 0
DEBUG:   Queues:
DEBUG:     0: WaitQueue
DEBUG:   Servers:
DEBUG:   Pending Servers:
DEBUG:     0: localhost.local:11210
DEBUG:   Has WaitQueue? YES
DEBUG:   Has DeadQueue? NO
DEBUG:   Capi Eps:
DEBUG:     - http://localhost.local:8092/test
DEBUG:   Mgmt Eps:
DEBUG:     - http://localhost.local:8091
DEBUG: Connected.
DEBUG: Authenticating...
DEBUG: Performing SASL authentication. PLAIN [0 116 101 115 116 0]
DEBUG: Beginning pipeline runner
DEBUG: Writing request to queue!
DEBUG: Writer loop starting...
DEBUG: Got a request to dispatch.
DEBUG: Reader loop starting...
DEBUG: Got response to resolve.
DEBUG: Dispatching response callback.
DEBUG: Activating Server...
DEBUG: Switching routing data (server activation 0)...
DEBUG:   Revision ID: 0
DEBUG:   Queues:
DEBUG:     0: WaitQueue
DEBUG:   Servers:
DEBUG:   Pending Servers:
DEBUG:     0: localhost.local:11210
DEBUG:   Has WaitQueue? YES
DEBUG:   Has DeadQueue? NO
DEBUG:   Capi Eps:
DEBUG:     - http://localhost.local:8092/test
DEBUG:   Mgmt Eps:
DEBUG:     - http://localhost.local:8091
DEBUG: To new data...
DEBUG:   Revision ID: 0
DEBUG:   Queues:
DEBUG:     0: Server 0
DEBUG:   Servers:
DEBUG:     0: localhost.local:11210 (ACTIVE)
DEBUG:   Pending Servers:
DEBUG:     0: nil
DEBUG:   Has WaitQueue? NO
DEBUG:   Has DeadQueue? NO
DEBUG:   Capi Eps:
DEBUG:     - http://localhost.local:8092/test
DEBUG:   Mgmt Eps:
DEBUG:     - http://localhost.local:8091

#2

@victorbenso

The smart SDK’s do not include support for Sync Gateway.

You need to connect to Sync Gateway via the REST API’s directly using a canonical REST client library for your programming language.

Andy