Synch gateway 3.0 docker mac m1 connection refused tcp 127.0.0.1:11207

Docker logs
2022-11-15T16:50:47.191Z ==== Couchbase Sync Gateway/3.0.4(13;godeps/) CE ====
2022-11-15T16:50:47.192Z [INF] Loading content from [/etc/sync_gateway/sync_gateway.json] …
2022-11-15T16:50:47.213Z [INF] Config: Starting in persistent mode using config group “default”
2022-11-15T16:50:47.214Z [INF] Logging: Console to stderr
2022-11-15T16:50:47.217Z [INF] Logging: Files to /var/log/sync_gateway
2022-11-15T16:50:47.219Z [INF] Logging: Console level: info
2022-11-15T16:50:47.219Z [INF] Logging: Console keys: [* HTTP]
2022-11-15T16:50:47.219Z [INF] Logging: Redaction level: partial
2022-11-15T16:50:47.219Z [INF] Logging stats with frequency: &{1m0s}
2022-11-15T16:50:47.240Z [WRN] gocb: Pipeline Client 0x400024eb60 failed to bootstrap: check server ports and cluster encryption setting: dial tcp 127.0.0.1:11207: connect: connection refused – base.GoCBCoreLogger.Log() at logger_external.go:79
2022-11-15T16:50:50.241Z [WRN] gocb: CCCPPOLL: Failed to retrieve CCCP config. check server ports and cluster encryption setting: dial tcp 127.0.0.1:11207: connect: connection refused – base.GoCBCoreLogger.Log() at logger_external.go:79

Synch gateway config
{
“bootstrap”: {
“server”: “couchbases://localhost”,
“server_tls_skip_verify”: true,
“username”: “admin”,
“password”: “password”
},
“logging”: {
“console”: {
“enabled”: true,
“log_level”: “info”,
“log_keys”: [“*”]
}
}
}

Started couch server with following command
docker run -d --name cb-server
–network workshop
-p 8091-8094:8091-8094 -p 11210:11210
couchbase:community
Synch gateway
docker run -p 4984-4986:4984-4986
–network workshop
–name sync-gateway
-d
-v pwd/sync-gateway-config.json:
/etc/sync_gateway/sync_gateway.json
couchbase/sync-gateway:community
/etc/sync_gateway/sync_gateway.json

On MacOS in docker, the controller node on Couchbase Server needs to be renamed to 127.0.0.1.nip.io (or another DNS-resolvable address) before Sync Gateway can connect to it.

Naming a Node | Couchbase Docs are instructions on how to rename the controller node, and you can use hostname=127.0.0.1.nip.io.

I’m not the expert here, but it is trying to connect to port 11207 (the tls kv port), but you only have the non-tls kv port mapped ( -p 11210:11210 )

1 Like

I tried with hostname 127.0.0.1.nip.io its same error, verified node was changed was able to access with 8091 port

I tried with hostname coubase.local then its not able to discover the node itself

2022-11-16T03:01:12.182Z [WRN] gocb: CCCPPOLL: Failed to retrieve config from any node. – base.GoCBCoreLogger.Log() at logger_external.go:79
2022-11-16T03:01:14.183Z [INF] Config: Couldn’t initialize cluster agent: unambiguous timeout | {“InnerError”:{“InnerError”:{“InnerError”:{},“Message”:“unambiguous timeout”}},“OperationID”:“WaitUntilReady”,“Opaque”:“”,“TimeObserved”:5003409335,“RetryReasons”:[“NOT_READY”],“RetryAttempts”:10,“LastDispatchedTo”:“”,“LastDispatchedFrom”:“”,“LastConnectionID”:“”} - will retry…

etc/hosts entry
127.0.0.1 coubase.local

Similarly if connecting with couchbases:// you’ll need to expose the tls ports for other services that SG will be using, like query (e.g. 18091-18094)

Community Edition of Couchbase Server does not support TLS for client connections. You’ll want to have bootstrap config look like

    "bootstrap": {
        "server": "couchbase://cb-server",
        "use_tls_server": false,
        "username": "admin",
        "password": "password"
    },

In addition to using not using TLS in the connection string couchbase:// you want to change the address to the docker container hosting Couchbase Server.