Re: [mongodb-user] Stitch Android Local DB Location

33 views
Skip to first unread message

Andrew Morrow

unread,
Feb 26, 2019, 10:50:38 AM2/26/19
to mongod...@googlegroups.com, mongodb-st...@googlegroups.com

Hi -

I'm adding the mongodb-stitch-users list to this thread. In the future, that list is more likely to get you a quick response on stitch specific topics.

Thanks,
Andrew


On Mon, Feb 25, 2019 at 8:05 PM Nat101 <natg...@gmail.com> wrote:
How do I tell MongoDB Mobile Android/Stitch WHERE to store the data?
I tried using StitchAppClientConfiguration 'withDirectory", but it bombs out with cluster exceptions.
Thanks.
nat

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/3b1807d5-5f4c-45da-bf21-22cdd8ddebff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nat101

unread,
Feb 27, 2019, 11:28:01 AM2/27/19
to MongoDB Stitch Users
I replied yesterday -with screen shots- over at mongodb-user (since I started the thread there).
Please advise if I should post it again here, or if you have already seen that post, or whatever.
-nat

Tod Felix

unread,
Apr 21, 2019, 12:32:57 AM4/21/19
to MongoDB Stitch Users
Hi 

I am having the exact same problem. Did someone found out how to solve it?

I looked at the proposition of Tyler on the original thread but still gets the error. 
Like Nat, I want to write my DB in the PUBLIC storage.

Here is the logcat:


I
/client: Created dbpath directory: /storage/emulated/0/TrackerDroid/db/<appId>/sync_mongodb_mongodb-atlas/5cbbe3ae2f486889b7f427d4/0/
W
/capi: CONTROL   [main] Bad ELF magic number in image of "/system/framework/arm/boot.oat"
W
/capi: CONTROL   [main] Bad ELF magic number in image of "/system/framework/arm/boot-core-libart.oat"
W
/capi: CONTROL   [main] Bad ELF magic number in image of "/system/framework/arm/boot-conscrypt.oat"
W
/capi: CONTROL   [main] Bad ELF magic number in image of "/system/framework/arm/boot-okhttp.oat"
W
/capi: CONTROL   [main] Bad ELF magic number in image of "/system/framework/arm/boot-bouncycastle.oat"
W
/capi: CONTROL   [main] Bad ELF magic number in image of "/system/framework/arm/boot-ext.oat"
W
/capi: CONTROL   [main] Bad ELF magic number in image of "/system/framework/arm/boot-framework.oat"
W
/capi: CONTROL   [main] Bad ELF magic number in image of "/system/framework/arm/boot-telephony-common.oat"
W
/capi: CONTROL   [main] Bad ELF magic number in image of "/system/framework/arm/boot-voip-common.oat"
W
/capi: CONTROL   [main] Bad ELF magic number in image of "/system/framework/arm/boot-ims-common.oat"
W
/capi: CONTROL   [main] Bad ELF magic number in image of "/system/framework/arm/boot-org.apache.http.legacy.boot.oat"
W
/capi: CONTROL   [main] Bad ELF magic number in image of "/data/app/ca.polymtl.inf8405.g2.trackerdroid-4fVmLWasuYze-HImwQOgKA==/oat/arm/base.odex"
I
/capi: CONTROL   [initandlisten] MongoDB starting : pid=23550 port=27017 dbpath=/storage/emulated/0/TrackerDroid/db/<appId>/sync_mongodb_mongodb-atlas/5cbbe3ae2f486889b7f427d4/0/ 32-bit
I
/capi: STORAGE   [initandlisten] In File::open(), ::open for '/storage/emulated/0/TrackerDroid/db/<appId>/sync_mongodb_mongodb-atlas/5cbbe3ae2f486889b7f427d4/0/storage.bson.tmp' failed with Operation not permitted
D
/AndroidRuntime: Shutting down VME/AndroidRuntime: FATAL EXCEPTION: main
   
Process: ca.polymtl.inf8405.g2.trackerdroid, PID: 23550
    com
