Indexing bucket/_design/sync_gateway never stops.

352 views
Skip to first unread message

CouchbaseLover

unread,
Aug 27, 2014, 11:36:40 AM8/27/14
to mobile-c...@googlegroups.com
Hey, we are super stoked that it's finally time to release our app (has taken us around 2 years and we have been with couchbase lite since the alpha). But now it seems like we are far away from release yet again due to this "bug" ? Can't see what we are doing wrong.

"Indexing bucket/_design/sync_gateway" and nothing is happening. 
The problem is showing up on the Couchbase Console, right corner.

Best Regards


Traun Leyden

unread,
Aug 27, 2014, 11:55:03 AM8/27/14
to mobile-c...@googlegroups.com
Can you dig into the Couchbase Server logs and see if there are any errors?

I've run into major issues before when I wrote a view and forgot to ignore "sync metadata" documents.  What happened is that the documents were too large for Couchbase Server to index, and so it created lots of errors/problems.

Take a look at this issue:


and note that in the screenshots it is stuck on "Indexing bucket/_design/sync_gateway" just as in your issue.  You will probably find similar errors to this one in your Couchbase Server logs.



--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/a41a216c-7fb7-4294-bfc9-2108bafafc57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jens Alfke

unread,
Aug 27, 2014, 12:48:19 PM8/27/14
to mobile-c...@googlegroups.com

On Aug 27, 2014, at 8:36 AM, CouchbaseLover <sharess...@gmail.com> wrote:

"Indexing bucket/_design/sync_gateway" and nothing is happening. 

You haven't said what's going wrong. What is the problem exactly?

—Jens

CouchbaseLover

unread,
Aug 28, 2014, 5:41:57 AM8/28/14
to mobile-c...@googlegroups.com
Thanks for this, our app makes it possible for people to pretty much look for all our "CBLModels" on the server, we are also doing it with slice which means a lot of keys...

After some stresstest to our views and looking trough what's been said on https://github.com/couchbase/sync_gateway/issues/374, it does not seem to be the problem.

Looking at what skyrocketed the CPU, it was the sync gateway with 255 % cpu, it's now on 2 % instead after i updated to 1.0.2 and all seems fine for now. But i haven't stress tested this yet so we will see when our beta testers receives the new version.

Thanks, much appreciated Traun :)

CouchbaseLover

CouchbaseLover

unread,
Aug 28, 2014, 5:47:08 AM8/28/14
to mobile-c...@googlegroups.com
Thing is Jens, i don't know what went wrong. Only one obvious reason i can think of, is that we are requesting a push and pull every 1 second. So if we have 10 devices they are all asking repl pull/push every second.

Regards

CouchbaseLover
Message has been deleted
Message has been deleted

CouchbaseLover

unread,
Sep 1, 2014, 10:51:29 AM9/1/14
to mobile-c...@googlegroups.com

Hey again! I have 10mb (each!!) worth of logs just spamming this fine message :)


[mapreduce_errors:error,2014-08-31T17:55:20.871,ns_1@xxxx:<0.18283.727>:couch_set_view_updater:load_doc:483]Bucket `xx`, main group `_design/sync_gateway`, skipping document with ID `_sync:att:sha1-d7IHYqinCe4nen7xYkBnI7UDKEw=`: too large body (3924252 bytes)


Andrew Reslan

unread,
Sep 1, 2014, 10:57:14 AM9/1/14
to mobile-c...@googlegroups.com
Can you open a new issue for your specific case at https://github.com/couchbase/sync_gateway/issues

And I'll pick this up.

Andy

Jens Alfke

unread,
Sep 1, 2014, 2:03:56 PM9/1/14
to mobile-c...@googlegroups.com

On Sep 1, 2014, at 7:45 AM, CouchbaseLover <sharess...@gmail.com> wrote:

[mapreduce_errors:error,2014-09-01T1:45:33.118,ns_1@xxxx:<0.2001.804>:couch_set_view_updater:load_doc:483]Bucket `horse`, main group `_design/sync_gateway`, skipping document with ID `_sync:att:sha1-d7IHYqinCe4nen7xYkBnI7UDKEw=`: too large body (3924252 bytes)

This is a Couchbase Server error, not a Gateway error. Looks like it logs that for large attachments because the body is too big; but that's OK, we're not indexing attachments anyway.

Hey again, have a lot of 10mb (each!!) logs with just one saying.

Wait, you mean each message is 10MB long?! Probably because it's dumping the entire contents of the too-large document? I guess that is bad. (And this sounds like a Couchbase Server bug; if a doc is too big to index it's definitely too big to log!)

—Jens

CouchbaseLover

unread,
Sep 2, 2014, 6:29:36 AM9/2/14
to mobile-c...@googlegroups.com
Don't know if i should report a new issue when Jens said it wasn't even a sync gateway's problem. So far it seems good when i changed the quality of the image in the "attachment named method" from 1.0 to 0.0. And we had a couple of views where we didn't check for property existence, so the view did not like that.

CouchbaseLover 

CouchbaseLover

