404 not_found with todolite

32 views
Skip to first unread message

Ken Novak

unread,
Apr 5, 2016, 11:48:27 AM4/5/16
to Couchbase Mobile
I loaded the sync-gateway and used the simple react tutorial, which works fine.  Then I loaded the ToDoLite iOS app, and ran it in Xcode and Simulator. It worked fine with the default kSyncGatewayUrl of "http://demo-mobile.couchbase.com/todolite" .  Then I tried to run it with my the URL of my sync-gateway, and I see errors in the logs like this:

03:18:54.034| Sync: CBLReplication[from http://cb1.vieulabs.net:4984]: active, progress = 0 / 0, err: (null)
03:18:54.034| Query: CBLLiveQuery[lists]: ...async query finished (5 rows, status 200)
03:18:54.034| Query: CBLLiveQuery[lists]: ...Rows changed! (now 5)
03:18:54.036‖ CBLRemoteJSONRequest[GET http://cb1.vieulabs.net:4984/_session]: Got error Error Domain=CBLHTTP Code=404 "404 not_found" UserInfo={NSURL=http://cb1.vieulabs.net:4984/_session, NSLocalizedFailureReason=not_found, NSLocalizedDescription=404 not_found}
03:18:54.037‖ Sync: CBLRestPuller[http://cb1.vieulabs.net:4984]: Server is (null)

In my sync-gateway-config.json, I have stripped down the config to this (I wasn't sure whether the database was 'todos' or 'todolite' so I did both):

{

  "log":["*"],

  "verbose": true,

  "databases": {

    "todos": {

      "server":"http://couchbase1:8091",

      "users": {"GUEST": {"disabled": false, "all_channels": ["*"], "admin_channels": ["*"]}},

      "sync":`

        function(doc) {

          channel(doc.channels);

        }`

    },

    "todolite": {

      "server":"http://couchbase1:8091",

      "users": {"GUEST": {"disabled": false, "all_channels": ["*"], "admin_channels": ["*"]}},

      "sync":`

        function(doc) {

          channel(doc.channels);

        }`

    }

  }

}


I tried to include the line for   "facebook": { "register": true }, but that failed the same way. I also get the same results from using "server":"walrus:".   Is there a simple way forward?

Jens Alfke

unread,
Apr 5, 2016, 12:00:14 PM4/5/16
to mobile-c...@googlegroups.com

On Apr 5, 2016, at 3:27 AM, Ken Novak <krn...@gmail.com> wrote:

03:18:54.034| Sync: CBLReplication[from http://cb1.vieulabs.net:4984]: active, progress = 0 / 0, err: (null)

Your remote URL is missing the database name (first path component).

—Jens

Ken Novak

unread,
Apr 5, 2016, 1:34:16 PM4/5/16
to Couchbase Mobile
D'oh!  That worked, thanks!

Jens Alfke

unread,
Apr 5, 2016, 2:05:47 PM4/5/16
to mobile-c...@googlegroups.com

> On Apr 5, 2016, at 10:34 AM, Ken Novak <krn...@gmail.com> wrote:
>
> D'oh! That worked, thanks!

You’re not the first (nor the tenth) person that this has happened to :)

We should add a test to CBLReplication to detect this common mistake and return a very descriptive error immediately. I just filed an issue to remind us to do that.

—Jens
Reply all
Reply to author
Forward
0 new messages