Oops you did mention REST API in the first post :).
What's the response message/code when attempting to get the attachment with 
the REST API?

James

On Monday, 6 July 2015 16:42:07 UTC+2, atom992 wrote:
>
>
>
> On Monday, July 6, 2015 at 10:30:24 PM UTC+8, James Nocentini wrote:
>>
>> From the logs, I'm not sure what might be causing the issue.
>>
>> What version of CBL Android are you using?
>>
>>
> I am using Couchbase-Lite-PhoneGap-Plugin version 1.1.0 to build apps run 
> on Android(5.0.1) emulator.  
>
> Can you post your code for getting the attachment from the CBL database?
>>
>>
>> I am using REST API to get info of CBL,not JS code. I am just doing some 
> test on sync docs and attachment.
>
>  
>
>> Saving an attachment on a document creates a new revision. So CBL Android 
>> would be pulling the new revision and attachment. It's probably worth 
>> checking with a breakpoint that you're getting the latest revision from CBL 
>> as well.
>>
>> James
>>
>> On Monday, 6 July 2015 13:54:35 UTC+2, atom992 wrote:
>>>
>>>     I am testing attachment sync between SyncGateway(1.1) and CBL(1.1) 
>>> on Android(5.0.1) emulator using REST API, I can sync attachment from CBL 
>>> to SG, but when I try to sync attachment  from SyncGateway  to CBL, I found 
>>> the completed_change_count of ActiveTasks really  add 1,but I can not find 
>>> the attachment that should be sync to CBL.
>>>     I found the following logs:
>>>
>>> V/ChangeTracker(20024): 
>>> com.couchbase.lite.replicator.ChangeTracker@19153841: /readValue. 
>>>  fullBody: {results=[{seq=80, id=MSG:64598a8e-b613-4026-8b68-4471d65d0bcd, 
>>> changes=[{rev=4-d1da30c8ac590e7875df9823475e3074}]}], last_seq=80}
>>> D/ChangeTracker(20024): 
>>> com.couchbase.lite.replicator.ChangeTracker@19153841: 
>>> changeTrackerReceivedChange: {seq=80, 
>>> id=MSG:64598a8e-b613-4026-8b68-4471d65d0bcd, 
>>> changes=[{rev=4-d1da30c8ac590e7875df9823475e3074}]}
>>> D/Sync    (20024): changeTrackerReceivedChange: {seq=80, 
>>> id=MSG:64598a8e-b613-4026-8b68-4471d65d0bcd, 
>>> changes=[{rev=4-d1da30c8ac590e7875df9823475e3074}]}
>>> D/Sync    (20024): 
>>> com.couchbase.lite.replicator.PullerInternal@39200f0e: adding rev to inbox 
>>> {MSG:64598a8e-b613-4026-8b68-4471d65d0bcd 
>>> #4-d1da30c8ac590e7875df9823475e3074}
>>> V/Sync    (20024): 
>>> com.couchbase.lite.replicator.PullerInternal@39200f0e: 
>>> changeTrackerReceivedChange() incrementing changesCount by 1
>>> V/Sync    (20024): 
>>> com.couchbase.lite.replicator.PullerInternal@39200f0e: Incrementing 
>>> changesCount count from 37 by adding 1 -> 38
>>> V/Sync    (20024): 
>>> com.couchbase.lite.replicator.PullerInternal@39200f0e: addToInbox() called, 
>>> rev: {MSG:64598a8e-b613-4026-8b68-4471d65d0bcd 
>>> #4-d1da30c8ac590e7875df9823475e3074}.  Thread: Thread[ChangeTracker-
>>> http://X.X.X.X/sgdb/,5,TJWS threads]
>>> V/CBLite  (20024): setPaused: false
>>> D/ChangeTracker(20024): 
>>> com.couchbase.lite.replicator.ChangeTracker@19153841: 
>>> /changeTrackerReceivedChange: {seq=80, 
>>> id=MSG:64598a8e-b613-4026-8b68-4471d65d0bcd, 
>>> changes=[{rev=4-d1da30c8ac590e7875df9823475e3074}]}
>>> V/ChangeTracker(20024): 
>>> com.couchbase.lite.replicator.ChangeTracker@19153841: responseOK: true
>>> D/Sync    (20024): changeTrackerCaughtUp
>>> V/ChangeTracker(20024): 
>>> com.couchbase.lite.replicator.ChangeTracker@19153841: Starting new longpoll
>>> V/ChangeTracker(20024): 
>>> com.couchbase.lite.replicator.ChangeTracker@19153841: Making request to 
>>> http://X.X.X.X/sgdb/_changes
>>> V/Sync    (20024): *** 
>>> com.couchbase.lite.replicator.ReplicationInternal$2@b649f0f: BEGIN 
>>> processInbox (1 sequences)
>>> D/Sync    (20024): processInbox called
>>> V/Sync    (20024): 
>>> com.couchbase.lite.replicator.PullerInternal@39200f0e: fetching 1 remote 
>>> revisions...
>>> D/Sync    (20024): 
>>> com.couchbase.lite.replicator.PullerInternal@39200f0e: pullRemoteRevision 
>>> with rev: {MSG:64598a8e-b613-4026-8b68-4471d65d0bcd 
>>> #4-d1da30c8ac590e7875df9823475e3074}
>>> V/Sync    (20024): 
>>> com.couchbase.lite.support.RemoteRequestRetry@5885628: RemoteRequestRetry 
>>> created, url: 
>>> http://X.X.X.X/sgdb/MSG%3A64598a8e-b613-4026-8b68-4471d65d0bcd?rev=4-d1da30c8ac590e7875df9823475e3074&revs=true&attachments=true
>>> V/Sync    (20024): 
>>> com.couchbase.lite.support.RemoteMultipartDownloaderRequest@303d0f41: 
>>> RemoteRequest created, url: 
>>> http://X.X.X.X/sgdb/MSG%3A64598a8e-b613-4026-8b68-4471d65d0bcd?rev=4-d1da30c8ac590e7875df9823475e3074&revs=true&attachments=true
>>> D/Sync    (20024): [fireTrigger()] => RESUME
>>> V/CBLite  (20024): setPaused: false
>>> V/Sync    (20024): *** 
>>> com.couchbase.lite.replicator.ReplicationInternal$2@b649f0f: END 
>>> processInbox (lastSequence=77)
>>> D/Sync    (20024): firing trigger: RESUME
>>> V/Sync    (20024): [onExit()] IDLE => RUNNING
>>> D/Sync    (20024): State transition: IDLE -> RUNNING (via RESUME). 
>>>  this: com.couchbase.lite.replicator.PullerInternal@39200f0e
>>> D/Sync    (20024): [PullerInternal.waitForPendingFutures()] STARTED - 
>>> thread id: 383
>>> E/RemoteRequest(20024): 
>>> com.couchbase.lite.support.RemoteMultipartDownloaderRequest@303d0f41: 
>>> executeRequest() Exception:
>>> E/RemoteRequest(20024): java.lang.NullPointerException: Attempt to 
>>> invoke virtual method 'boolean 
>>> java.lang.String.startsWith(java.lang.String)' on a null object reference
>>> E/RemoteRequest(20024): at 
>>> com.couchbase.lite.support.MultipartDocumentReader.setHeaders(MultipartDocumentReader.java:70)
>>> E/RemoteRequest(20024): at 
>>> com.couchbase.lite.support.RemoteMultipartDownloaderRequest.executeRequest(RemoteMultipartDownloaderRequest.java:95)
>>> E/RemoteRequest(20024): at 
>>> com.couchbase.lite.support.RemoteMultipartDownloaderRequest.run(RemoteMultipartDownloaderRequest.java:48)
>>> E/RemoteRequest(20024): at 
>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
>>> E/RemoteRequest(20024): at 
>>> java.util.concurrent.FutureTask.run(FutureTask.java:237)
>>> E/RemoteRequest(20024): at 
>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
>>> E/RemoteRequest(20024): at 
>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
>>> E/RemoteRequest(20024): at 
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
>>> E/RemoteRequest(20024): at 
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
>>> E/RemoteRequest(20024): at java.lang.Thread.run(Thread.java:818)
>>> D/Sync    (20024): 
>>> com.couchbase.lite.support.RemoteRequestRetry$1@c20acd4: RemoteRequestRetry 
>>> inner request finished, url: 
>>> http://X.X.X.X/sgdb/MSG%3A64598a8e-b613-4026-8b68-4471d65d0bcd?rev=4-d1da30c8ac590e7875df9823475e3074&revs=true&attachments=true
>>> D/Sync    (20024): 
>>> com.couchbase.lite.support.RemoteRequestRetry@5885628: isTransientError 
>>> called, httpResponse: org.apache.http.message.BasicHttpResponse@1e8a5e7d e: 
>>> java.lang.NullPointerException: Attempt to invoke virtual method 'boolean 
>>> java.lang.String.startsWith(java.lang.String)' on a null object reference
>>> D/Sync    (20024): %s: return false
>>> D/Sync    (20024): 
>>> com.couchbase.lite.support.RemoteRequestRetry$1@c20acd4: RemoteRequestRetry 
>>> failed, non-transient error.  NOT retrying. url: 
>>> http://X.X.X.X/sgdb/MSG%3A64598a8e-b613-4026-8b68-4471d65d0bcd?rev=4-d1da30c8ac590e7875df9823475e3074&revs=true&attachments=true
>>> E/Sync    (20024): Error pulling remote revision
>>> E/Sync    (20024): java.lang.NullPointerException: Attempt to invoke 
>>> virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a 
>>> null object reference
>>> E/Sync    (20024): at 
>>> com.couchbase.lite.support.MultipartDocumentReader.setHeaders(MultipartDocumentReader.java:70)
>>> E/Sync    (20024): at 
>>> com.couchbase.lite.support.RemoteMultipartDownloaderRequest.executeRequest(RemoteMultipartDownloaderRequest.java:95)
>>> E/Sync    (20024): at 
>>> com.couchbase.lite.support.RemoteMultipartDownloaderRequest.run(RemoteMultipartDownloaderRequest.java:48)
>>> E/Sync    (20024): at 
>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
>>> E/Sync    (20024): at 
>>> java.util.concurrent.FutureTask.run(FutureTask.java:237)
>>> E/Sync    (20024): at 
>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
>>> E/Sync    (20024): at 
>>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
>>> E/Sync    (20024): at 
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
>>> E/Sync    (20024): at 
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
>>> E/Sync    (20024): at java.lang.Thread.run(Thread.java:818)
>>> V/Sync    (20024): 
>>> com.couchbase.lite.replicator.PullerInternal@39200f0e: giving up on 
>>> {MSG:64598a8e-b613-4026-8b68-4471d65d0bcd 
>>> #4-d1da30c8ac590e7875df9823475e3074}: java.lang.NullPointerException: 
>>> Attempt to invoke virtual method 'boolean 
>>> java.lang.String.startsWith(java.lang.String)' on a null object reference
>>> V/CBLite  (20024): setPaused: false
>>> D/RemoteRequest(20024): 
>>> com.couchbase.lite.support.RemoteMultipartDownloaderRequest@303d0f41: 
>>> executeRequest() finally
>>> V/ChangeTracker(20024): 
>>> com.couchbase.lite.replicator.ChangeTracker@19153841: got response. status: 
>>> HTTP/1.1 200 OK mode: LongPoll
>>> V/ChangeTracker(20024): 
>>> com.couchbase.lite.replicator.ChangeTracker@19153841: /entity.getContent(). 
>>>  mode: LongPoll
>>> V/ChangeTracker(20024): 
>>> com.couchbase.lite.replicator.ChangeTracker@19153841: readValue
>>>
>>> Note: I have replace the address and bucket name of sync gateway.
>>> id=MSG:64598a8e-b613-4026-8b68-4471d65d0bcd, 
>>> changes=[{rev=4-d1da30c8ac590e7875df9823475e3074 this doc and rev is 
>>> the attachment doc added from SG.
>>>
>>>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/fa26de8b-0673-428d-86d8-20b159518863%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to