I'm not getting something correct.  So let me try to explain everything I'm 
doing and see where I am going wrong.

My android code is the following:

>     

   ```   

>     private static final String SYNC_URL = 
> "http://sync.couchbasecloud.com/mydb/";;
>     private static final String SYNC_ACCOUNT = "milt";
>     private static final String SYNC_PASSWORD = "milt";
>     URL url = new URL(SYNC_URL);
>     Replication push = database.createPushReplication(url);
>     Replication pull = database.createPullReplication(url);
>     Authenticator auth = new BasicAuthenticator(SYNC_ACCOUNT, 
> SYNC_PASSWORD);
>     push.setAuthenticator(auth);
>     pull.setAuthenticator(auth);
>     push.start();
>     pull.start();

```

I have setup in the couchbasecloud the sync function
```

> {
>     "interface":":4984",
>     "adminInterface":":4985",
>     "log":["REST"],
>     "databases":{
>     "mydb":{
>         "server":"http://localhost:8091";,
>    "users": {"GUEST":{"disabled" :false},
> "milt":{"password" : "milt"}
> },
>         "bucket":"sync_gateway",
>         "sync":`function(doc) {channel(doc.channels);}`
>     }
> }

```

When I run the code in the android app, I get the following errors:
```

> 07-15 14:00:22.328 E/RemoteRequest﹕ Got error status: 401 for 
> org.apache.http.client.methods.HttpGet@41700d78.  Reason: Unauthorized
> 07-15 14:00:22.335 E/RemoteRequest﹕ Got error status: 401 for 
> org.apache.http.client.methods.HttpGet@41601420.  Reason: Unauthorized
> 07-15 14:00:22.406 E/Sync﹕ 
> com.couchbase.lite.replicator.Replication$4@417008d0: Session check failed
>     org.apache.http.client.HttpResponseException: Unauthorized
>             at 
> com.couchbase.lite.support.RemoteRequest.executeRequest(RemoteRequest.java:229)
>             at 
> com.couchbase.lite.support.RemoteRequest.run(RemoteRequest.java:106)
>             at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
>             at 
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
>             at java.util.concurrent.FutureTask.run(FutureTask.java:137)
>             at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
>             at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
>             at java.lang.Thread.run(Thread.java:856)
> 07-15 14:00:22.414 E/Sync﹕ 
> Puller@416da910[http://sync.couchbasecloud.com/mydb/]: Progress: set error 
> = org.apache.http.client.HttpResponseException: Unauthorized
> 07-15 14:00:22.476 E/Sync﹕ 
> com.couchbase.lite.replicator.Replication$4@41615930: Session check failed
>     org.apache.http.client.HttpResponseException: Unauthorized
>             at 
> com.couchbase.lite.support.RemoteRequest.executeRequest(RemoteRequest.java:229)
>             at 
> com.couchbase.lite.support.RemoteRequest.run(RemoteRequest.java:106)
>             at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
>             at 
> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
>             at java.util.concurrent.FutureTask.run(FutureTask.java:137)
>             at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
>             at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
>             at java.lang.Thread.run(Thread.java:856)
> 07-15 14:00:22.492 E/Sync﹕ 
> Pusher@416d6db8[http://sync.couchbasecloud.com/mydb/]: Progress: set error 
> = org.apache.http.client.HttpResponseException: Unauthorized

```

I must be doing something incorrectly.  Please help.

Thanks, Milt






On Monday, July 14, 2014 4:49:36 PM UTC-7, Jens Alfke wrote:
>
>
> On Jul 14, 2014, at 4:32 PM, Milt Grinberg <[email protected] 
> <javascript:>> wrote: 
>
> > I am trying to connect to the couchbasecloud (i.e., 
> > http://sync.couchbasecloud.com/mydbname 
> … 
> > What should I be entering in the dialog box and/or how do I setup a 
> login for use while testing the use of sync-gateway and the couchbasecloud. 
>
> That’s a URL for the sync API, i.e. what a mobile app would be connecting 
> to to sync with the server. The credentials to provide there are those for 
> any user account you created in your Sync Gateway instance (by doing a PUT 
> to /mydbname/username at the admin access URL.) 
>
> Also, a web browser’s not a good tool for trying out the API. curl or 
> httpie would be better. 
>
> —Jens

-- 
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/ff78bb92-25ee-45b5-a1e4-348a50b0cfd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to