eli212
December 26, 2023, 1:20pm
1
Does Couchbase sync gateway supports change detection of a specific collection (not default) of Couchbase server?
I have tried to run CB server and sync gateway, and it is detecting changes but only on the default collection, even when I’m changing my config file according to this guide:
Much more details available in an issue I’ve opened on GitHub:
opened 10:38AM - 26 Dec 23 UTC
### Sync Gateway version
3.1
### Operating system
Running on docker (my lap… top is Win 11)
### Config file
```javascript
{
"interface":":4984",
"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": {
"demobucket": {
"import_docs": "continuous",
"enable_shared_bucket_access":true,
"name": "db",
"bucket": "default",
"scopes" : {
"_default": {
"collections": {
"specific_collection" : {
"sync": `
function(doc, oldDoc, meta) {
channel("legacy")
}
`,
"import_filter": `
function(doc) {
return doc.type == "mobile"
}
`
}
}
}
},
"num_index_replicas": 0,
"server": "http://cb-server:8091",
"username": "username",
"password": "password",
"num_index_replicas":0,
"users":{
"admin": {"password": "password", "admin_channels": ["*"]}
},
"revs_limit":20
}
}
}
```
### Log output
When going to "http://localhost:4985/demobucket._default.specific_collection/_changes" I get:
{
"error": "not_found",
"reason": "keyspace demobucket._default.cdp_business_unit not found"
}
### Expected behavior
I expect to see the changes in the specific collection that I configured in the config file
### Actual behavior
What actually happened?
### Steps to reproduce
1. Create new collection named "specific_collection".
2. Change your config to the config I provided.
3. Run it on docker.
4. Go to "http://localhost:4985/demobucket._default.specific_collection/_changes".
--
**I think this is because in the file "bootstrap.go" the collection name that being delivered is "DefaultCollection()" instead of the collection that is been provided in the config.**
mreiche
December 26, 2023, 7:25pm
2
From thw error message. It sounds like it like you have a mismatch with the collection name. Is it “specific_collection” or “cdp_business_unit”?
When going to “http://localhost:4985/demobucket._default.specific_collection/_changes ” I get:
{
“error”: “not_found”,
“reason”: “keyspace demobucket._default.cdp_business_unit not found”
}
eli212
January 3, 2024, 1:57pm
3
It was my bad displaying the correct error.
The correct error was:
{
“error”: “not_found”,
“reason”: “keyspace demobucket._default.specific_collection not found”
}
Anyway, I’ve solved the issue by updating the config with the API of “http://localhost:4985/demobucket/_config ”. Is there a way to configure the config on the file level instead of calling the API?
system
Closed
April 2, 2024, 1:58pm
4
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.