Sync Gateway unable to start

2019-07-23T16:08:08.372+05:30 ==== Couchbase Sync Gateway/2.5.0(271;bf3ddf6) EE ====
2019-07-23T16:08:08.372+05:30 [INF] Logging: Console to stderr
2019-07-23T16:08:08.372+05:30 [INF] Logging: Files disabled
2019-07-23T16:08:08.372+05:30 [ERR] No log_file_path property specified in config, and --defaultLogFilePath command line flag was not set. Log files required for product support are not being generated.
2019-07-23T16:08:08.372+05:30 [WRN] Using deprecated config option: “log”. Use “logging.console.log_keys” instead. – rest.(*ServerConfig).deprecatedConfigLoggingFallback.func5() at config.go:674
2019-07-23T16:08:08.372+05:30 [WRN] Deprecated log key: “CRUD+” found. Changing to: “CRUD”. – base.ToLogKey.func1() at log_keys.go:177
2019-07-23T16:08:08.372+05:30 [WRN] Deprecated log key: “REST+” found. Changing to: “REST”. – base.ToLogKey.func1() at log_keys.go:177
2019-07-23T16:08:08.372+05:30 [WRN] Invalid log key: REST+ – base.ToLogKey.func2() at log_keys.go:187
2019-07-23T16:08:08.372+05:30 [WRN] Deprecated log key: “Changes+” found. Changing to: “Changes”. – base.ToLogKey.func1() at log_keys.go:177
2019-07-23T16:08:08.372+05:30 [WRN] Deprecated log key: “Attach+” found. Changing to: “Attach”. – base.ToLogKey.func1() at log_keys.go:177
2019-07-23T16:08:08.372+05:30 [WRN] Invalid log key: Attach+ – base.ToLogKey.func2() at log_keys.go:187
2019-07-23T16:08:08.372+05:30 [INF] Logging: Console level: info
2019-07-23T16:08:08.372+05:30 [INF] Logging: Console keys: [Changes CRUD HTTP]
2019-07-23T16:08:08.372+05:30 [INF] Logging: Redaction level: none
2019-07-23T16:08:08.372+05:30 [INF] requestedSoftFDLimit >= currentHardFdLimit (5000 >= 4096) capping at 4096
2019-07-23T16:08:08.372+05:30 [INF] Configured process to allow 4096 open file descriptors
2019-07-23T16:08:08.372+05:30 [INF] Logging stats with frequency: 1m0s
2019-07-23T16:08:08.372+05:30 [INF] Opening db /hello as bucket “visitor_management”, pool “default”, server http://13.234.203.187:8091
2019-07-23T16:08:08.372+05:30 [INF] GoCBCustomSGTranscoder Opening Couchbase database visitor_management on http://13.234.203.187:8091 as user “Shubham”
2019-07-23T16:08:08.664+05:30 [INF] Successfully opened bucket visitor_management
2019-07-23T16:08:08.664+05:30 [INF] Set query timeouts for bucket visitor_management to cluster:1m15s, bucket:1m15s
2019-07-23T16:08:09.172+05:30 [INF] Initializing indexes with numReplicas: 1…
2019-07-23T16:08:09.336+05:30 [ERR] Error opening database hello: Unable to install index syncDocs: Error installing Couchbase index: sg_syncDocs_x1: Unable to create indexes with the specified number of replicas (1). Increase the number of index nodes, or modify ‘num_index_replicas’ in your Sync Gateway database config. – rest.RunServer() at config.go:965

i had also increase ‘num_index_replicas’ in config file but after that same problem occur. please resolve it

Hi,

It looks like you only have a single indexer node on Couchbase Server, so you’ll have to set "num_index_replicas": 0, or add an additional indexer node on Couchbase Server in order to meet your required number of replicas.

how can i add additional indexer node on couchbase server?

You can follow the steps outlined here, making sure to include “Index” in the services you want to enable on the new node:

https://docs.couchbase.com/server/6.0/manage/manage-nodes/add-node-and-rebalance.html

i m getting an invalid database name error
[ERR] 400 invalid database name “favicon.ico” – rest.(*handler).writeError() at handler.go:690

That’s not an error you need to worry about. Your web browser in the background is trying to find an icon for the URL Sync Gateway is running on.

so what the solution for this
after running one time it gives this invalida database name.

There isn’t a problem with the error. You don’t need to do anything, just ignore it.

Sync Gateway should be working now. Try connecting a Couchbase Lite client, or using the REST API.

no its not working, there s written connection lost
Changes: Connection lost from client:

In that particular error, your client is disconnecting from Sync Gateway part-way through replication. It would be worth looking at the logs from the client side to determine why that is happening.

Are you running Sync Gateway behind any load balancers, or proxies, or connecting directly from the Couchbase Lite device to Sync Gateway?

i m connecting it by using config file in which all the credentials are set

it is automatically shutdown after i run nd theres written invalid database name and connection lost

Sync Gateway automatically shuts down? Or the client?

