Is there a working example of CouchBase Sync-Gateway, which runs locally (iOS)

1,975 views
Skip to first unread message

Andy Fuchs

unread,
Sep 18, 2013, 9:59:13 AM9/18/13
to mobile-c...@googlegroups.com

I tried to find a *working* example of sync-gateway, which runs locally, that is:
- using     "server": "walrus:data"
- iOS simulator (or device)

I couldn't get the ToDo-Lite (PhoneGap-sample) working, since it redirects my to Facebook/cloudbase (I tried post a detailed description here, but it seems I'm blocked - so I posted it to Couchbase Cloud).

I also tried Grocery-Sync Obj-C-sample, which adds documents, but never syncs (neither when I un-reinstall it, nor with another device). Documentation about CDLLiveQuery and the code in Grocery-List are different, so I don't know, if there's something wrong with the documentation or the sample app (or both).

I also tried Couch-Chat (Obj-C), where I can't add a chat-friend, because 
   - on iOS7/XCode 5 I cant add a friend
   - on iOS7/XCode 4.6.3 it crashes hard, if I type in the first character of a friend
   - on iOS6.1/XCode 4.6.3 it crashes hard, after a couple of characters inserted (in the search field)
   - on neither it finds my own Persona-account, so I can't add my second instance.



So I'm lost...

Any hint?

thx

andy

Jens Alfke

unread,
Sep 18, 2013, 10:33:16 AM9/18/13
to mobile-c...@googlegroups.com
On Sep 18, 2013, at 6:59 AM, Andy Fuchs <foxwe...@gmail.com> wrote:

I tried post a detailed description here, but it seems I'm blocked

Sorry; we’ve got the mailing list configured to require moderation for new senders, so there can be a delay (especially since the people with admin privileges are all in GMT-7.) Your messages will go through immediately from now on.

I also tried Grocery-Sync Obj-C-sample, which adds documents, but never syncs (neither when I un-reinstall it, nor with another device). Documentation about CDLLiveQuery and the code in Grocery-List are different, so I don't know, if there's something wrong with the documentation or the sample app (or both).

OK, this app I do know about :)
What steps did you take to configure it to sync? To what URL?
And exactly what happens after you configure sync?

(To get more info you can turn on sync logging — add arguments “-Log YES” and “-LogSync YES”. See the CBL-iOS wiki for details on logging.)
Fixed; thanks.

—Jens


Andy Fuchs

unread,
Sep 18, 2013, 11:15:22 AM9/18/13
to mobile-c...@googlegroups.com
Hi Jens,

thanks for the quick reply. I hope I can ask/answer the right things, because I come from 'regular' db-backends (minus MySQL ;-))

Am 18.09.2013 um 16:33 schrieb Jens Alfke <je...@couchbase.com>:

On Sep 18, 2013, at 6:59 AM, Andy Fuchs <foxwe...@gmail.com> wrote:

I tried post a detailed description here, but it seems I'm blocked

Sorry; we’ve got the mailing list configured to require moderation for new senders, so there can be a delay (especially since the people with admin privileges are all in GMT-7.) Your messages will go through immediately from now on.

Good to hear. I posted the message to Couchbase Cloud first, but no solution yet. 

I also tried Grocery-Sync Obj-C-sample, which adds documents, but never syncs (neither when I un-reinstall it, nor with another device). Documentation about CDLLiveQuery and the code in Grocery-List are different, so I don't know, if there's something wrong with the documentation or the sample app (or both).

OK, this app I do know about :)

Even better ;)

What steps did you take to configure it to sync? To what URL?

I ran sync-gateway using some (what I guess) standard configuration:

"grocery-sync": {
      "server": "walrus:data",
      "users": {
        "GUEST": {"disabled": false}
      },
      "sync": `function(doc) {channel(doc.channels);}`
    },

- I then ran the iOS-project 'as is'.

- On the configuration-page I added my local server (<ip>:4894:/grocery-sync)

- I added a couple of records