.mongodb.embedded.client.MongoClientEmbeddedException: Could not create a new embedded cluster. Ensure existing MongoClients are fully closed before trying to create a new one.
        at com
.mongodb.embedded.client.MongoClients.create(MongoClients.java:68)
        at com
.mongodb.stitch.android.services.mongodb.local.internal.AndroidEmbeddedMongoClientFactory.createClient(AndroidEmbeddedMongoClientFactory.java:47)
        at com
.mongodb.stitch.core.services.mongodb.local.internal.EmbeddedMongoClientFactory.getClient(EmbeddedMongoClientFactory.java:57)
        at com
.mongodb.stitch.core.services.mongodb.remote.sync.internal.SyncMongoClientFactory.getClient(SyncMongoClientFactory.java:42)
        at com
.mongodb.stitch.core.services.mongodb.remote.internal.CoreRemoteMongoClientImpl.<init>(CoreRemoteMongoClientImpl.java:55)
        at com
.mongodb.stitch.core.services.mongodb.remote.sync.internal.CoreRemoteClientFactory.getClient(CoreRemoteClientFactory.java:43)
        at com
.mongodb.stitch.android.services.mongodb.remote.RemoteMongoClient$$CC.lambda$static$0$RemoteMongoClient$$CC(Unknown Source:39)
        at com
.mongodb.stitch.android.services.mongodb.remote.RemoteMongoClient$$Lambda$0.getClient(Unknown Source:0)
        at com
.mongodb.stitch.android.core.internal.StitchAppClientImpl.getServiceClient(StitchAppClientImpl.java:125)
        at ca
.polymtl.inf8405.g2.trackerdroid.data.db.DBHelper.initCollection(DBHelper.java:55)
        at ca
.polymtl.inf8405.g2.trackerdroid.manager.Manager.initDatabase(Manager.java:108)
        at ca
.polymtl.inf8405.g2.trackerdroid.SplashScreen$6.onComplete(SplashScreen.java:160)
        at ca
.polymtl.inf8405.g2.trackerdroid.data.db.AbstractDBHelper$1.onComplete(AbstractDBHelper.java:68)
        at com
.google.android.gms.tasks.zzj.run(Unknown Source:4)
        at android
.os.Handler.handleCallback(Handler.java:790)
        at android
.os.Handler.dispatchMessage(Handler.java:99)
        at android
.os.Looper.loop(Looper.java:164)
        at android
.app.ActivityThread.main(ActivityThread.java:6494)
        at java
.lang.reflect.Method.invoke(Native Method)
        at com
.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com
.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
     
Caused by: com.mongodb.embedded.capi.MongoEmbeddedCAPIException: Failed to fsync new `storage.bson` file. (2:37)
        at com
.mongodb.embedded.capi.CAPIHelper.createErrorFromStatus(CAPIHelper.java:62)
        at com
.mongodb.embedded.capi.CAPIHelper.createErrorFromStatus(CAPIHelper.java:55)
        at com
.mongodb.embedded.capi.MongoEmbeddedInstanceImpl.<init>(MongoEmbeddedInstanceImpl.java:50)
        at com
.mongodb.embedded.capi.MongoEmbeddedLibraryImpl.createInstance(MongoEmbeddedLibraryImpl.java:66)
        at com
.mongodb.embedded.client.EmbeddedServer.createInstance(EmbeddedServer.java:122)
        at com
.mongodb.embedded.client.EmbeddedServer.<init>(EmbeddedServer.java:69)
        at com
.mongodb.embedded.client.EmbeddedCluster.<init>(EmbeddedCluster.java:50)





Thanks
Tod

Tyler Kaye

unread,
Apr 30, 2019, 11:17:48 AM4/30/19
to MongoDB Stitch Users
Hi Tod, 

Currently, MongoMobile is not configured to be able to write to data on external storage on Android. Could you please let us know a bit more about your use case and why the default storage location does not meet your requirements so that we can get a better understanding of the problem?

Thanks, 
Tyler
Reply all
Reply to author
Forward
0 new messages