So I’ve successfully upgraded to latest couchbase DB (server:community-5.0.1) and sync gateway (sync-gateway:1.5.1-community) for my production server.
But when taking a backup and restoring locally I’m having issues sending get requests to retrieve a document. When I run the same query against my production sync gateway it returns a document. Heres an example:
curl http://localhost:4984/db/profile:someemail@gmail.com
{"error":"Bad Request","reason":"Invalid JSON: \"invalid character '\\x00' looking for beginning of value\""}%
In the couchbase sync gateway logs I can see:
sync_1 | 2018-01-13T02:22:52.059Z HTTP: #001: GET /db/profile:someemail@gmail.com
sync_1 | 2018-01-13T02:22:52.060Z CRUD+: No xattr content found for key=profile:someemail@gmail.com, xattrKey=_sync: sub-document path does not exist
sync_1 | 2018-01-13T02:22:52.060Z HTTP: #001: --> 400 Invalid JSON: "invalid character '\x00' looking for beginning of value" (3.7 ms)
How can I update my documents to contain xattr content and why do I get this error when restoring production db locally?
(My dev environment is also running latest sync gateway and couchbase server - same as my production).
Heres my sync gateway config file used for both production and dev:
{
"interface": ":4984",
"profileInterface": "80",
"adminInterface": ":4985",
"MaxFileDescriptors": 25000,
"log": [
"CRUD",
"CRUD+",
"HTTP",
"HTTP+",
"Access",
"Cache",
"Shadow",
"Shadow+",
"Changes",
"Changes+"
],
"databases": {
"litehq": {
"username": "user",
"password": "password",
"bucket": "litehq",
"server": "http://db:8091",
"revs_limit": 20,
"enable_shared_bucket_access": true,
"sync": `
function(doc, oldDoc) {
if(doc.type === "food") {
channel("public");
} else {
channel(doc.members);
}
}`,
"users": {
"GUEST": { "disabled": false, "admin_channels": ["*"] }
}
}
}
}