"No such module: fts4" on iOS

491 views
Skip to first unread message

ka...@microlarge.com

unread,
Nov 18, 2013, 5:29:28 PM11/18/13
to mobile-c...@googlegroups.com
Jens,

I just built the CBL iOS framework from source (master HEAD / 2ebf4fe6fe855e5cef6804ca8a4a2e5b7ad23e88), because I got many "Db busy" warnings during sync with the last build (also self-built, I think that was c0d4e259fac1f6a9a0b71c615fe935123e9aa1db from Nov 2).

Now I'm getting SQLite errors on app startup:

2013-11-18 23:18:06.108 Taskdeck[74757:a0b] Error calling sqlite3_step (1: no such module: fts4) SQLITE_ERROR

2013-11-18 23:18:06.110 Taskdeck[74757:a0b] DB Query: CREATE VIRTUAL TABLE fulltext USING fts4(content, tokenize=unicodesn)

23:18:06.111| WARNING*** : CBLDatabase: Could not initialize schema of /Users/ktraunmueller/Library/Application Support/iPhone Simulator/7.0.3/Applications/724E29DD-9500-479B-B2E1-280AB0762E62/Library/Application Support/CouchbaseLite/taskdeck.cblite -- May be an old/incompatible format. SQLite error: no such module: fts4

2013-11-18 23:18:06.112 Taskdeck[74757:a0b] Error Domain=SQLite Code=1 "no such module: fts4" UserInfo=0xaea5f60 {NSLocalizedDescription=no such module: fts4}

2013-11-18 23:18:06.278 Taskdeck[74757:450f] Error calling sqlite3_step (1: no such module: fts4) SQLITE_ERROR

2013-11-18 23:18:06.279 Taskdeck[74757:450f] DB Query: CREATE VIRTUAL TABLE fulltext USING fts4(content, tokenize=unicodesn)

23:18:06.280 WARNING*** : CBLDatabase: Could not initialize schema of /Users/ktraunmueller/Library/Application Support/iPhone Simulator/7.0.3/Applications/724E29DD-9500-479B-B2E1-280AB0762E62/Library/Application Support/CouchbaseLite/_replicator.cblite -- May be an old/incompatible format. SQLite error: no such module: fts4

2013-11-18 23:18:06.280 Taskdeck[74757:450f] The FMDatabase <CBL_FMDatabase: 0xac4fb40> is not open.


I've tried cleaning and uinstalling, to no avail.

I'm building against the iOS 7.0 SDK, deployment target is iOS 6.1. From what I understand, FTS4 should be available in iOS 6 and up. The grocery sync demo runs fine, though.

Any idea why SQLite fails to load FTS4?

many thanks,
Karl

Jens Alfke

unread,
Nov 18, 2013, 5:48:46 PM11/18/13
to mobile-c...@googlegroups.com
That’s very strange. When I did the FTS work in September I made sure to test on an iOS 6 device to verify that the fts4 module was available. And that code hasn’t changed since then, so there shouldn’t be any regression in that area going from a Nov 2 build to the latest.

The only recent change around database creation is commit 87c2b1a which simply wraps the database setup commands with BEGIN TRANSACTION and END TRANSACTION. It would be very strange if that caused fts4 initialization to fail, but you could try commenting out those lines and see if it changes anything.

I don’t have my trusty old iTouch running 6.1 here at the office, but I’ll run tests on it once I get home.

—Jens

ka...@microlarge.com

unread,
Nov 19, 2013, 2:49:01 PM11/19/13
to mobile-c...@googlegroups.com
Strange indeed. Please note that the issue occurred for me on the iOS 7 simulator, so I don't think it's iOS 6-related. I just compare the project build settings between the Grocery Sync Demo and my project, but found nothing obviously wrong.

Karl

ka...@microlarge.com

unread,
Nov 19, 2013, 2:51:16 PM11/19/13
to mobile-c...@googlegroups.com
The bundle version of the last build that works fine for me is 1.479.

Karl

Jens Alfke

unread,
Nov 19, 2013, 3:06:37 PM11/19/13
to mobile-c...@googlegroups.com
On Nov 19, 2013, at 11:49 AM, ka...@microlarge.com wrote:

Strange indeed. Please note that the issue occurred for me on the iOS 7 simulator, so I don't think it's iOS 6-related.

Especially weird, because I can definitely run CBL in the iOS simulator.

