Issue (ANN: Couchbase Mobile 1.1 Preview Release android) : Attachments are not pushing to sever from local device

61 views
Skip to first unread message

PRASANNA KUMAR

unread,
Jun 8, 2015, 2:12:56 AM6/8/15
to mobile-c...@googlegroups.com
Hi There,

I started to working new and andriod CBL libraries(ANN: Couchbase Mobile 1.1 Preview Release) Where i faced very big issue regarding attachments.

Description : 

          When i create the new documents with attachments, that attachments are not pushing to server from local device but still local device alive all the attachments.


Thanks

Jens Alfke

unread,
Jun 8, 2015, 11:38:15 AM6/8/15
to mobile-c...@googlegroups.com
Hmm. You’ll need to give us more details.

• The documents themselves don’t sync to the server either, right? (It would be pretty much impossible for a document to sync without its attachments.)

• How did you set up replication?

• How did you check whether the documents exist on the server?

• Have you checked for log messages or error notifications? Are you sure the sync isn’t failing?

—Jens

PRASANNA KUMAR

unread,
Jun 9, 2015, 2:17:47 AM6/9/15
to mobile-c...@googlegroups.com
Hmm, I'll provide those details

• The documents themselves don’t sync to the server either, right? 

My document contains both normal text and attachments but when i create new document it is creating document with attachments in local device but while pushing to server it is removing the attachments it is pushing only normal text(But i'm pretty sure that local document contains an attachments) the actual problem is only pushing to server

• How did you set up replication?

Replication pullReplication = database.createPullReplication(syncUrl);

pullReplication.setContinuous(true);


Replication pushReplication = database.createPushReplication(syncUrl);

pushReplication.setContinuous(true);


pullReplication.start();

pushReplication.start();


• How did you check whether the documents exist on the server? 


 That i can say by using some javascript view and query or normal way we can take local document id(which is newly  created) and with help this document id we can search  in server.

This how i did.


• Have you checked for log messages or error notifications? Are you sure the sync isn’t failing? 


I'm not sure about that.Just i was tested with (ANN: Couchbase Mobile 1.1 Preview Release android) after that i faced very major issue about attachments(In my project attachments are the key role) so that i migrate my project old version only


Note: Do you want more any other information please let me know i can provide those details


Thanks

Jens Alfke

unread,
Jun 9, 2015, 2:28:51 AM6/9/15
to mobile-c...@googlegroups.com

> On Jun 8, 2015, at 11:17 PM, PRASANNA KUMAR <prasannak...@gmail.com> wrote:
>
> My document contains both normal text and attachments but when i create new document it is creating document with attachments in local device but while pushing to server it is removing the attachments it is pushing only normal text(But i'm pretty sure that local document contains an attachments) the actual problem is only pushing to server

I’d be very surprised if a document got replicated without its attachments. They’re always sent together. Can you show an example?

> That i can say by using some javascript view and query or normal way we can take local document id(which is newly created) and with help this document id we can search in server.

I’m not sure what that means. What API exactly are you using to look at the documents? You should avoid accessing the Sync Gateway’s bucket directly using Couchbase Server APIs; the results are probably not going to look like what you expect. (For example, Couchbase Server doesn’t support attachments at all, so you’re definitely not going to see attachments that way.) Use the Sync Gateway’s REST API to work with documents on the server.

—Jens

PRASANNA KUMAR

unread,
Jun 9, 2015, 5:01:41 AM6/9/15
to mobile-c...@googlegroups.com
> Attachments are missing in this document (When i was using ANN: Couchbase Mobile 1.1 Preview Release android). Even i've tested updating same document many times but attachments are not pushing to server database


> After  migrate to my CBL Liibraris(1.0.4) than i've updated same documents with attachments than it is pushing to server database

Jens Alfke

unread,
Jun 9, 2015, 12:30:55 PM6/9/15
to mobile-c...@googlegroups.com
On Jun 9, 2015, at 2:01 AM, PRASANNA KUMAR <prasannak...@gmail.com> wrote:

> Attachments are missing in this document (When i was using ANN: Couchbase Mobile 1.1 Preview Release android). Even i've tested updating same document many times but attachments are not pushing to server database


There definitely aren’t any attachments there. But it looks as though they never got added since there is no “_attachments” metadata property. Where did you get that JSON from? Client or server?

My guess is that somehow the attachments didn’t get created in the first place on the client app. Which sounds like it might be a bug in CBL 1.1. But you’re saying that they did get created; can you add some tests in your code to check that?

—Jens

PRASANNA KUMAR

unread,
Jun 10, 2015, 2:47:23 AM6/10/15
to mobile-c...@googlegroups.com
The above one is server document.

Fine,I'll provide more details.

Again I've created new document.

This is server database document infomation(I got this JSON formate in server database) so it doesn't contain any attachments


This is client database document information so we can observer here it contain attachments information, mean that this document has the attachments


Note:

When creating document with attachments i'm able seeing some logs(Exception) here,it may help us solve this problem


-Prasanna

Jens Alfke

unread,
Jun 10, 2015, 12:49:36 PM6/10/15
to mobile-c...@googlegroups.com

On Jun 9, 2015, at 11:47 PM, PRASANNA KUMAR <prasannak...@gmail.com> wrote:

When creating document with attachments i'm able seeing some logs(Exception) here,it may help us solve this problem


Oh! Yes, if exceptions are being thrown it indicates something is definitely going wrong — it would have been quicker to say that right away. Please file a bug report.

—Jens

Hideki Itakura

unread,
Jun 10, 2015, 6:01:43 PM6/10/15
to mobile-c...@googlegroups.com
Hi PRASANNA,

We tested sync with attachment using https://github.com/couchbaselabs/TodoLite-Android. And it works.
Could you please check if your codes follow the way we support attachment?

Thanks,
Hideki

PRASANNA KUMAR

unread,
Jun 11, 2015, 3:31:36 AM6/11/15
to mobile-c...@googlegroups.com
Hi Hideki Itakura,

I'm using same api but i facing same problem!!!
Is this wrong?First i'm creating document than i'm updating attachments to same document.

I'm following same procedure for older version CBL  libraries(1.0.4) it is working for me and every think is good. But if i use ANN: Couchbase Mobile 1.1 Preview Release android there is some problem for me.

Could you please help me how we can solve this problem

-Prasanna

Hideki Itakura

unread,
Jun 12, 2015, 12:31:57 PM6/12/15
to mobile-c...@googlegroups.com
Hi PRASANNA,

Could you please paste code snippet that stores the attachment.

If you see any Error message or Exceptions, please paste them. You can get log message through logcat.


To enable all log message, please add following codes before initiating Manager instance.
```
Manager.enableLogging(TAG, Log.VERBOSE); Manager.enableLogging(Log.TAG, Log.VERBOSE); Manager.enableLogging(Log.TAG_SYNC_ASYNC_TASK, Log.VERBOSE); Manager.enableLogging(Log.TAG_SYNC, Log.VERBOSE); Manager.enableLogging(Log.TAG_QUERY, Log.VERBOSE); Manager.enableLogging(Log.TAG_VIEW, Log.VERBOSE); Manager.enableLogging(Log.TAG_DATABASE, Log.VERBOSE);
```

Thanks!
Hideki

PRASANNA KUMAR

unread,
Jun 29, 2015, 2:58:29 AM6/29/15
to mobile-c...@googlegroups.com
Hi All,

Now, that attachment is solved for me with help new verion 1.1.0 CBL.

Thank you all for being support.
Reply all
Reply to author
Forward
0 new messages