Can you specify which versions you’re running of these:

  • Couchbase Server
  • Couchbase Sync Gateway
  • Couchbase Lite (and platform)

And provide a full sample of the logs from Sync Gateway where you see this error happening.

I m using couchbase server - 6.0
couchbase sync gateway - 2.5
this is the full log of error
2019-07-23T12:32:41.628Z [INF] HTTP: #001: GET /hello/ (as ADMIN)
2019-07-23T12:32:41.790Z [INF] HTTP: #002: GET /favicon.ico/ (as ADMIN)
2019-07-23T12:32:41.791Z [ERR] 400 invalid database name “favicon.ico” – rest.(handler).writeError() at handler.go:690
2019-07-23T12:32:41.791Z [INF] HTTP: #002: --> 400 invalid database name “favicon.ico” (0.1 ms)
2019-07-23T12:32:47.797Z [INF] HTTP: #003: GET /hello/ (as ADMIN)
2019-07-23T12:32:56.206Z [INF] HTTP: #004: GET /hello/_config (as ADMIN)
2019-07-23T12:32:56.252Z [INF] HTTP: #005: GET /favicon.ico/ (as ADMIN)
2019-07-23T12:32:56.252Z [ERR] 400 invalid database name “favicon.ico” – rest.(handler).writeError() at handler.go:690
2019-07-23T12:32:56.252Z [INF] HTTP: #005: --> 400 invalid database name “favicon.ico” (0.1 ms)
2019-07-23T12:32:56.256Z [INF] HTTP: #006: GET /hello/_changes?limit=10&include_docs=true (as ADMIN)
2019-07-23T12:32:56.257Z [INF] Changes: c:#006 MultiChangesFeed(channels: {
}, options: {Since:0 Limit:10 Conflicts:false IncludeDocs:true Wait:false Continuous:false Terminator:0xc000027c80 HeartbeatMs:0 TimeoutMs:300000 ActiveOnly:false Ctx:}) …
2019-07-23T12:32:56.283Z [INF] Changes: c:#006 MultiChangesFeed done
2019-07-23T12:32:56.350Z [INF] HTTP: #007: GET /hello/_all_docs (as ADMIN)
2019-07-23T12:32:56.352Z [INF] HTTP: #008: GET /hello/_changes?since=14&include_docs=true&limit=10 (as ADMIN)
2019-07-23T12:32:56.352Z [INF] Changes: c:#008 MultiChangesFeed(channels: {
}, options: {Since:14 Limit:10 Conflicts:false IncludeDocs:true Wait:false Continuous:false Terminator:0xc0001f8300 HeartbeatMs:0 TimeoutMs:300000 ActiveOnly:false Ctx:}) …
2019-07-23T12:32:56.358Z [INF] Changes: c:#008 MultiChangesFeed done
2019-07-23T12:32:56.399Z [INF] HTTP: #009: GET /hello/_changes?since=14&include_docs=true&feed=longpoll (as ADMIN)
2019-07-23T12:32:56.399Z [INF] Changes: c:#009 MultiChangesFeed(channels: {}, options: {Since:14 Limit:0 Conflicts:false IncludeDocs:true Wait:true Continuous:false Terminator:0xc0001f88a0 HeartbeatMs:0 TimeoutMs:300000 ActiveOnly:false Ctx:}) …
2019-07-23T12:32:56.420Z [INF] HTTP: #010: GET /hello/_changes?since=31&include_docs=true&limit=10 (as ADMIN)
2019-07-23T12:32:56.420Z [INF] Changes: c:#010 MultiChangesFeed(channels: {
}, options: {Since:31 Limit:10 Conflicts:false IncludeDocs:true Wait:false Continuous:false Terminator:0xc0001f8900 HeartbeatMs:0 TimeoutMs:300000 ActiveOnly:false Ctx:}) …
2019-07-23T12:32:59.751Z [INF] Changes: Connection lost from client: (as ADMIN)
2019-07-23T12:32:59.752Z [INF] Changes: Connection lost from client: (as ADMIN)

The changes request being sent is a “normal” feed type by default, also known as a one-shot, where the request ends when the changes response has ‘caught up’ with the latest documents to replicate.

You can try changing the feed option on the request to continuous (documented in the REST API link I provided earlier), to run a continous replication that doesn’t stop when caught up.

You can read more about the different types of replication feeds here: https://docs.couchbase.com/sync-gateway/current/server-integration.html#changes-feed

Where to set this feed field, could u ellaborate to me . in config file?

No it’s a parameter on the changes request you send to Sync Gateway. E.g:
/_changes?feed=continuous&since=31&include_docs=true&limit=10

Please see the API docs for the _changes endpoint which covers all of these parameters: https://docs.couchbase.com/sync-gateway/2.1/rest-api.html#/database/get__db___changes

You never got back to me with what client you’re using to connect to Sync Gateway, but it sounds like you don’t want to use Couchbase Lite, which does all of this for you in a device-native library.

There’s a lot of information in the documentation which I suggest you read through if you’re writing your own integration with Sync Gateway.