--
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 mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/4828e271-b45f-4e3a-8268-753b531675b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
{
"log": ["CRUD", "REST+"],
"databases": {
"budgetappdb": {
"server": "http://localhost:8091",
"bucket": "sync_gateway",
"users": {
"GUEST": {"disabled" : false}
},
"sync":`function(doc,oldDoc){if (doc._deleted) {requireUser(oldDoc.channels);return;}if(!doc.channels){throw({forbidden: "Missing required properties"});}if(oldDoc==null){requireUser(doc.channels)}else{requireUser(oldDoc.channels);}channel(doc.channels);access(doc.channels,doc.channels);}`
}
}
}
{"target":"budgetappdb","headers":{"Cookie":"SyncGatewaySession=238aa5d0b66d9588559756eb91c5427509a8c69a"},"source":{"url":"http://192.168.1.14:4984/budgetappdb","auth":{"name":"vinay"}},"continuous":true}
On Dec 5, 2014, at 5:16 AM, Vinay Bhinde <vin...@gmail.com> wrote:That means my cookie isn't being set once i restart my app. This is despite the fact that i send session id manually in the replicate headers object. Why isn't SG authenticating the request despite of it containing a cookie in header ??
If you are putting a "Cookie:" header in a custom-headers object, it is unfortunately ignored (#532).—Jens
The logs show some requests being made on the admin port — see "(ADMIN)" in the logs. That implies you have a client using the admin port, which is generally a bad idea.
(Please don't post logs as screenshots. Besides the wasted bandwidth it also makes it impossible to copy and paste text from them. IIRC the Windows DOS app is still brain-dead about copy/paste but there are good alternative terminal apps.)
> {"target":"budgetappdb","headers":{"Cookie":"SyncGatewaySession=238aa5d0b66d9588559756eb91c5427509a8c69a"},"source":{"url":"http://192.168.1.14:4984/budgetappdb","auth":{"name":"vinay"}},"continuous":true}
CBL doesn't support a "name" sub-property of "auth", so your authentication is being ignored and it's connecting as guest, as Traun said. (Again, you can see this in the Gateway logs because the iOS requests don't say "(as vinay)" at the end.)
(Looking through the CouchDB docs, it doesn't seem to support "name" auth either. Where did you get this from? I'm wondering if there are incorrect docs somewhere, or if this is actually a supported CouchDB property that I just haven't found documentation for.)
Instead, put the username in the URL, i.e.
"source": "http://vi...@192.168.1.14:4984/budgetappdb"
you may also need the password if it's not already in the application's keychain:
"source": "http://vinay:mypassword@192.168.1.14:4984/budgetappdb"
—Jens
11:39:29.693003 HTTP: #062: POST /budgetappdb/_changes (as vinay)
11:40:42.719305 HTTP: #063: POST /budgetappdb/_changes (as vinay)
11:41:32.607294 HTTP: #064: GET /budgetappdb/_changes?feed=websocket (as vinay
)
11:41:57.293762 HTTP: #065: POST /budgetappdb/_changes (as vinay)
11:43:13.627606 HTTP: #066: POST /budgetappdb/_changes (as vinay)
16:39:36.725‖ CBLSocketChangeTracker[0x135bae50 budgetappdb]: Connection error #1, retrying in 2.0 sec: The operation couldn’t be completed. (CBLChangeTracker error 587.)
16:39:38.928‖ WARNING*** : JSON error parsing _changes feed: parse error: client cancelled parse via callback return value
16:39:38.929‖ CBLSocketChangeTracker[0x135bae50 budgetappdb]: Connection error #1, retrying in 2.0 sec: The operation couldn’t be completed. (CBLChangeTracker error 587.)
16:39:41.152‖ WARNING*** : JSON error parsing _changes feed: parse error: client cancelled parse via callback return value
16:39:41.153‖ CBLSocketChangeTracker[0x135bae50 budgetappdb]: Connection error #1, retrying in 2.0 sec: The operation couldn’t be completed. (CBLChangeTracker error 587.)
16:39:43.356‖ WARNING*** : JSON error parsing _changes feed: parse error: client cancelled parse via callback return value
On Dec 5, 2014, at 9:22 PM, Vinay Bhinde <vin...@gmail.com> wrote:But the same cookie:header in custom-headers works very well in android.
Furthermore in iOS too this thing works for the very first time (i.e it accepts the cookie header and authenticates ) but thereafter after restarting my app even though i send the cookie, CBLite doesn't use it and my login fails with SG.
I kind of think the above warning is the the thing that is stopping new documents to be pulled into iOS client...as far as i understand it is referring to the fact that json in my document is bugged and not parsed by CBLite and that it needs linting right ?
Thanks for the help and all the pointers... They are really useful for me.
The documentation regarding custom authentication says in order for CBL to use the cookie returned by auth server automatically to make calls to SG, the SG and Auth server should be running on the same port and not just the same host.
That isn't the case with my environment. They run on same host but on different ports. And i tried checking if CBL used the cookie that i return from nodejs server but it doesn't use it and i get login error on SG calls. So i had to set it manually. And it works atleast for the first time.
That warning ("JSON error parsing _changes feed") means CBL is having trouble parsing the list of change sent by the SG. There have been other recent reports of this too from other users. It's being tracked as issue #541.But yes, this is preventing CBL from pulling changes.I have an idea about what might be causing #541 and I can check in an experimental fix soon.—Jens
On Dec 8, 2014, at 11:23 PM, Vinay Bhinde <vin...@gmail.com> wrote:I checked out issue #541 and it is closed down. They solved it by removing the couchbase dependencies and adding them again. I am still facing that issue and currently my sync feature is rendered useless because of ios client not being able to pull. Any short term fix will be really helpful.
More importantly, they removed CBL 1.0 and added 1.0.3, i.e. they upgraded the version.Check what version of CBL you have in your plugin, by doing a "GET /" request. I know that until recently the Cordova plugin repository had an old version.—Jens
On Dec 10, 2014, at 2:04 AM, Vinay Bhinde <vin...@gmail.com> wrote:Bad news is that after updating my cordova project with cblite 1.0.3 it isn't letting me archive my app and generate a IPA file. It shows me following errors when failing to archive and hence i have no way of generating the actual ios app file.
The clue must be in the warnings saying "Ignoring file _____" — if it's skipping the CBL libraries that definitely explains the later link errors.Unfortunately the screenshot cuts off the messages. It's much better to paste errors as text than images. Go to the log/report navigator, select the build, and copy the errors from there.—Jens
Build target BudgetApp
Ld /Users/mac/Library/Developer/Xcode/DerivedData/BudgetApp-elzdmxbcbgxqlhfquihazirquizr/Build/Intermediates/ArchiveIntermediates/BudgetApp/IntermediateBuildFilesPath/BudgetApp.build/Release-iphoneos/BudgetApp.build/Objects-normal/arm64/BudgetApp normal arm64
cd /Users/mac/Desktop/BudgetApp/platforms/ios
export IPHONEOS_DEPLOYMENT_TARGET=6.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -L/Users/mac/Library/Developer/Xcode/DerivedData/BudgetApp-elzdmxbcbgxqlhfquihazirquizr/Build/Intermediates/ArchiveIntermediates/BudgetApp/BuildProductsPath/Release-iphoneos -L/Users/mac/Desktop/BudgetApp/platforms/ios/BudgetApp/Plugins/com.couchbase.lite.phonegap -F/Users/mac/Library/Developer/Xcode/DerivedData/BudgetApp-elzdmxbcbgxqlhfquihazirquizr/Build/Intermediates/ArchiveIntermediates/BudgetApp/BuildProductsPath/Release-iphoneos -filelist /Users/mac/Library/Developer/Xcode/DerivedData/BudgetApp-elzdmxbcbgxqlhfquihazirquizr/Build/Intermediates/ArchiveIntermediates/BudgetApp/IntermediateBuildFilesPath/BudgetApp.build/Release-iphoneos/BudgetApp.build/Objects-normal/arm64/BudgetApp.LinkFileList -dead_strip -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -force_load /Users/mac/Library/Developer/Xcode/DerivedData/BudgetApp-elzdmxbcbgxqlhfquihazirquizr/Build/Intermediates/ArchiveIntermediates/BudgetApp/BuildProductsPath/Release-iphoneos/libCordova.a -ObjC -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=6.0 -framework AssetsLibrary /Users/mac/Library/Developer/Xcode/DerivedData/BudgetApp-elzdmxbcbgxqlhfquihazirquizr/Build/Intermediates/ArchiveIntermediates/BudgetApp/BuildProductsPath/Release-iphoneos/libCordova.a -framework CoreGraphics -framework MobileCoreServices -lCBLJSViewCompiler /Users/mac/Desktop/BudgetApp/platforms/ios/BudgetApp/Plugins/com.couchbase.lite.phonegap/CouchbaseLite.a /Users/mac/Desktop/BudgetApp/platforms/ios/BudgetApp/Plugins/com.couchbase.lite.phonegap/CouchbaseLiteListener.a /Users/mac/Desktop/BudgetApp/platforms/ios/BudgetApp/Plugins/com.couchbase.lite.phonegap/JavaScriptCore.a -lsqlite3 -lstdc++ -licucore -lz -framework Security -framework CFNetwork -framework SystemConfiguration -Xlinker -dependency_info -Xlinker /Users/mac/Library/Developer/Xcode/DerivedData/BudgetApp-elzdmxbcbgxqlhfquihazirquizr/Build/Intermediates/ArchiveIntermediates/BudgetApp/IntermediateBuildFilesPath/BudgetApp.build/Release-iphoneos/BudgetApp.build/Objects-normal/arm64/BudgetApp_dependency_info.dat -o /Users/mac/Library/Developer/Xcode/DerivedData/BudgetApp-elzdmxbcbgxqlhfquihazirquizr/Build/Intermediates/ArchiveIntermediates/BudgetApp/IntermediateBuildFilesPath/BudgetApp.build/Release-iphoneos/BudgetApp.build/Objects-normal/arm64/BudgetApp
ld: warning: ignoring file /Users/mac/Desktop/BudgetApp/platforms/ios/BudgetApp/Plugins/com.couchbase.lite.phonegap/libCBLJSViewCompiler.a, missing required architecture arm64 in file /Users/mac/Desktop/BudgetApp/platforms/ios/BudgetApp/Plugins/com.couchbase.lite.phonegap/libCBLJSViewCompiler.a (3 slices)
ld: warning: ignoring file /Users/mac/Desktop/BudgetApp/platforms/ios/BudgetApp/Plugins/com.couchbase.lite.phonegap/CouchbaseLite.a, missing required architecture arm64 in file /Users/mac/Desktop/BudgetApp/platforms/ios/BudgetApp/Plugins/com.couchbase.lite.phonegap/CouchbaseLite.a (3 slices)
ld: warning: ignoring file /Users/mac/Desktop/BudgetApp/platforms/ios/BudgetApp/Plugins/com.couchbase.lite.phonegap/CouchbaseLiteListener.a, missing required architecture arm64 in file /Users/mac/Desktop/BudgetApp/platforms/ios/BudgetApp/Plugins/com.couchbase.lite.phonegap/CouchbaseLiteListener.a (3 slices)
ld: warning: ignoring file /Users/mac/Desktop/BudgetApp/platforms/ios/BudgetApp/Plugins/com.couchbase.lite.phonegap/JavaScriptCore.a, missing required architecture arm64 in file /Users/mac/Desktop/BudgetApp/platforms/ios/BudgetApp/Plugins/com.couchbase.lite.phonegap/JavaScriptCore.a (3 slices)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_CBLManager", referenced from:
objc-class-ref in CBLite.o
"_CBLRegisterJSViewCompiler", referenced from:
-[CBLite launchCouchbaseLite] in CBLite.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: warning: ignoring file /Users/mac/Desktop/BudgetApp/platforms/ios/BudgetApp/Plugins/com.couchbase.lite.phonegap/CouchbaseLite.a, missing required architecture arm64 in file
i created a simple blank cordova app and added cblite 1.0.3 phonegap plugin to it along with ios platform and then tried to archive it from xcode. Still it fails with above errors.
I had that problem earlier...but i got to know about it and then i tried a completely fresh install of the Cordova plugin..still it fails.
Further more as i said i went ahead and created a blank cordova app and added just cblite 1.0.3 and ios platform.. Nothing else to make sure there isn't any interference. Still it fails. I would recommend jchris to check this test simple reduced test case and see if he too faces this issue.
Stuck on making sync work on ios for a few days now. Working on tight deadlines :(
Thanks
Vinay Bhinde
--
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/nEvhKKuednw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/c15563b8-b057-4ec0-b259-2eb216f4c98e%40googlegroups.com.
I had that problem earlier...but i got to know about it and then i tried a completely fresh install of the Cordova plugin..still it fails.
Further more as i said i went ahead and created a blank cordova app and added just cblite 1.0.3 and ios platform.. Nothing else to make sure there isn't any interference. Still it fails. I would recommend jchris to check this test simple reduced test case and see if he too faces this issue.
Our engineer Pasin just verified that he can use the directions on our website to successfully build and run an iOS PhoneGap/Cordova app. Is what you're doing similar? Maybe you're getting the plugin from a different source?--Jens
cordova create hello com.cblite.hello HelloWorld
cordova platform add ios
warning: (armv7) /Users/jenkins/jenkins/workspace/build_cblite_ios_103-enterprise/couchbase-lite-ios/build/CouchbaseLite.build/Release-iphoneos/Listener iOS Library.build/Objects-normal/armv7/HTTPDataResponse.o unable to open object file
warning: (armv7) /Users/jenkins/jenkins/workspace/build_cblite_ios_103-enterprise/couchbase-lite-ios/build/CouchbaseLite.build/Release-iphoneos/Listener iOS Library.build/Objects-normal/armv7/HTTPFileResponse.o unable to open object file
warning: (armv7) /Users/jenkins/jenkins/workspace/build_cblite_ios_103-enterprise/couchbase-lite-ios/build/CouchbaseLite.build/Release-iphoneos/Listener iOS Library.build/Objects-normal/armv7/HTTPAuthenticationRequest.o unable to open object file
warning: (armv7) /Users/jenkins/jenkins/workspace/build_cblite_ios_103-enterprise/couchbase-lite-ios/build/CouchbaseLite.build/Release-iphoneos/Listener iOS Library.build/Objects-normal/armv7/HTTPConnection.o unable to open object file
warning: (armv7) /Users/jenkins/jenkins/workspace/build_cblite_ios_103-enterprise/couchbase-lite-ios/build/CouchbaseLite.build/Release-iphoneos/Listener iOS Library.build/Objects-normal/armv7/HTTPMessage.o unable to open object file
warning: (armv7) /Users/jenkins/jenkins/workspace/build_cblite_ios_103-enterprise/couchbase-lite-ios/build/CouchbaseLite.build/Release-iphoneos/Listener iOS Library.build/Objects-normal/armv7/HTTPServer.o unable to open object file
warning: (armv7) /Users/jenkins/jenkins/workspace/build_cblite_ios_103-enterprise/couchbase-lite-ios/build/CouchbaseLite.build/Release-iphoneos/Listener iOS Library.build/Objects-normal/armv7/DDLog.o unable to open object file
warning: (armv7) /Users/jenkins/jenkins/workspace/build_cblite_ios_103-enterprise/couchbase-lite-ios/build/CouchbaseLite.build/Release-iphoneos/Listener iOS Library.build/Objects-normal/armv7/DDNumber.o unable to open object file
warning: (armv7) /Users/jenkins/jenkins/workspace/build_cblite_ios_103-enterprise/couchbase-lite-ios/build/CouchbaseLite.build/Release-iphoneos/Listener iOS Library.build/Objects-normal/armv7/DDRange.o unable to open object file
warning: (armv7) /Users/jenkins/jenkins/workspace/build_cblite_ios_103-enterprise/couchbase-lite-ios/build/CouchbaseLite.build/Release-iphoneos/Listener iOS Library.build/Objects-normal/armv7/CBLListener.o unable to open object file
warning: (armv7) /Users/jenkins/jenkins/workspace/build_cblite_ios_103-enterprise/couchbase-lite-ios/build/CouchbaseLite.build/Release-iphoneos/Listener iOS Library.build/Objects-normal/armv7/CBLHTTPServer.o unable to open object file
On Dec 12, 2014, at 6:24 AM, Vinay Bhinde <vin...@gmail.com> wrote:The only major issue right now is that i cannot figure out why does my ios client fail to authenticate with SG inspite of session cookie being valid and not expired.
Any help for where should i check and what's going wrong (any specific logs so that i can search to find if cblite requests take my cookie along when they call SG) because for the first time client successfully authenticates.
Have you filed an issue? I can't find one. That's a better way to track this than email discussion.
See if you can sniff the HTTP traffic between app and server. Then you can see what Set-Cookie headers the server sends and what Cookie headers the app sends.A proxy like nginx in front of the Sync Gateway should be able to do this, or you can run a debugging proxy like Charles on your client network and configure your device (or simulator) to connect through it.—Jens