Syncgateway failed to start with error "Job for sync_gateway.service failed because the control process exited with error code. See "systemctl status sync_gateway.service" and "journalctl -xe" for details

Hi Guys,

I have one server where i have my couchbase and sync_gateway installed . CB server is up and running and i’m able to access the couchbase gui page as well. Sync gateway starts with the default json while but i wanted to configure the sync btwn the sync_gateway and my couchbase server and below is my new json file paramter enteries.

{
“adminInterface”: “10.10.63.11:4985”,
“interface”: “10.10.63.11:4986”,
“databases”: {
“db1”: {
“server”: “http://10.11.22.33:8091”,
“bucket”: “Test1”,
“username”: “sync_gateway”,
“password”: “test@2021”,
“enable_shared_bucket_access”: true,
“import_docs”: true,
“num_index_replicas”: 0,
“users”: {
“GUEST”: { “disabled”: false, “admin_channels”: ["*"] }
“allow_conflicts”: false,
“revs_limit”: 20
},
}
}
}

But syncgateway start is giving an error in the logs.

2021-05-12T22:25:03.714+05:30 ==== Couchbase Sync Gateway/2.8.2(1;4df7a2d) EE ====
2021-05-12T22:25:03.714+05:30 ==== Couchbase Sync Gateway/2.8.2(1;4df7a2d) EE ====
2021-05-12T22:25:03.721+05:30 [ERR] Error opening database syncgateway: 502 Unable to connect to Couchbase Server (connection refused). Please ensure it is running and reachable at the configured host and port. Detailed error: Fatal error connecting to bucket – rest.RunServer() at config.go:1086

Please let me what could be the issue.

As indicated in the error message, the Sync Gateway is unable to access the server. Did you try opening up the http://10.11.22.33:8091 in a browser on sync gateway machine (or any external machine)? Also did you configure the “Test1” bucket on sever?

Also, would suggest using “couchbase” protocol for connecting sync gateway to server.

Yep I do not have issue any issue with the couchbase server http://serverip:8091 I’m able to access the GUI. Yes Test1 bucket do exist in the couchbase server.

You will need all client-to-node ports opened for SG to connect to:

Client-to-node
Unencrypted : 8091-8096, 9140, 11210, 11211
Encrypted : 11207, 18091-18096