Error starting Couchbase Sync Gateway Service

When I edit the serviceconfig.json file and start the Couchbase Sync Gateway service, a window appears with an error message.
image

I am using the latest versions of Couchbase Server and Sync Gateway.
S.O. Windows 10

serviceconfig.json

{
  "adminInterface": "127.0.0.1:4985",
  "interface": "0.0.0.0:4984",
  "databases": {
    "my-database": {
      "server": "http://127.0.0.1:8091",
      "bucket": "my-database", 
      "username": "sync_gateway", 
      "password": "123456",
      "enable_shared_bucket_access": true, 
      "import_docs": true, 
      "num_index_replicas": 0, 
      "users": {
        "GUEST": { "disabled": false, "admin_channels": ["*"] } 
      }
    }
  },
  "logging": { 
    "console": {
      "log_level": "debug",
      "log_keys": ["*"]
    }
  }
}

sg_info.log

2022-04-27T01:12:05.319-03:00 ==== Couchbase Sync Gateway/3.0.0(541;46803d1) CE ====
2022-04-27T01:12:05.325-03:00 ==== Couchbase Sync Gateway/3.0.0(541;46803d1) CE ====
2022-04-27T01:12:05.325-03:00 [INF] Loading content from [C:\Program Files\Couchbase\Sync Gateway\serviceconfig.json] …
2022-04-27T01:12:05.326-03:00 [INF] Config: Starting in persistent mode using config group “default”
2022-04-27T01:12:05.326-03:00 [INF] Logging: Console to stderr
2022-04-27T01:12:05.326-03:00 [INF] Logging: Files to C:\Program Files\Couchbase\Sync Gateway\var\lib\couchbase\logs
2022-04-27T01:12:05.326-03:00 [INF] Logging: Console level: debug
2022-04-27T01:12:05.326-03:00 [INF] Logging: Console keys: [* HTTP]
2022-04-27T01:12:05.326-03:00 [INF] Logging: Redaction level: partial
2022-04-27T01:12:05.327-03:00 [ERR] Couldn’t start Sync Gateway: 1 errors:
Must use secure scheme in Couchbase Server URL, or opt out by setting bootstrap.use_tls_server to false. Current URL: couchbase://127.0.0.1 – rest.ServerMain() at main.go:26
2022-04-27T01:19:14.977-03:00 ==== Couchbase Sync Gateway/3.0.0(541;46803d1) CE ====
2022-04-27T01:19:14.982-03:00 ==== Couchbase Sync Gateway/3.0.0(541;46803d1) CE ====
2022-04-27T01:19:14.982-03:00 [INF] Loading content from [C:\Program Files\Couchbase\Sync Gateway\serviceconfig.json] …
2022-04-27T01:19:14.983-03:00 [INF] Config: Starting in persistent mode using config group “default”
2022-04-27T01:19:14.983-03:00 [INF] Logging: Console to stderr
2022-04-27T01:19:14.983-03:00 [INF] Logging: Files to C:\Program Files\Couchbase\Sync Gateway\var\lib\couchbase\logs
2022-04-27T01:19:14.984-03:00 [INF] Logging: Console level: debug
2022-04-27T01:19:14.984-03:00 [INF] Logging: Console keys: [* HTTP]
2022-04-27T01:19:14.984-03:00 [INF] Logging: Redaction level: partial
2022-04-27T01:19:14.984-03:00 [ERR] Couldn’t start Sync Gateway: 1 errors:
Must use secure scheme in Couchbase Server URL, or opt out by setting bootstrap.use_tls_server to false. Current URL: couchbase://127.0.0.1 – rest.ServerMain() at main.go:26

Hello,

Because you aren’t using TLS - you need to disable it in your config:

So something like this should fix it:

bootstrap_config: {
use_tls_server: false
},

Please remember don’t do this in production!

Thanks
Aaron

1 Like

I think I got it resolved. Thanks.

1 Like

hi…can you share with me where you put the bootstrap config line please? Everywhere I placed it in my config.json file, unknown field “bootstrap” found error pops up. I have tried:

bootstrap_config
bootstrap
bootstrap.use_tls_server.

but the same error

1 Like

Hi Sium, I’ve just have the same issue as you have. Did you already found a solution for your problem?

Thank you very much for your help!

Edit:
I was able to make it work for the Sync Gateway V3. This is now my entire config file:

{
“bootstrap”: {
“server”: “127.0.0.1:8091”,
“username”: “admin”,
“password”: “password”,
“use_tls_server”: false
},
“logging”: {
“log_file_path”: “/var/tmp/sglogs”,
“console”: {
“log_level”: “debug”,
“log_keys”: [
“*”
]
},
“error”: {
“enabled”: true,
“rotation”: {
“max_size”: 20,
“max_age”: 180
}
},
“warn”: {
“enabled”: true,
“rotation”: {
“max_size”: 20,
“max_age”: 90
}
},
“info”: {
“enabled”: false
},
“debug”: {
“enabled”: false
}
}
}