unread,
Sep 2, 2014, 6:35:38 AM9/2/14
to mobile-c...@googlegroups.com
1.We changed the quality of the image in the attachment named method and so far the server logs hasn't showed any errors yet.
2. I read your documents about the logs and it seems like i was wrong, sorry about that. 

Thanks for the support as always, il be in touch about the status within the day.

CouchbaseLover

Traun Leyden

unread,
Sep 2, 2014, 6:34:38 PM9/2/14
to mobile-c...@googlegroups.com

In my case when I saw this error, I'm pretty sure the root cause was that I'd written a view with a map function that did not ignore sync gateway "metadata" documents.  Eg, any documents which have a doc id which starts with: _sync:

It's a really easy error to make when defining views on couchbase server that index on buckets accessed by sync gateway.  Can you post your map function so we can take a look and make sure they sync gateway metadata docs are being correctly ignored?



--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.

Yuzkan

unread,
Nov 22, 2014, 10:31:47 AM11/22/14
to mobile-c...@googlegroups.com
Hi,

We are having the same issue. We are not creating views in the shadow bucket. Then only views there the ones created by Sync Gateway.

We have 16 documents in the main bucket and 33 documents in the shadow bucket. When we open the couchbase console we see that message which seems to stay there forever:

Indexing bck-shadow/_design/sync_gateway

Log files get full of messages like these:
[mapreduce_errors:error,2014-11-22T17:10:16.994,ns_1@127.0.0.1:<0.25198.1>:couch_set_view_updater:load_doc:483]Bucket `bck-shadow`, main group `_design/sync_gateway`, skipping document with ID `_sync:att:sha1-AMIHo2tt0lLQQ3Pb3lDRCxTNh74=`: too large body (3128379 bytes)
[mapreduce_errors:error,2014-11-22T17:10:17.181,ns_1@127.0.0.1:<0.25206.1>:couch_set_view_updater:load_doc:483]Bucket `bck-shadow`, main group `_design/sync_gateway`, skipping document with ID `_sync:att:sha1-s2bDI8FWjEsmSp7TqW1yD9bJdMk=`: too large body (3179673 bytes)
[mapreduce_errors:error,2014-11-22T17:10:17.228,ns_1@127.0.0.1:<0.25206.1>:couch_set_view_updater:load_doc:483]Bucket `bck-shadow`, main group `_design/sync_gateway`, skipping document with ID `_sync:att:sha1-gHdTsDOuC3WWLR+MyyhjQ72sQto=`: too large body (2397228 bytes)
[ns_server:error,2014-11-22T17:10:17.447,ns_1@127.0.0.1:<0.12889.0>:ns_memcached:verify_report_long_call:294]call {stats,<<>>} took too long: 608000 us
[ns_server:error,2014-11-22T17:10:17.447,ns_1@127.0.0.1:<0.12882.0>:ns_memcached:verify_report_long_call:294]call {stats,<<>>} took too long: 611000 us

Even a simple request to create a session for a user takes forever with Sync Gateway.

Can anyone help with that issue?

Thanks,
Yuzkan

Jens Alfke

unread,
Nov 22, 2014, 2:13:08 PM11/22/14
to mobile-c...@googlegroups.com
This looks like an issue with the Couchbase Server indexer. None of us here are experts at that component; you'd probably be best off asking on the Couchbase Server forums.

(I don't mean to pass the buck; but I know from experience that if I forward your issue to the server engineers, then I'll end up being an intermediary between you and them, which is less efficient than letting you talk to them directly.)

—Jens

Traun Leyden

unread,
Nov 22, 2014, 2:29:59 PM11/22/14
to mobile-c...@googlegroups.com
In my case, when I'd seen that error before, it was my fault:

... I'm pretty sure the root cause was that I'd written a view with a map function that did not ignore sync gateway "metadata" documents.  Eg, any documents which have a doc id which starts with: _sync:

It's a really easy error to make when defining views on couchbase server that index on buckets accessed by sync gateway.  Can you post your map function so we can take a look and make sure they sync gateway metadata docs are being correctly ignored?

--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.

Zack Gramana

unread,
Nov 22, 2014, 3:57:22 PM11/22/14
to <mobile-couchbase@googlegroups.com>
What's the use case for even exposing these to the sync function? Why not exclude them by default?

Jens Alfke

unread,
Nov 22, 2014, 6:26:42 PM11/22/14
to mobile-c...@googlegroups.com

On Nov 22, 2014, at 12:57 PM, Zack Gramana <za...@couchbase.com> wrote:

What's the use case for even exposing these to the sync function? Why not exclude them by default?

Map function, not sync function. This is Couchbase Server's view indexer, not anything in Sync Gateway. Couchbase Server doesn't know about attachments; it treats all documents the same.

—Jens

Zack Gramana

unread,
Nov 22, 2014, 9:06:35 PM11/22/14
to <mobile-couchbase@googlegroups.com>
Ha, well, it makes a whole lot more sense when I read that correctly. 

Cheers.


--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.

Traun Leyden

unread,
Feb 24, 2015, 3:00:21 PM2/24/15
to mobile-c...@googlegroups.com

We ran into the same issue on our demo cluster:

Reply all
Reply to author
Forward
0 new messages