Grocery sync with local sync gateway


#1

Hi,

just started with the grocery example and the default server works fine … but not my local sync gateway.

I can see in the sync log that the app tries to connect and the Couchbase shows three documents after the connect in the grocery-sync bucket.

The App shows the Error “Error syncing” 404 not found.

What is missing?

Greetings,

Ralf

P.S. App NSLog …

2014-12-13 17:05:43.534 GrocerySync[2024:3723302] SYNC idle
2014-12-13 17:05:43.535 GrocerySync[2024:3723302] SYNC idle
2014-12-13 17:05:43.535 GrocerySync[2024:3723302] Application windows are expected to have a root view controller at the end of application launch
17:05:43.582‖ WARNING: CBLSocketChangeTracker[0x7b72dcd0 ]: Can’t connect, giving up: Error Domain=CBLHTTP Code=404 “404 not_found” UserInfo=0x7bd3d900 {NSURL=http://localhost:4984/_changes?feed=normal&heartbeat=300000&style=all_docs, NSLocalizedFailureReason=not_found, NSLocalizedDescription=404 not_found}
2014-12-13 17:05:43.590 GrocerySync[2024:3723302] SYNC progress: 0 / 0
2014-12-13 17:05:43.592 GrocerySync[2024:3723302] SYNC progress: 0 / 0
2014-12-13 17:05:43.592 GrocerySync[2024:3723302] SYNC progress: 0 / 0
2014-12-13 17:05:43.592 GrocerySync[2024:3723302] ALERT: Error syncing

404 not_found (error=Error Domain=CBLHTTP Code=404 “404 not_found” UserInfo=0x7bd40190 {NSURL=http://localhost:4984/_revs_diff, NSLocalizedFailureReason=not_found, NSLocalizedDescription=404 not_found})
2014-12-13 17:05:43.624 GrocerySync[2024:3723302] SYNC idle
2014-12-13 17:05:43.625 GrocerySync[2024:3723302] ALERT: Error syncing

404 not_found (error=Error Domain=CBLHTTP Code=404 “404 not_found” UserInfo=0x7bd3d900 {NSURL=http://localhost:4984/_changes?feed=normal&heartbeat=300000&style=all_docs, NSLocalizedFailureReason=not_found, NSLocalizedDescription=404 not_found})
2014-12-13 17:06:11.076 GrocerySync[2024:3723543] Terminating since there is no system app.


#2

Hello @lobequadrat,

If you have both your Sync Gateway and Server running locally on your machine with the “grocery-sync” bucket created, then try changing the “kServerDbURL” value in your ‘DemoAppDelegate.m’ file to include the hostname/address and port of the Sync Gateway with the name of the data bucket you are targeting.

eg. #define kServerDbURL @“http://localhost:4984/grocery-sync


#3

Your database URL constant in the app is missing the database name.


#4

Hi,

thanks … adding the DB name did the trick.

Actually was a little strange to me that this is required because I (in my picture) I point to the proxy/sync gateway and I assumed the configuration file of the proxy points to the database.

But now I learned that a gateway can manage multiple databases - (hence the name in the config ;)).

Greetings,

Ralf

#5

hey frd i m build my first app in ios using couchbase but i dont how it work but i m trying to learn from grocery sync exampal.
but in my ios app got this type of error shown as below
Can’t connect, giving up: Error Domain=CBLHTTP Code=404 “404 not_found” UserInfo=0x7fa7eaf74ac0 {NSURL=http://localhost/Couch/_changes?feed=normal&heartbeat=300000&style=all_docs, NSLocalizedFailureReason=not_found, NSLocalizedDescription=404 not_found}

if any demo regarding this topic please tell me
thnax