I'm a newbie to the entire CouchBase suite.  I've set up CouchBase, 
Sync_Gateway and CouchBase-Lite seemingly successfully.  I can get the 
mobile device to push and pull doc changes (via SG) just fine BUT only if I 
use SG's Admin port (4985).  If I use the REST port (4984) I get nothing.

Here is the SG config file:

root@s1-anithon:~# cat /home/sync_gateway/sync_gateway.json
{

   "inferface": ":4984",
   "adminInterface": ":4985",
   "log": ["REST"],
   "verbose": true,
   "databases": {
      "sync_gateway": {
         "server": "http://127.0.0.1:8091";,
         "bucket": "sync_gateway",
         "sync": `function(doc) {channel(doc.channels);}`
      },
      "gamesim-sample": {
         "server": "http://127.0.0.1:8091";,
         "bucket": "gamesim-sample",
         "sync": `function(doc) {channel(doc.channels);}`
      }
   }

I bring up one terminal window on the server running SG and enter this 
command:

root@s1-anithon:~# curl 
'http://carrjd12:fred11@localhost:4985/sync_gateway/_changes?feed=continuous&style=all_docs&since=0&heartbeat=10000'
{"seq":2,"id":"1cadb7dc-7def-442d-9647-2b2e8ae0ed9f","changes":[{"rev":"2-d036fde157e272025678c59b1469840c"}]}
{"seq":3,"id":"f3a44043-6923-47b0-95e0-2cfe8a2792d7","changes":[{"rev":"2-759cab1a1242ffc36b36b2d7c79f1d62"}]}
...
{"seq":122,"id":"36480aeec3017071cb7181de6fd0e8b8","changes":[{"rev":"1-cd809becc169215072fd567eebd8b8de"}]}
{"seq":123,"id":"c9bb38bcb74cca13dad8c559e012ea41","changes":[{"rev":"1-cd809becc169215072fd567eebd8b8de"}]}


With it listening, I then enter this command in another terminal window

root@s1-anithon:~# curl -v -X POST 
'http://carrjd12:fred11@localhost:4984/sync_gateway/' -d '{"foo": "bar"}' 
-H "Content-Type: application/json"
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 4984 (#0)
* Server auth using Basic with user 'carrjd12'
> POST /sync_gateway/ HTTP/1.1
> Authorization: Basic Y2FycmpkMTI6ZnJlZDEx
> User-Agent: curl/7.35.0
> Host: localhost:4984
> Accept: */*
> Content-Type: application/json
> Content-Length: 14
>
* upload completely sent off: 14 out of 14 bytes
< HTTP/1.1 200 OK
< Content-Length: 94
< Content-Type: application/json
< Etag: 1-cd809becc169215072fd567eebd8b8de
< Location: 594a4e018530e650361ea3b0b7c61e7e
* Server Couchbase Sync Gateway/1.00 is not blacklisted
< Server: Couchbase Sync Gateway/1.00
< Date: Sun, 25 Jan 2015 02:11:53 GMT
<
* Connection #0 to host localhost left intact
{"id":"594a4e018530e650361ea3b0b7c61e7e","ok":true,"rev":"1-cd809becc169215072fd567eebd8b8de"}

Which causes this to appear in the listening terminal window

{"seq":124,"id":"594a4e018530e650361ea3b0b7c61e7e","changes":[{"rev":"1-cd809becc169215072fd567eebd8b8de"}]}

So it works as expected, but I have to use the Admin port to listen on. If 
I switch to the REST port (4984) this is what I get

root@s1-anithon:~# curl 
'http://carrjd12:fred11@localhost:4984/sync_gateway/_changes?feed=continuous&style=all_docs&since=0&heartbeat=10000'
{"seq":117,"id":"_user/carrjd12","changes":[]}



When I go to the other terminal window and enter the same command as 
previously

root@s1-anithon:~# curl -v -X POST 
'http://carrjd12:fred11@localhost:4984/sync_gateway/' -d '{"foo": "bar"}' 
-H "Content-Type: application/json"
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 4984 (#0)
* Server auth using Basic with user 'carrjd12'
> POST /sync_gateway/ HTTP/1.1
> Authorization: Basic Y2FycmpkMTI6ZnJlZDEx
> User-Agent: curl/7.35.0
> Host: localhost:4984
> Accept: */*
> Content-Type: application/json
> Content-Length: 14
>
* upload completely sent off: 14 out of 14 bytes
< HTTP/1.1 200 OK
< Content-Length: 94
< Content-Type: application/json
< Etag: 1-cd809becc169215072fd567eebd8b8de
< Location: 4763b15eccc3686fa1a8da6b74fdd51d
* Server Couchbase Sync Gateway/1.00 is not blacklisted
< Server: Couchbase Sync Gateway/1.00
< Date: Sun, 25 Jan 2015 02:18:45 GMT
<
* Connection #0 to host localhost left intact
{"id":"4763b15eccc3686fa1a8da6b74fdd51d","ok":true,"rev":"1-cd809becc169215072fd567eebd8b8de"}

I get nothing except for a new line in the window listening on port 4984. 
 I checked the database, the document has been added. 

I see examples all over the Internet of people using port 4984 to listen on 
and being successful.  

So what am I not understand or what do I have configured wrong?

-- 
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/50f3e88c-c9b0-4f2c-a5f7-d7d95044ceee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to