I just compare the project build settings between the Grocery Sync Demo and my project, but found nothing obviously wrong.

Just to eliminate the obvious: your project doesn’t include a custom build of sqlite, does it?
And since my FMDB-fork submodule has updated several times recently, are you remembering to run ‘git submodule update’ after pulling in new CBL commits? Otherwise you might be building with an older/incompatible version.

—Jens

ka...@microlarge.com

unread,
Nov 19, 2013, 3:58:15 PM11/19/13
to mobile-c...@googlegroups.com

Just to eliminate the obvious: your project doesn’t include a custom build of sqlite, does it?

No, it doesn't.
 
And since my FMDB-fork submodule has updated several times recently, are you remembering to run ‘git submodule update’ after pulling in new CBL commits? Otherwise you might be building with an older/incompatible version.

Oh. I just noticed that most submodules were in a detached HEAD state, even though I ran 'git submodule update'. After trying to bring everything to master/HEAD, I still have:

couchbase-lite-ios ktraunmueller$ git submodule
+baa662ff94f703ce346fe591fd33639ef3a3ab0c vendor/CocoaHTTPServer (2.2.1-41-gbaa662f)
+3e1321e21fb31bd1c2e192da9d2e9d26f359eda1 vendor/JSON-Schema-Test-Suite (1.0.0-9-g3e1321e)
 a1357ee2ed64d89d71cdca0e61ad698126ba483f vendor/MYUtilities (heads/master)
 8bb5c8fe5ad9270d6d8a77d720105e65327b1036 vendor/fmdb (v1.5-22-g8bb5c8f)
 4f4d10c22e3c0231be82de82d88e3ae14e56611d vendor/oauthconsumer (heads/master)
 720b04a7c35c0d6d3058f6ddd350c760ac14ed8c vendor/sqlite3-unicodesn (heads/master)

Deleting my working copy and creating a fresh clone of the repository, I get a similar (but not quite the same) state:

couchbase-lite-ios ktraunmueller$ git submodule
 020f74140a262e275f7286cebca81e2faf200655 vendor/CocoaHTTPServer (2.2.1-40-g020f741)
 b4850bee637fb6d6d3aee91dab5a43e05b361564 vendor/JSON-Schema-Test-Suite (1.1.0-4-gb4850be)
 a1357ee2ed64d89d71cdca0e61ad698126ba483f vendor/MYUtilities (heads/master)
 8bb5c8fe5ad9270d6d8a77d720105e65327b1036 vendor/fmdb (v1.5-22-g8bb5c8f)
 4f4d10c22e3c0231be82de82d88e3ae14e56611d vendor/oauthconsumer (heads/master)
 720b04a7c35c0d6d3058f6ddd350c760ac14ed8c vendor/sqlite3-unicodesn (heads/master)

Anyway, if I now build the iOS framework ('Continuous iOS', previously called 'CBL iOS') from the fresh clone, I get the same error ('no such module: fts4') on app startup. 

I noticed that the Grocery Sync Demo links the static library, not the framework. Should I try copying the API folder and libCouchbaseLite.a to my project, and link against this?

many thanks,
Karl


Jens Alfke

unread,
Nov 19, 2013, 5:13:26 PM11/19/13
to mobile-c...@googlegroups.com

On Nov 19, 2013, at 12:58 PM, ka...@microlarge.com wrote:

Oh. I just noticed that most submodules were in a detached HEAD state, even though I ran 'git submodule update'. After trying to bring everything to master/HEAD, I still have:

No, the detached state is correct. The submodules are updated to specific commit IDs, not branches.

Hm, I’m out of hypotheses. :( You might see if there’s a specific CBL commit that broke this for you; that would narrow down the problem space.

I assume no one else is having this problem, since it’s kind of a showstopper but no one else has reported it. I know there are a number of developers using recent revisions.

—Jens

Andrew Reslan

unread,
Nov 20, 2013, 4:29:33 AM11/20/13
to mobile-c...@googlegroups.com
I'm building from a fresh HEAD checkout from a week ago, I have not seen this error.

Andy

ka...@microlarge.com

unread,
Nov 20, 2013, 4:30:04 PM11/20/13
to mobile-c...@googlegroups.com
Turned out the Dropbox SDK included in my project was the culprit.

Without linking against the Dropbox SDK, Couchbase works as expected.

Karl

J. Chris Anderson

unread,
Nov 25, 2013, 12:38:02 PM11/25/13
to mobile-c...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages