Couchbase Sync Gateway Service Not running(Windows Server 2016) - Sync Gateway exiting with exit status 1

Hi Team,
We are facing issue with Couchbase Sync Gateway is running, it’s keep on restarting frequently. We are getting below errors in Event Logs.

Couchbase Sync Gateway Version: 2.1.2

Application Event Logs:
The description for Event ID 3 from source SyncGateway cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
Sync Gateway exiting with exit status 1

The description for Event ID 1 from source SyncGateway cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
Starting Sync Gateway service using command: D:\Sync Gateway\sync_gateway.exe --defaultLogFilePath C:\Program Files\Couchbase\Sync Gateway\var\lib\couchbase\logs D:\Sync Gateway\serviceconfig.json

System Event Logs:
Event ID: 7031
The Couchbase Sync Gateway service terminated unexpectedly. It has done this 1 time(s). The following corrective action will be taken in 120000 milliseconds: Restart the service.

Regards,

Arunkumar K

Do you have logs from Sync Gateway to tell you why Sync Gateway is failing to start?
We’re not really integrated into the Windows Service/Event logs, so you won’t get much infromation there.

The SG logs on Windows can be found in:

C:\Program Files\Couchbase\Sync Gateway\var\lib\couchbase\logs

or wherever you’ve configured it manually via log_file_path.

Hi BBRKS

Please find the logs from sg_error.log

2021-02-14T16:17:13.364+01:00 [ERR] Error opening database business_ic: 502 Unable to connect to Couchbase Server (connection refused). Please ensure it is running and reachable at the configured host and port. Detailed error: no access – rest.RunServer() at config.go:903
2021-02-14T16:19:14.303+01:00 ==== Couchbase Sync Gateway/2.1.2(2;35fe28e) ====
2021-02-14T16:20:07.253+01:00 [ERR] Error opening database business_ic: 502 Unable to connect to Couchbase Server (connection refused). Please ensure it is running and reachable at the configured host and port. Detailed error: no access – rest.RunServer() at config.go:903
2021-02-14T16:22:08.175+01:00 ==== Couchbase Sync Gateway/2.1.2(2;35fe28e) ====
2021-02-14T16:22:58.757+01:00 [ERR] Error opening database business_ic: 502 Unable to connect to Couchbase Server (connection refused). Please ensure it is running and reachable at the configured host and port. Detailed error: no access – rest.RunServer() at config.go:903
2021-02-14T16:24:59.674+01:00 ==== Couchbase Sync Gateway/2.1.2(2;35fe28e) ====
2021-02-14T16:25:53.682+01:00 [ERR] Error opening database business_ic: 502 Unable to connect to Couchbase Server (connection refused). Please ensure it is running and reachable at the configured host and port. Detailed error: no access – rest.RunServer() at config.go:903

sync_gateway_error.log

