404 missing error on sync_gateway


#1

Hello everyone,

I’m trying to pull data from my sync_gateway server. I’m using the sample GrocerySync-Android code from the documentation website. I just changed the syncUrl and try to pull data from the server with pull replication. But I am getting the following error and when I change something in my sync_gateway bucket, I can’t see anything on the project that says so.

2016-04-27T11:29:53.823+03:00 HTTP:  #001: POST /sync_gateway/_changes?feed=longpoll&heartbeat=300000&style=all_docs&since=6442&limit=50
2016-04-27T11:29:53.823+03:00 Changes+: Int sequence multi changes feed...
2016-04-27T11:29:53.823+03:00 Changes: MultiChangesFeed({*}, {Since:6442 Limit:50 Conflicts:true IncludeDocs:false Wait:true Continuous:false Terminator:0xc8204db0e0 HeartbeatMs:300000 TimeoutMs:300000 ActiveOnly:false}) ...
2016-04-27T11:29:53.825+03:00 Changes+: MultiChangesFeed: channels expand to channels.TimedSet{"!":channels.VbSequence{VbNo:(*uint16)(nil), Sequence:0x1}} ...
2016/04/27 11:29:55 go-couchbase: call to ViewCustom("sync_gateway", "channels") in github.com/couchbase/sync_gateway/db.(*DatabaseContext).getChangesInChannelFromView took 2.0764323s
2016-04-27T11:29:55.902+03:00 Changes+: MultiChangesFeed waiting...
2016-04-27T11:29:55.902+03:00 Changes+: Waiting for "sync_gateway"'s count to pass 2
2016-04-27T11:29:56.993+03:00 Changes: Connection lost from client:  (as GUEST)
2016-04-27T11:29:56.993+03:00 Changes+: Notifying to check for _changes feed termination
2016-04-27T11:29:56.993+03:00 Changes: MultiChangesFeed done
2016-04-27T11:30:09.644+03:00 HTTP:  #002: GET /sync_gateway/_local/b882fecdaf9c717b2b2535f2a5bc078ddb2c735d
2016-04-27T11:30:09.644+03:00 HTTP: #002:     --> 404 missing  (1.3 ms)
2016-04-27T11:30:09.758+03:00 HTTP:  #003: POST /sync_gateway/_changes?feed=normal&heartbeat=300000&style=all_docs&limit=50
2016-04-27T11:30:09.758+03:00 Changes+: Int sequence multi changes feed...
2016-04-27T11:30:09.758+03:00 Changes: MultiChangesFeed({*}, {Since:0 Limit:50 Conflicts:true IncludeDocs:false Wait:false Continuous:false Terminator:0xc8204db260 HeartbeatMs:300000 TimeoutMs:300000 ActiveOnly:false}) ...
2016-04-27T11:30:09.759+03:00 Changes+: MultiChangesFeed: channels expand to channels.TimedSet{"!":channels.VbSequence{VbNo:(*uint16)(nil), Sequence:0x1}} ...
2016-04-27T11:30:09.784+03:00 Changes+: MultiChangesFeed sending &{Seq:6442 ID:_user/GUEST Deleted:false Removed:{} Doc:map[] Changes:[] Err:<nil> allRemoved:false branched:false}
2016-04-27T11:30:09.784+03:00 Changes: MultiChangesFeed done
2016-04-27T11:30:09.800+03:00 HTTP:  #004: POST /sync_gateway/_changes?feed=longpoll&heartbeat=300000&style=all_docs&since=6442&limit=50
2016-04-27T11:30:09.800+03:00 Changes+: Int sequence multi changes feed...
2016-04-27T11:30:09.800+03:00 Changes: MultiChangesFeed({*}, {Since:6442 Limit:50 Conflicts:true IncludeDocs:false Wait:true Continuous:false Terminator:0xc8204dbb60 HeartbeatMs:300000 TimeoutMs:300000 ActiveOnly:false}) ...
2016-04-27T11:30:09.801+03:00 Changes+: MultiChangesFeed: channels expand to channels.TimedSet{"!":channels.VbSequence{VbNo:(*uint16)(nil), Sequence:0x1}} ...
2016-04-27T11:30:09.801+03:00 Changes+: MultiChangesFeed waiting...
2016-04-27T11:30:09.801+03:00 Changes+: Waiting for "sync_gateway"'s count to pass 2

What I might be doing wrong? Thanks.


#2

The log entries above are normal the first time a client tries to sync with Sync Gateway. The client looks to see if it has previously sync’d with the SG server by trying to get it’s unique checkpoint doc:

/sync_gateway/_local/b882fecdaf9c717b2b2535f2a5bc078ddb2c735d

If the doc does not exist the client and a _changes feed starting from sequence 0. The client will write to the same checkpoint doc to record the last revision sequence that it successfully sync’d, it will get this checkpoint doc the next time it starts a sync with the same SG to determine the sequence to start sync’ing from.

This improves the performance of pull sync on large databases by skipping revisions that are already on the client.


#3

Hi @andy, Thanks for the response. But I don’t get something, I have like 960+ documents in my sync_gateway bucket and how come I can’t pull anything if I’m doing this right? I guess it acts like there is nothing in the bucket, right? If so, how am I gonna fix it in order to pull them?


#4

@HandeBc

It looks like you are using the GUEST account to test sync? Can you get the GUEST user details using the following curl command (modify host and port to access the ADMIN REST API) and post here.

curl -X GET http://localhost:4985/sync_gateway/_user/GUEST


#5

I did it like that :

http GET :4985/db/_user/GUEST
response is :

HTTP/1.1 200 OK
Content-Encoding: gzip
Content-Length: 74
Content-Type: text/plain; charset=utf-8
Date: Wed, 27 Apr 2016 10:23:13 GMT
Server: Couchbase Sync Gateway/1.2.0

{"name":"GUEST","admin_channels":["*"],"all_channels":["!","*"]}

Because when I write

/opt/couchbase-sync-gateway/bin$ curl -X GET http://(myhost):4985/sync_gateway/_user/GUEST

it says:

curl: (7) Failed to connect to (myhost) port 4985: Connection refused