- grocery-sync.walrus is generated and I can see the records using curl or httpie (my terminal shows the PUT requests as well - but not always ;( )

- I launched a copy of GrocerySync on my iPhone, did the exact steps as above, but didn't get any record.

- I removed the previously built GrocerySync from Simulator, ran it again from XCode (4.6.3) and configured it as before.
-> No records show up

XCode-console says:
2013-09-18 17:06:04.214 GrocerySync[26983:c07] SYNC progress: 0 / 0
2013-09-18 17:06:04.215 GrocerySync[26983:c07] SYNC progress: 0 / 0
17:06:04.393| Replication: CBL_Pusher[http://192.168.1.69:4984/grocery-sync] took 0.179 sec; error=(null)
2013-09-18 17:06:04.394 GrocerySync[26983:c07] SYNC progress: 0 / 0
17:06:04.396| Replication: CBL_Puller[http://192.168.1.69:4984/grocery-sync] took 0.185 sec; error=(null)

Console.log says:
#001: GET /grocery-sync/_local/0e37d178060474f76d11da351e9585c8322c8134
17:06:04.392111 HTTP:  #002: GET /grocery-sync/_local/88884ea7836fee2ffc08275067be7cc85094a7bb
17:06:04.392116 HTTP:  #001:     --> 404 missing
17:06:04.392138 HTTP:  #002:     --> 404 missing
17:06:04.395405 HTTP:  #003: GET /grocery-sync/_changes?feed=normal&heartbeat=300000&style=all_docs&limit=100


Same happens, if I remove the 'sync' key from config.json.

So I'm currently lost on why it doesn't sync...

Best

andy

BTW:
Looking at the CBLLiverQuery statement in the RootViewController.m, I can't find an observer, as stated in https://github.com/couchbase/couchbase-lite-ios/wiki/Guide%3A-Views#live-queries

[self.liveQuery addObserver: self forKeyPath: @"rows" options: 0 context: NULL];

It's unclear wether this is needed or not. A simple *working* example would help ;-)






And exactly what happens after you configure sync?

(To get more info you can turn on sync logging — add arguments “-Log YES” and “-LogSync YES”. See the CBL-iOS wiki for details on logging.)


Fixed; thanks.

—Jens



--
You received this message because you are subscribed to a topic in the Google Groups "Mobile Couchbase" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/r_QMghYhrkU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jens Alfke

unread,
Sep 18, 2013, 11:26:20 AM9/18/13
to mobile-c...@googlegroups.com

On Sep 18, 2013, at 8:15 AM, Andy Fuchs <foxwe...@gmail.com> wrote:

Looking at the CBLLiverQuery statement in the RootViewController.m, I can't find an observer, as stated in https://github.com/couchbase/couchbase-lite-ios/wiki/Guide%3A-Views#live-queries
[self.liveQuery addObserver: self forKeyPath: @"rows" options: 0 context: NULL];
It's unclear wether this is needed or not. A simple *working* example would help ;-)

The view controller drives its table view with a CBLUITableSource:

    self.dataSource.query = query;

That object  automatically observes the query’s .rows property. All the app has to do is create the query and assign it to the source’s .query property, and the rest is taken care of.

I can add a comment to the code to make this clearer.

—Jens

Andy Fuchs

unread,
Sep 18, 2013, 11:38:00 AM9/18/13
to mobile-c...@googlegroups.com
Yes - adding a couple of comments would definitely help.

Could you reproduce the not-syncing problem? If not, can you tell me your steps to get it to sync (in the sample-app).

andy

Jens Alfke

unread,
Sep 18, 2013, 2:53:10 PM9/18/13
to mobile-c...@googlegroups.com
On Sep 18, 2013, at 8:38 AM, Andy Fuchs <foxwe...@gmail.com> wrote:

Yes - adding a couple of comments would definitely help.

I added more than a couple in my big overhaul this morning :) Thanks for providing the impetus to clean up.

Could you reproduce the not-syncing problem? If not, can you tell me your steps to get it to sync (in the sample-app).

Yeah — there’s a bug that crept into the CBL beta release where the replications it creates aren’t continuous by default, so they just check once and then stop. Workaround is to explicitly set the .continuous property to true. I added the workaround to Grocery Sync and it’s syncing fine. (I’ve also checked the bug fix into CBL.)

—Jens

Andy Fuchs

unread,
Sep 18, 2013, 5:50:47 PM9/18/13
to mobile-c...@googlegroups.com
Hi Jens,

thanks for the fix... I'll check that out tomorrow. (since it's GMT+1 here - I need a beer now :))

