Replication hanging half-way through

77 views
Skip to first unread message

dyowee

unread,
Feb 19, 2014, 9:10:07 PM2/19/14
to mobile-c...@googlegroups.com
Good day,

I'm hosting my own CouchDB behind an nginx reverse proxy, but somehow, half way through or at the end of the replication, it just hangs. In the nginx log, I see this last line

"PUT /mydatabase/_local/2faa741061f6129e87a33d0065a758ba4e36fdf1".

Help anyone? :( The issue is intermittent, but hangs after this PUT request.

Thanks,
Joey

Jens Alfke

unread,
Feb 19, 2014, 9:48:42 PM2/19/14
to mobile-c...@googlegroups.com

On Feb 19, 2014, at 6:10 PM, dyowee <csharpen...@gmail.com> wrote:

I'm hosting my own CouchDB behind an nginx reverse proxy, but somehow, half way through or at the end of the replication, it just hangs. In the nginx log, I see this last line

"PUT /mydatabase/_local/2faa741061f6129e87a33d0065a758ba4e36fdf1".

That PUT is the client saving its replication checkpoint on the server. It happens periodically during replication, and it's generally the last request that'll be sent when a replication completes (actually a few seconds after it completes.)

It's CouchDB that's hanging? You'd probably better ask about that on the CouchDB user mailing list.

—Jens

dyowee

unread,
Feb 19, 2014, 11:15:20 PM2/19/14
to mobile-c...@googlegroups.com
Thanks sir. But is there a way to know if CouchDB or the mobile device is the one that hangs?

Jens Alfke

unread,
Feb 19, 2014, 11:37:43 PM2/19/14
to mobile-c...@googlegroups.com

On Feb 19, 2014, at 8:15 PM, dyowee <csharpen...@gmail.com> wrote:

Thanks sir. But is there a way to know if CouchDB or the mobile device is the one that hangs?

Well, what do you mean by "hangs"? Is CouchDB responding to HTTP requests? Is the mobile app handling user input?

If the behavior is actually "the replication seems to have paused indefinitely before transferring all the documents", that's different from something hanging, and you'll need to describe the behavior in more detail. In general the active participant (probably the mobile device) is the one where you can do some troubleshooting, like turning on extra logging.

—Jens

dyowee

unread,
Feb 19, 2014, 11:47:29 PM2/19/14
to mobile-c...@googlegroups.com
Sorry for not being clear. :(
During debugging, the replication completes without issues. But a couple of users are complaining that the replication doesn't complete. And based on the nginx log, from what I mentioned earlier, a PUT is the last log seen. If I ask the user to restart the device, and start the sync again, then it continues, and I see it in the nginx log.

Jens Alfke

unread,
Feb 20, 2014, 1:56:23 AM2/20/14
to mobile-c...@googlegroups.com

On Feb 19, 2014, at 8:47 PM, dyowee <csharpen...@gmail.com> wrote:

But a couple of users are complaining that the replication doesn't complete. And based on the nginx log, from what I mentioned earlier, a PUT is the last log seen. If I ask the user to restart the device, and start the sync again, then it continues, and I see it in the nginx log.

Hm. There's not really any way to debug it based on just that. Did any of the prior HTTP requests from the same IP address/session return errors?
I think debugging this would require being able to reproduce it on a device and turn on some logging.

—Jens

dyowee

unread,
Feb 22, 2014, 3:55:19 AM2/22/14
to mobile-c...@googlegroups.com
Thanks! :)

dyowee

unread,
Mar 16, 2014, 11:52:01 PM3/16/14
to mobile-c...@googlegroups.com
Good day!
I got more time to debug this and see the logs. After the 'PUT' request, I see that TouchDB logs 'Got response 201', then 'Finished loading'. But from there it seems to stop, no logs either. :(


On Thursday, February 20, 2014 2:56:23 PM UTC+8, Jens Alfke wrote:
Message has been deleted

dyowee

unread,
Mar 17, 2014, 6:04:19 PM3/17/14
to mobile-c...@googlegroups.com
I did a couple of more syncs, and I notice that it stops/blocks whenever postProgressChanged log shows that the total is equal to completed, such as 1000/1000, but the replication .running is still set to YES, and that number is still far from the total number of documents to pull.
Reply all
Reply to author
Forward
0 new messages