{http://CantTellYouServerName:4984/embarkation/, OneShot, @ee57e5}
: Exception in change tracker
java.net.SocketTimeoutException: timeout
at okio.Okio$4.newTimeoutException(Okio.java:227)
at okio.AsyncTimeout.exit(AsyncTimeout.java:284)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:240)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:325)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:314)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210)
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:67)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:179)
at okhttp3.RealCall.execute(RealCall.java:63)
at com.couchbase.lite.replicator.ChangeTracker.runLoop(ChangeTracker.java:336)
at com.couchbase.lite.replicator.ChangeTracker.run(ChangeTracker.java:246)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.net.SocketException: Socket closed
at libcore.io.Posix.recvfromBytes(Native Method)
at libcore.io.Posix.recvfrom(Posix.java:189)
at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:250)
at libcore.io.IoBridge.recvfrom(IoBridge.java:549)
at java.net.PlainSocketImpl.read(PlainSocketImpl.java:481)
at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)
at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)
at okio.Okio$2.read(Okio.java:138)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:236)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:325)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:314)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210)
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:67)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
Comma-separated list of log keys to enable for diagnostic logging. Use [“*”] to enable logging for all log keys.
(Default: [“HTTP”])
Acceptable values are:
Access - Anytime an access() call is made in the sync function.
Attach - Attachment processing.
Auth - Authentication.
Bucket - Sync Gateway interactions with the bucket (verbose logging).
Cache - Interactions with Sync Gateway’s in-memory channel cache.
Changes - Processing of _changes requests.
CRUD - Updates made by Sync Gateway to documents.
DCP - DCP-feed processing (verbose logging).
Events - Event processing (webhooks).
Feed - Server-feed processing.
HTTP - All requests made to the Sync Gateway REST APIs (Sync and Admin). Note that the log keyword HTTP is always enabled, which means that HTTP requests and error responses are always logged (in a non-verbose manner). HTTP+ provides more verbose HTTP logging.
Replicate - Log messages related to replications between Sync Gateways (using sg-replicate). This tag cannot be used for replications initiated by Couchbase Lite.
I know a bit about logging but as you asked for sync gateway logs[quote=“atom_yang, post:4, topic:12688, full:true”]
can you log * as following in sync_gateway.json
“log”: [“*”],
and post the sync gateway’s log?
[/quote]
So I said [quote=“pankaj.sharma, post:5, topic:12688”]
Verbose log is very difficult to parse
[/quote]
Hence is there any specific log which can give us info about the issue. Because “*” gives thousand of line which doesn’t look good.
We are getting this error in one shot and that fails the complete sync.
Because we are starting one shot and then once it is stopped we are moving to continuous. In one shot if the response is not received in 40 seconds, what will happen?
Currently it will go in a loop because the replicator will retry it and eventually become offline. But In my scenario its very common that I will get response in more then 40 seconds. Specially when the sync gateway is on AWS.
In 1.2.1 it was 5 mins , why it was moved to 40 seconds. because if
This is true then how one shot for large number of documents will wok. Do I have to stop using one shot ? Or I can increase the timeout setting any how.
This is not an ideal solution. But you could experiment with different timeout value for a read operation. DEFAULT_READ_TIMEOUT of CouchbaseLiteHttpClientFactory.
Sorry to dig an old post but I’m facing the same issue using Sync Gateway 1.5 and CBL 1.4.0. I need to perform a one shot replication on 3 different buckets and SocketTimeoutException happen sometimes on one of the replication, causing the one shot to terminate.
Restarting the replication might be a solution but I would instead prefer to avoid the exception because
The restart of the replication might cause UX issues (I’m using the changeCount and completedChangeCount to inform the user of the progress of the replication and those would be reseted)
It might happen several time on a single one shot replication.
Side question: do you plan that this issue won’t happen anymore with Couchbase Lite 2.0 and the new replication protocol?
Increase the channel cache which will improve the performance of sync gateway. And it will improve the response time of one shot on sync gateway sent by sync gateway. Current time out is 40 seconds in Android. If it is taking more then 40 seconds even after increasing cache size like I changed it to 100000 then you need to break data into multiple channels and then break the calls. But I guest changing the cache size will improve things.
Although this problem doesn’t come in continuous mode when the network is available. So after all this even if you get the error do note it is only noise and warning not an actuall erro.