I will happily remind you on further clean up ;). I'd even help you to do so - unfortunately I first need to know, how things work ;)

Cheers

andy

Andy Fuchs

unread,
Sep 19, 2013, 9:00:32 AM9/19/13
to mobile-c...@googlegroups.com
Hi Jens,

just cloned the revised project, and I'm sorry to say, but it still doesn't work for me using my local sync-gateway.

BTW: The XCode project has no longer a scheme (not a big problem, but anyway). Also it now requires XCode 5 (otherwise we need to modify the project).


Here are the exact steps:
- I built a clean copy for iOS-Simulator and ran it (it didn't load any docs I added yesterday).
- I added some items. StdOut from sync-gateway is:
13:10:06.976016 HTTP: #005: POST /grocery-sync/_revs_diff 
13:10:06.979743 HTTP: #006: POST /grocery-sync/_bulk_docs 
13:10:06.979997 CRUD: Added doc "32742D6F-9634-4414-A7AC-B075965073E9" / "1-d2110d6f979a924904c31bf8ffae59e5" 
13:10:11.982119 HTTP: #007: PUT /grocery-sync/_local/b889eb3f33ef2bb84d9a5853e31f8147b17af4bb
 - I deleted the app from the Simulator
- I re-ran the app, but it did not find any items
#001:     --> 404 missing
13:09:52.528731 HTTP:  #002: GET /grocery-sync/_local/b889eb3f33ef2bb84d9a5853e31f8147b17af4bb
13:09:52.528747 HTTP:  #002:     --> 404 missing
13:09:52.530793 HTTP:  #003: GET /grocery-sync/_changes?feed=normal&heartbeat=300000&style=all_docs&limit=100
---
- I then built a version for the iPhone5 (device)
- I ran both simulator and device parallely against the same sync-gateway
- I added items to both, but no luck:
13:17:37.843939 HTTP:  #028: GET /grocery-sync/_local/8fce07a677ac1e04937917aa3af885a3fa09819b
13:17:37.843969 HTTP:  #028:     --> 404 missing
13:17:37.844475 HTTP:  #029: GET /grocery-sync/_local/50b5dfe6fb6cf928a92bdf2d288d09388290d962
13:17:37.844495 HTTP:  #029:     --> 404 missing
13:17:37.846729 HTTP:  #030: GET /grocery-sync/_changes?feed=normal&heartbeat=300000&style=all_docs&limit=100
13:17:37.849914 HTTP:  #031: GET /grocery-sync/_changes?feed=longpoll&heartbeat=300000&style=all_docs&limit=100

What am I missing, that it neither sync nor add items to the other device?

The Next step I'll try, is to try to run it against a Cloudbase-Server.

BTW: if I click on 'About Couchbase' im getting to the console.couchbase.com page - which seems to be broken (at least on my iPhone5 iOS7 and also on simulator)

Ideas?

andy

Jens Alfke

unread,
Sep 19, 2013, 10:23:28 AM9/19/13
to mobile-c...@googlegroups.com
On Sep 19, 2013, at 6:00 AM, Andy Fuchs <foxwe...@gmail.com> wrote:

BTW: The XCode project has no longer a scheme (not a big problem, but anyway).

I don’t think it make sense to check in schemes, because they contain user-specific options like command-line arguments. Every time I changed the logging settings Git would show the scheme file as dirty. Xcode should be automatically creating a new scheme for the target the first time you open the project.

Also it now requires XCode 5 (otherwise we need to modify the project).

Hmm … I don’t still have Xcode 4 to test against; what is the issue exactly?

13:09:52.530793 HTTP:  #003: GET /grocery-sync/_changes?feed=normal&heartbeat=300000&style=all_docs&limit=100

What do you get if you load that URL directly, i.e. with curl or httpie? You should get JSON output including an array containing all the document IDs.

You can turn on sync logging in the app by using the scheme settings to add two sets of command-line args, “-Log YES” and “-LogSyncVerbose YES”.

—Jens

Jens Alfke

unread,
Sep 19, 2013, 10:35:47 AM9/19/13
to mobile-c...@googlegroups.com
On Sep 19, 2013, at 6:00 AM, Andy Fuchs <foxwe...@gmail.com> wrote:

Also it now requires XCode 5 (otherwise we need to modify the project).

Oh, it looks like IB in Xcode 5 has the “feature” of changing all your xibs to a format that won’t open with Xcode 4.6. Great. In the past they’ve always defaulted to preserving compatibility and you had to opt into switching to a new format. I’ve set the xibs back to the old format.

BTW: if I click on 'About Couchbase' im getting to the console.couchbase.com page - which seems to be broken (at least on my iPhone5 iOS7 and also on simulator)

The button title is “About Couchbase Cloud”, but I think it got clipped because the font was mistakenly set to bold. Fixed.

The web page just doesn’t seem to be optimized for the small iPhone display; I can let them know about that.

—Jens

Andy Fuchs

unread,
Sep 19, 2013, 1:02:33 PM9/19/13
to mobile-c...@googlegroups.com
Am 19.09.2013 um 16:23 schrieb Jens Alfke <je...@couchbase.com>:

13:09:52.530793 HTTP:  #003: GET /grocery-sync/_changes?feed=normal&heartbeat=300000&style=all_docs&limit=100

What do you get if you load that URL directly, i.e. with curl or httpie? You should get JSON output including an array containing all the document IDs.




You can turn on sync logging in the app by using the scheme settings to add two sets of command-line args, “-Log YES” and “-LogSyncVerbose YES”.


Here's the output. 

2013-09-19 18:56:11.817 GrocerySync[31328:a0b] SYNC progress: 0 / 0
2013-09-19 18:56:11.819 GrocerySync[31328:a0b] SYNC progress: 0 / 0
18:56:11.825| Sync: CBL_Puller[http://192.168.1.69:4984/grocery-sync]: Replicating from lastSequence=(null)
18:56:11.825| SyncVerbose: CBL_Puller[http://192.168.1.69:4984/grocery-sync] starting ChangeTracker: mode=0, since=(null)
18:56:11.825| SyncVerbose: CBLSocketChangeTracker[0xa18e5f0 grocery-sync]: GET //192.168.1.69:4984/grocery-sync/_changes?feed=normal&heartbeat=300000&style=all_docs&limit=100
18:56:11.826| Sync: CBL_Pusher[http://192.168.1.69:4984/grocery-sync]: Replicating from lastSequence=(null)
18:56:11.826| SyncVerbose: CBL_Pusher[http://192.168.1.69:4984/grocery-sync]: Received 0 revs
18:56:11.826| Sync: CBL_Pusher[http://192.168.1.69:4984/grocery-sync]: postProgressChanged (0/0, active=0 (batch=0, net=0), online=1)
2013-09-19 18:56:11.827 GrocerySync[31328:a0b] SYNC progress: 0 / 0
18:56:11.828| Sync: CBL_Puller[http://192.168.1.69:4984/grocery-sync]: Received 0 changes
18:56:11.828| Sync: CBL_Puller[http://192.168.1.69:4984/grocery-sync]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
18:56:11.828| Sync: CBL_Puller[http://192.168.1.69:4984/grocery-sync]: Caught up with changes!
18:56:11.828| Sync: CBL_Puller[http://192.168.1.69:4984/grocery-sync]: postProgressChanged (0/0, active=0 (batch=0, net=0), online=1)
18:56:11.828| SyncVerbose: CBLSocketChangeTracker[0xa18e5f0 grocery-sync]: GET //192.168.1.69:4984/grocery-sync/_changes?feed=longpoll&heartbeat=300000&style=all_docs&limit=100

If I run the query using httpie I'm getting this result:

[1] 31463
[2] 31464
[3] 31465
[2]-  Done                    heartbeat=300000

andy

Jens Alfke

unread,
Sep 19, 2013, 3:09:50 PM9/19/13
to mobile-c...@googlegroups.com

On Sep 19, 2013, at 10:02 AM, Andy Fuchs <foxwe...@gmail.com> wrote:


That didn’t work. Your shell is getting confused because you didn’t wrap the URL in single-quotes. Try again?

18:56:11.828| Sync: CBL_Puller[http://192.168.1.69:4984/grocery-sync]: Received 0 changes
18:56:11.828| Sync: CBL_Puller[http://192.168.1.69:4984/grocery-sync]: postProgressChanged (0/0, active=1 (batch=0, net=1), online=1)
18:56:11.828| Sync: CBL_Puller[http://192.168.1.69:4984/grocery-sync]: Caught up with changes!

CBL didn’t see any changes in the feed.

—Jens

Andy Fuchs

unread,
Sep 19, 2013, 5:15:52 PM9/19/13
to mobile-c...@googlegroups.com
Well - I can see the records in the webinterface, but what me puzzles is:
is it normal, that the log doesn't contain the protocol? (before 'GET')?


Andy

Jens Alfke

unread,
Sep 19, 2013, 5:38:53 PM9/19/13
to mobile-c...@googlegroups.com
On Sep 19, 2013, at 2:15 PM, Andy Fuchs <foxwe...@gmail.com> wrote:

Well - I can see the records in the webinterface, but what me puzzles is:

What web interface? (Sync Gateway doesn’t have one yet.)
Can you please show me the JSON output from curl or httpie?

is it normal, that the log doesn't contain the protocol? (before 'GET')?

Yes, although I can’t remember why I did that. (See CBLSocketChangeTracker.m:94.)

—Jens

Andy Fuchs

unread,
Sep 19, 2013, 6:04:26 PM9/19/13
to mobile-c...@googlegroups.com
Well - I can see the records in the webinterface, but what me puzzles is:

What web interface? (Sync Gateway doesn’t have one yet.)

Sorry - I meant I sent the '_all_docs' request as ADMIN (port 4985) via Safari.. 

Can you please show me the JSON output from curl or httpie?

I attached the whole session as screenshot:
- I set the configuration via the 'Configure' button
- I added records - you see the 'Added doc' log in the terminal window to the right - the 'grocery-sync.walrus' was updated (below the terminal window to the right).

- below the Finder-window is my (very basic) sync-gateway-config.json

- at the very last I send the command through httpie in the console (left). -> no results? Why?

Where is my error?

best

andy


Jens Alfke

unread,
Sep 19, 2013, 11:50:15 PM9/19/13
to mobile-c...@googlegroups.com

On Sep 19, 2013, at 3:04 PM, Andy Fuchs <foxwe...@gmail.com> wrote:

- at the very last I send the command through httpie in the console (left). -> no results? Why?

I don’t know; something weird is going on. I can see from your sync_gateway console output that docs have been written to the database, but the _changes feed shows nothing at all, which is wrong.

Two more thing to examine, please: 

(This returns an HTML table so it’s only really readable in a browser. Attaching the HTML source to a reply would be more efficient than a screenshot.)
This shows a dump of the contents of the “*” (global) channel. 

(And this dumps the contents of the Couchbase view that’s used to generate the channel, also as an HTML table.)

Sorry about the bother, and thanks for helping troubleshoot this. I have no idea why you’re running into this when it hasn’t shown up before.

—Jens

Traun Leyden

unread,
Sep 20, 2013, 12:00:19 AM9/20/13
to mobile-c...@googlegroups.com
As a sanity check, it might make sense to test against our new Couchbase Cloud developer sandbox:


Btw diid we forget to announce this on the google group?


--
You received this message because you are subscribed to the Google Groups "Mobile Couchbase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.

Paul Capestany

unread,
Sep 20, 2013, 2:16:35 AM9/20/13
to mobile-c...@googlegroups.com
I was wondering the same thing. I think the only time you guys have mentioned CouchbaseCloud so far was at the conference a couple days ago

Andy Fuchs

unread,
Sep 20, 2013, 5:57:34 AM9/20/13
to mobile-c...@googlegroups.com
Hi Jens,

you're very welcome.

I will happily test anything needed to get the problems resolved, so don't hesitate asking.

First of all - here are the requested dumps:

/grocery-sync: “*” Channel

Since = 0

SeqDocRevFlags
281A9C291-79AF-4EF0-BC42-91C5B219BD217-f401adc79cb21246708bbb35a3e631aa00000000
354470537-834E-4C82-BB40-C89C53A9C1D83-5db72ab5c3eed4cb55cde85227079eb100000000
40165E947-FEAD-472C-A26B-0CFFFB583BF31-6e72a4bb819b291fee5ba782e4cfe9cb00000000
51164C751-521A-41B3-AE55-1D17E244C0B31-da381153d72cd35ea4f3389ad8e8737600000000
640D537D1-C09B-4B83-A3D4-9B5E4879530E5-7b7f5f281a4a18956e5d896927e4d66700000000
70648DE6C-478C-4214-8B1E-40D48784079E1-39c276e9d8dda114f67a9ecfa5bdac2e00000000
8B6DEC277-79C5-4F5F-9CCC-675B45C792131-0000e983a18f8a9eb03d6ee3085e1a8600000000
96E2BC79D-CE2A-4E83-BD04-461264B65A9F1-6359e561879b2b1f38742ff4408c7d0c00000000
1032742D6F-9634-4414-A7AC-B075965073E91-d2110d6f979a924904c31bf8ffae59e500000000
11D176217C-6114-4B0E-ABD5-01F2AFA4D9411-d8d5f272808f9d4972022298428e008b00000000
1233926010-0B36-4ECB-8644-06B8416B62BB1-839671c54c8631aeb108687d6a8779a600000000
1388064C11-FDC7-4593-88B1-1650728DA9BB1-12028ba36fc23e2dd956242368d113cf00000000
14E0264B40-D64A-4D2D-ABC9-6FC7625986841-9155c0a221cf8c5dbf402a9c55eb08ee00000000
15362062B6-586C-48A4-BD8B-0AD8F357E1751-5ade49b1aa25c47f05db5a221f28272900000000

/grocery-sync: “channels” View

KeyValueID
["*",2]["81A9C291-79AF-4EF0-BC42-91C5B219BD21","7-f401adc79cb21246708bbb35a3e631aa"]81A9C291-79AF-4EF0-BC42-91C5B219BD21
["*",3]["54470537-834E-4C82-BB40-C89C53A9C1D8","3-5db72ab5c3eed4cb55cde85227079eb1"]54470537-834E-4C82-BB40-C89C53A9C1D8
["*",4]["0165E947-FEAD-472C-A26B-0CFFFB583BF3","1-6e72a4bb819b291fee5ba782e4cfe9cb"]0165E947-FEAD-472C-A26B-0CFFFB583BF3
["*",5]["1164C751-521A-41B3-AE55-1D17E244C0B3","1-da381153d72cd35ea4f3389ad8e87376"]1164C751-521A-41B3-AE55-1D17E244C0B3
["*",6]["40D537D1-C09B-4B83-A3D4-9B5E4879530E","5-7b7f5f281a4a18956e5d896927e4d667"]40D537D1-C09B-4B83-A3D4-9B5E4879530E
["*",7]["0648DE6C-478C-4214-8B1E-40D48784079E","1-39c276e9d8dda114f67a9ecfa5bdac2e"]0648DE6C-478C-4214-8B1E-40D48784079E
["*",8]["B6DEC277-79C5-4F5F-9CCC-675B45C79213","1-0000e983a18f8a9eb03d6ee3085e1a86"]B6DEC277-79C5-4F5F-9CCC-675B45C79213
["*",9]["6E2BC79D-CE2A-4E83-BD04-461264B65A9F","1-6359e561879b2b1f38742ff4408c7d0c"]6E2BC79D-CE2A-4E83-BD04-461264B65A9F
["*",10]["32742D6F-9634-4414-A7AC-B075965073E9","1-d2110d6f979a924904c31bf8ffae59e5"]32742D6F-9634-4414-A7AC-B075965073E9
["*",11]["D176217C-6114-4B0E-ABD5-01F2AFA4D941","1-d8d5f272808f9d4972022298428e008b"]D176217C-6114-4B0E-ABD5-01F2AFA4D941
["*",12]["33926010-0B36-4ECB-8644-06B8416B62BB","1-839671c54c8631aeb108687d6a8779a6"]33926010-0B36-4ECB-8644-06B8416B62BB
["*",13]["88064C11-FDC7-4593-88B1-1650728DA9BB","1-12028ba36fc23e2dd956242368d113cf"]88064C11-FDC7-4593-88B1-1650728DA9BB
["*",14]["E0264B40-D64A-4D2D-ABC9-6FC762598684","1-9155c0a221cf8c5dbf402a9c55eb08ee"]E0264B40-D64A-4D2D-ABC9-6FC762598684
["*",15]["362062B6-586C-48A4-BD8B-0AD8F357E175","1-5ade49b1aa25c47f05db5a221f282729"]362062B6-586C-48A4-BD8B-0AD8F357E175


I would also like to try out the console.couchbase.com, but I still can't create a sync-gateway on the site -> the green '+ New Sync Gateway' simply does nothing! (a short how-to would also be helpful here ;-))

andy


Andy Fuchs

unread,
Sep 20, 2013, 5:59:50 AM9/20/13
to mobile-c...@googlegroups.com
Am 20.09.2013 um 06:00 schrieb Traun Leyden <traun....@gmail.com>:

As a sanity check, it might make sense to test against our new Couchbase Cloud developer sandbox:


As I just mentioned in my previous post: I would really like to try that out, but the green button in the dashboard simply doesn't work for me (and I read the same problem exists for others).


Btw diid we forget to announce this on the google group?

Seems so ;)

andy

Paul Capestany

unread,
Sep 20, 2013, 6:59:56 AM9/20/13
to mobile-c...@googlegroups.com
@Andy — this isn't something you probably shoulda anticipated, but have you tried changing the name of the couchbasecloud database and the database url you're syncing to? "grocery-sync" will not work because it already exists on couchbasecloud (see → https://github.com/couchbaselabs/consolio/issues/2)... but any sufficiently unique variation of that *should* work


--
You received this message because you are subscribed to a topic in the Google Groups "Mobile Couchbase" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/r_QMghYhrkU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.

Andy Fuchs

unread,
Sep 20, 2013, 7:27:55 AM9/20/13
to mobile-c...@googlegroups.com
Hi Paul,

interesting - didn't think about that

OK - now choosing another name lets me create a sync-gateway... 
- I Copied the new address into the configuration-field.
- Still no luck synching:
Error syncing
412 file_exists

Steps:
- Created a fresh database in the dashboard (named it 'grocery-synctwo')
- Launched the app
- added a record
-> Error 412

----

-> OK now I got it to work: 
Steps:
- Deleted 'grocery-synctwo'
- Re-created 'grocery-synctwo'
- Re-ran the app
- Works!

But I can't access the admin-area: - neither in Safari, nor Chrome Canary nor httpie:

HTTP/1.1 403 Forbidden
Content-Length: 3
Content-Type: text/plain; charset=utf-8
Date: Fri, 20 Sep 2013 11:25:17 GMT

NO

So I can't peek what's in there...

andy

Andy Fuchs

unread,
Sep 20, 2013, 7:45:50 AM9/20/13
to mobile-c...@googlegroups.com
Hi Jens,

you're very welcome.

I will happily test anything needed to get the problems resolved, so don't hesitate asking.

First of all - here are the requested dumps:

/grocery-sync: “*” Channel

Andy Fuchs

unread,
Sep 20, 2013, 7:48:36 AM9/20/13
to mobile-c...@googlegroups.com
OK - sending again, because sending from Mail doesn't seem to work for this:

Paul Capestany

unread,
Sep 20, 2013, 3:50:15 PM9/20/13
to mobile-c...@googlegroups.com
Yeah, looks like the "ADMIN Access URL" on CouchbaseCloud doesn't work currently.

As long as you don't lock down access control with your sync function though, you can still see stuff like so:


It seems like there are no docs in there currently though! Here is what it should look like when you've got docs properly syncing:

Kevin Nelson

unread,
Dec 9, 2014, 8:09:05 PM12/9/14
to mobile-c...@googlegroups.com
Did this ever get resolved?

I suspect that I'm running into some similar issues, if not the exact same ones.

I have a local instance of Couchbase Server running, as well as Couchbase Sync Gateway, and I'm trying to run the iOS and Mac OS X demos and get them to sync with each other as well as Couchbase Server.

So far, I have data from each app making it to Couchbase Server successfully, and I was able to see all of the relevant document IDs in the _dump html pages.  The problem is that items added in the iOS demo aren't showing up in the OS X demo, and vice versa.

I'm not sure what else to check.. maybe it's an issue with the query?

Thanks,
Kevin

Jens Alfke

unread,
Dec 9, 2014, 8:43:01 PM12/9/14
to mobile-c...@googlegroups.com
On Dec 9, 2014, at 5:09 PM, Kevin Nelson <ke...@rkn.la> wrote:

I have a local instance of Couchbase Server running, as well as Couchbase Sync Gateway, and I'm trying to run the iOS and Mac OS X demos and get them to sync with each other as well as Couchbase Server.

We don't have any Mac OS demo app. Are you trying to run the test apps that are targets that can be built from the Couchbase Lite project? Those are really just there as hosts to run unit tests, not as supported demo apps. Please don't use them.

More importantly, they're not the same app. They don't interoperate with each other, and each one is going to ignore the other's documents. This is probably what you're seeing.

Please refer to our list of supported demo apps, instead.

—Jens

Kevin Nelson

unread,
Dec 9, 2014, 9:02:22 PM12/9/14
to mobile-c...@googlegroups.com
Well, that definitely explains a lot.  I might recommend renaming the files.  I do see that the target says, for example, "CBL Mac Test", but the group and file names do say Demo.

I'm glad to steer my explorations elsewhere, but I'm curious, what's preventing them from interoperating and seeing each other's documents? I had updated the `DemoDatabase` field in the OS X app to match the database string hardcoded into the iOS, and explored the codebase a good bit to try to figure out what was going on before posting, and everything (including the data that made it into my local Couchbase Server) looked like it matched up.


In light of the changed expectation (that those two targets _shouldn't_ be able to interoperate with one another), I've also tried running the Grocery Sync app both in a simulator and on iOS against my local Couchbase Sync Gateway, and I can see requests coming in, but again, data from one list isn't pushing to the other.  Am I mistaken in expecting this setup to auto-update, similar to websocket pushes in website?

Thanks,
Kevin




--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/r_QMghYhrkU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.

Jens Alfke

unread,
Dec 10, 2014, 1:13:38 AM12/10/14
to mobile-c...@googlegroups.com

> On Dec 9, 2014, at 6:01 PM, Kevin Nelson <ke...@rkn.la> wrote:
>
> Well, that definitely explains a lot. I might recommend renaming the files. I do see that the target says, for example, "CBL Mac Test", but the group and file names do say Demo.

True. But few enough people get started building from source that it hasn't been an issue for a long time.

> In light of the changed expectation (that those two targets _shouldn't_ be able to interoperate with one another), I've also tried running the Grocery Sync app both in a simulator and on iOS against my local Couchbase Sync Gateway, and I can see requests coming in, but again, data from one list isn't pushing to the other. Am I mistaken in expecting this setup to auto-update, similar to websocket pushes in website?

Yes, changes you make in one app should almost immediately appear in the other.

The usual issue when this happens is that the Gateway wasn't configured to give the guest user access to all channels. Without that, no client will be able to see any documents in the Gateway.

(tl;dr: Start the Gateway with the config file in examples/admin_party.json.)

—Jens

Kevin Nelson

unread,
Dec 10, 2014, 6:54:11 AM12/10/14
to mobile-c...@googlegroups.com

On Wed, Dec 10, 2014 at 7:13 AM, Jens Alfke <je...@mooseyard.com> wrote:
(tl;dr: Start the Gateway with the config file in examples/admin_party.json.)

This was the ticket.  I had `"admin_channels": ["public"]` rather than `"admin_channels": ["*"]`.

FWIW, I'm also now able to see changes propagate to and from the Mac OS X test app.

Thanks a bunch for your help!

Kevin

Jens Alfke

unread,
Dec 10, 2014, 11:34:26 AM12/10/14
to mobile-c...@googlegroups.com

On Dec 10, 2014, at 3:53 AM, Kevin Nelson <ke...@rkn.la> wrote:

Thanks a bunch for your help!

You're welcome! I think your troubles highlight a couple of glitches in our out-of-the-box experience, so we'll try to smooth those out.

—Jens
Reply all
Reply to author
Forward
0 new messages