How to connect local sync_gateway and couchbase instances?

226 views
Skip to first unread message

Pulkit Singhal

unread,
Feb 8, 2014, 9:03:12 PM2/8/14
to mobile-c...@googlegroups.com
I have followed instructions from http://docs.couchbase.com/sync-gateway/ to the best of my ability.
  1. I'm running couchbase locally on http://localhost:8091
  2. I'm running the adminUImerge2 branch of sync_gateway locally on 4985 (admin) and 4984
  3. I started sync_gateway like so: ./bin/sync_gateway -url http://localhost:8091
  4. In ~/dev/todo-lite/www/js/index.js file, I set: var REMOTE_SYNC_URL = "http://localhost:4984/sync_gateway/"
  5. I took the sync function from sync-gateway-config.json and put it into: http://localhost:4985/_admin/db/sync_gateway/sync
  6. I also made sure that couchbase had a document added to its sync_gateway data-bucket: http://localhost:8091/index.html#sec=documents&bucketName=sync_gateway&documentsPageNumber=0&docId=_sync%3Asyncdata
  7. After running phonegap run ios, I do not see the changes from the ios app reaching over to the database as documents ... at all ... what did I miss?

Any thoughts on why it doesn't work?

Pulkit Singhal

unread,
Feb 9, 2014, 12:01:22 PM2/9/14
to mobile-c...@googlegroups.com
When I first logged in with facebook I saw these logs on the sync_gateway side:
10:57:41.640011 HTTP:  #001: POST /sync_gateway/_revs_diff
10:57:41.640044 HTTP:  #001:     --> 401 Login required
10:57:41.648206 HTTP:  #002: GET /sync_gateway/_changes?feed=normal&heartbeat=300000&style=all_docs&limit=100
10:57:41.648231 HTTP:  #002:     --> 401 Login required
10:57:41.648911 HTTP:  #003: POST /sync_gateway/_revs_diff
10:57:41.648958 HTTP:  #003:     --> 401 Login required

Then I restarted the TodoLite app and saw some diff problems the next time:
10:58:32.149258 HTTP:  #001: GET /_session
10:58:32.149306 HTTP:  #001:     --> 404 unknown URL
10:58:32.151290 HTTP:  #002: GET /sync_gateway/_session
10:58:32.153450 HTTP:  #003: POST /sync_gateway/_facebook
10:58:32.154275 HTTP:  #003:     --> 404 unknown URL
10:58:32.164532 HTTP:  #004: GET /_session
10:58:32.164573 HTTP:  #004:     --> 404 unknown URL
10:58:32.165950 HTTP:  #005: GET /sync_gateway/_session
10:58:32.167287 HTTP:  #006: POST /sync_gateway/_facebook
10:58:32.167716 HTTP:  #006:     --> 404 unknown URL

Jens Alfke

unread,
Feb 9, 2014, 2:08:36 PM2/9/14
to mobile-c...@googlegroups.com

On Feb 9, 2014, at 9:01 AM, Pulkit Singhal <pulkit...@gmail.com> wrote:

10:58:32.153450 HTTP:  #003: POST /sync_gateway/_facebook
10:58:32.154275 HTTP:  #003:     --> 404 unknown URL

This implies you didn't enable Facebook login support in your JSON config file. You need something like
"facebook": {"register": true},

—Jens

Reply all
Reply to author
Forward
0 new messages