Following the docs instruction to use backticks for config properties that are javascript, we’ve created the following config file but are getting errors on our ent2.8 server that only go away when we remove the content in the backticks. (empty, same for sync property but showing import_filter for brevity)
sync-gateway-config.json
{
"interface": ":4984",
"adminInterface": ":4985",
"log": ["*"],
"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
}
},
"databases": {
"salesrabbit": {
"import_docs": true,
"bucket": "test-bucket",
"server": "http://ec2-52-37-187-174.us-west-2.compute.amazonaws.com:8091,ec2-18-237-136-91.us-west-2.compute.amazonaws.com:8091,ec2-54-191-150-5.us-west-2.compute.amazonaws.com:8091",
"enable_shared_bucket_access": true,
"delta_sync": {
"enabled": true
},
"username": "test-user",
"password": "password",
"users": {
"user1": {"password": "password1", "admin_channels": ["USR-user1"]},
"user2": {"password": "password2", "admin_channels": ["USR-user2", "ORG-office-RD"]},
"user3": {"password": "password3", "admin_channels": ["USR-user3", "ORG-office-WT"]}
},
"num_index_replicas": 0,
"import_filter": `function(doc) {
return true;
}`
}
}
}
The error we are getting points to the import_filter property. This happens when we start the SG as a service on ubuntu. When we run ./sync_gateway /home/sync_gateway/sync_gateway.json
directly we don’t get an error.
2021-01-06 17:20:38 [INFO] [run-sync-gateway] Starting configuration of Sync Gateway...
2021-01-06 17:20:38 [INFO] [run-sync-gateway] Setting Sync Gateway systemd unit /lib/systemd/system/sync_gateway.service config path to /home/sync_gateway/sync_gateway.json
2021-01-06 17:20:38 [INFO] [run-sync-gateway] No ASG auto-fill params specified.
2021-01-06 17:20:38 [INFO] [run-sync-gateway] No auto-fill params specified.
parse error: Invalid numeric literal at line 49, column 33
Any guidance with this error would be appreciated. Doing a google search on the error message was not helpful.