2021-02-15T12:51:03.133+01:00 [WRN] DCP RollbackEx request - rolling back DCP feed for: vbucketId: 815, rollbackSeq: 0. – base.(*DCPReceiver).RollbackEx() at dcp_feed.go:263
2021-02-15T12:51:03.154+01:00 [WRN] DCP RollbackEx request - rolling back DCP feed for: vbucketId: 448, rollbackSeq: 0. – base.(*DCPReceiver).RollbackEx() at dcp_feed.go:263
2021-02-15T12:51:03.185+01:00 [WRN] DCP RollbackEx request - rolling back DCP feed for: vbucketId: 417, rollbackSeq: 0. – base.(*DCPReceiver).RollbackEx() at dcp_feed.go:263
2021-02-15T12:51:03.208+01:00 [WRN] DCP RollbackEx request - rolling back DCP feed for: vbucketId: 758, rollbackSeq: 0. – base.(*DCPReceiver).RollbackEx() at dcp_feed.go:263
2021-02-15T12:51:03.232+01:00 [WRN] DCP RollbackEx request - rolling back DCP feed for: vbucketId: 12, rollbackSeq: 0. – base.(*DCPReceiver).RollbackEx() at dcp_feed.go:263
2021-02-15T12:51:03.254+01:00 [WRN] DCP RollbackEx request - rolling back DCP feed for: vbucketId: 902, rollbackSeq: 0. – base.(*DCPReceiver).RollbackEx() at dcp_feed.go:263
2021-02-15T12:51:03.279+01:00 [WRN] DCP RollbackEx request - rolling back DCP feed for: vbucketId: 735, rollbackSeq: 0. – base.(*DCPReceiver).RollbackEx() at dcp_feed.go:263
2021-02-15T12:51:03.303+01:00 [WRN] DCP RollbackEx request - rolling back DCP feed for: vbucketId: 983, rollbackSeq: 0. – base.(*DCPReceiver).RollbackEx() at dcp_feed.go:263
2021-02-15T12:51:03.328+01:00 [WRN] DCP RollbackEx request - rolling back DCP feed for: vbucketId: 32, rollbackSeq: 0. – base.(*DCPReceiver).RollbackEx() at dcp_feed.go:263
2021-02-15T12:51:03.350+01:00 [WRN] DCP RollbackEx request - rolling back DCP feed for: vbucketId: 76, rollbackSeq: 0. – base.(*DCPReceiver).RollbackEx() at dcp_feed.go:263
2021-02-15T12:51:03.377+01:00 [WRN] DCP RollbackEx request - rolling back DCP feed for: vbucketId: 199, rollbackSeq: 0. – base.(*DCPReceiver).RollbackEx() at dcp_feed.go:263
2021-02-15T12:51:03.399+01:00 [WRN] DCP RollbackEx request - rolling back DCP feed for: vbucketId: 114, rollbackSeq: 0. – base.(*DCPReceiver).RollbackEx() at dcp_feed.go:263
2021-02-15T12:51:06.774+01:00 [INF] GoCBCustomSGTranscoder Opening Couchbase database business_ic on http://sorbcowdkbal004.orb.biz:8091 as user “business_ic”
2021-02-15T12:51:06.780+01:00 [INF] Error opening bucket: no access
2021-02-15T12:51:17.021+01:00 [INF] GoCBCustomSGTranscoder Opening Couchbase database business_ic on http://sorbcowdkbal004.orb.biz:8091 as user “business_ic”
2021-02-15T12:51:17.026+01:00 [INF] Error opening bucket: no access
2021-02-15T12:51:37.509+01:00 [INF] GoCBCustomSGTranscoder Opening Couchbase database business_ic on http://sorbcowdkbal004.orb.biz:8091 as user “business_ic”
2021-02-15T12:51:37.514+01:00 [INF] Error opening bucket: no access
2021-02-15T12:51:37.514+01:00 [WRN] RetryLoop for Attempt to connect to bucket : business_ic giving up after 14 attempts – base.RetryLoop() at util.go:352
2021-02-15T12:51:37.514+01:00 [ERR] Error opening database business_ic: 502 Unable to connect to Couchbase Server (connection refused). Please ensure it is running and reachable at the configured host and port. Detailed error: no access – rest.RunServer() at config.go:903

Regards,

Arunkumar K

2021-02-15T12:51:37.509+01:00 [INF] GoCBCustomSGTranscoder Opening Couchbase database business_ic on http://sorbcowdkbal004.orb.biz:8091 as user “business_ic”
2021-02-15T12:51:37.514+01:00 [INF] Error opening bucket: no access

Implies the user business_ic doesn’t have the correct RBAC privileges to use the business_ic bucket.

Have you followed the instructions here to create the RBAC user and assign roles?

https://docs.couchbase.com/sync-gateway/current/start/gs-sgw-prereqs.html#configure-server

Hi bbrks,

Thanks for your support and help. Issue is resolved.

Regards,

Arunkumar K