Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

peer-to-peer replication not working #91

Open
nandanshanubhag opened this issue Feb 12, 2017 · 15 comments
Open

peer-to-peer replication not working #91

nandanshanubhag opened this issue Feb 12, 2017 · 15 comments
Assignees
Labels

Comments

@nandanshanubhag
Copy link

nandanshanubhag commented Feb 12, 2017

Hi @pasin

I'm getting the same problem as #989

The issue seems to be fixed in android but i'm using this phonegap plugin in my ionic app and i'm getting the error

I'm manually typing the IP address of the device to which I'm connecting and replicating, but on the other device I'm getting a 406 and no replication takes place

am I doing anything wrong?

@pasin
Copy link
Contributor

pasin commented Feb 18, 2017

What version of the plugin are you using? and What are two devices that you are syncing?

@nandanshanubhag
Copy link
Author

@pasin
Thanks for the reply.

i'm using version 1.3.1 and tested on LG Nexus 5 and MI note 4

and i'm using the swagger-client and couchbase lite spec which i found here

i have set the allowed credentials to allowedCredentials = new Credentials("","");

with sync gateway it works properly, but when i try to replicate p2p i don't see any change or any replication happening

i get the following error in my logcat
cblite error2

@pasin
Copy link
Contributor

pasin commented Feb 20, 2017

@hideki could this be fixed in 1.4?

@hideki
Copy link

hideki commented Feb 20, 2017

@nandanshan,
I believe this issue was already fixed with 1.4.x. And our QA tested p2p scenarios between iOS and Android, also between Android and Android. Version 1.4.0 PhoneGap build is not ready yet. So can you manually update Jar files? 1.4-44 is Developer build.

@nandanshanubhag
Copy link
Author

@pasin & @hideki,

Thanks for the help.
I followed the instructions and the issues is solved. I'm able to sync documents now.

but now,I ran into another issue. The documents which contains images as attachments are not syncing where as documents which do not have attachments are getting synced across peer to peer.

After searching for some time I came to know that the router can't handle multipart data, and the issues is still open

is there any fix for this? or what can be an alternate solution for this?

@hideki
Copy link

hideki commented Feb 22, 2017

Hi @nandanshan,

Let me understand better. Are you developing P2P app between Android and Android? or Android and iOS?

@hideki
Copy link

hideki commented Feb 22, 2017

Hi @sethrosetter,
Does P2P functional test cover P2P with an attachment?

@sethrosetter
Copy link

It does not at the moment. We have a ticket to implement them couchbaselabs/mobile-testkit#777

@nandanshanubhag
Copy link
Author

Hi @hideki,

I'm currently developing P2P app between Android to Android

As my previous question, is there any solution?

@hideki
Copy link

hideki commented Feb 23, 2017

As my previous question, is there any solution?

I don't know any workaround for this issue. We need to reproduce this issue internally first.

@hideki
Copy link

hideki commented Feb 27, 2017

The issue is fixed with 1.4.x release. Also our QA verified it.
https://github.com/couchbase/couchbase-lite-android/issues/989

@hideki
Copy link

hideki commented Feb 27, 2017

@nandanshan

1.4.0 PhoneGap is not released yet.

Please download RC jar files from the following link, and replace the library with the version you are using now.
http://files.couchbase.com/maven2/com/couchbase/lite/couchbase-lite-android/1.4-44/
http://files.couchbase.com/maven2/com/couchbase/lite/couchbase-lite-java-core/1.4-44/

@hideki hideki closed this as completed Feb 27, 2017
@raghusarangapani
Copy link

I tested peer to peer replication with and without attachments on the latest 1.4 builds. I used net-mono/SQLite and macosx/SQLite as the clients.

@raghusarangapani
Copy link

raghusarangapani commented Feb 28, 2017

I re-tested peer to peer replication with attachment between net-mono and android device. Without attachment, replication works fine. With attachment, replication does not work. I see the below trace in the logs:

02-27 15:46:47.456  2492  2534 W Router  : Router unable to route request to do_PUT_Document
02-27 15:46:47.456  2492  2534 W Router  : java.lang.reflect.InvocationTargetException
02-27 15:46:47.456  2492  2534 W Router  : 	at java.lang.reflect.Method.invoke(Native Method)
02-27 15:46:47.456  2492  2534 W Router  : 	at com.couchbase.lite.router.Router.start(Router.java:560)
02-27 15:46:47.456  2492  2534 W Router  : 	at com.couchbase.lite.listener.LiteServlet.service(LiteServlet.java:147)
02-27 15:46:47.456  2492  2534 W Router  : 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
02-27 15:46:47.456  2492  2534 W Router  : 	at Acme.Serve.Serve$ServeConnection.runServlet(Serve.java:2408)
02-27 15:46:47.456  2492  2534 W Router  : 	at Acme.Serve.Serve$ServeConnection.parseRequest(Serve.java:2330)
02-27 15:46:47.456  2492  2534 W Router  : 	at Acme.Serve.Serve$ServeConnection.run(Serve.java:2110)
02-27 15:46:47.456  2492  2534 W Router  : 	at Acme.Utils$ThreadPool$PooledThread.run(Utils.java:1238)
02-27 15:46:47.456  2492  2534 W Router  : 	at java.lang.Thread.run(Thread.java:761)
02-27 15:46:47.456  2492  2534 W Router  : Caused by: com.couchbase.lite.CouchbaseLiteException, Status: 406 (HTTP 406 not_acceptable)
02-27 15:46:47.456  2492  2534 W Router  : 	at com.couchbase.lite.router.Router.getBodyAsDictionary(Router.java:247)
02-27 15:46:47.456  2492  2534 W Router  : 	at com.couchbase.lite.router.Router.do_PUT_Document(Router.java:2364)
02-27 15:46:47.456  2492  2534 W Router  : 	... 9 more

It seems like android listener is not handling the multipart request.

@hideki
Copy link

hideki commented Feb 28, 2017

@raghusarangapani
This is a different issue with https://github.com/couchbase/couchbase-lite-android/issues/989. Could you also file the ticket to couchbase-lite-java-core? Functional test information could help to debug the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants