{ "id": "166614", "key": "TIMOB-24488", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2017-03-20T18:08:06.000+0000", "created": "2017-03-15T16:14:54.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "ios" ], "versions": [], "issuelinks": [ { "id": "55429", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "168931", "key": "MOD-2348", "fields": { "summary": "iOS: Encrypted Database upgrade-error when using Ti.Database", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-07-17T15:41:59.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "The current app store version of our app uses version 1.3.1 of the appcelerator.encrypteddatabase module and titanium sdk version 5.5.0.GA and doesn't have the 3rd party module PSPDFKIT included.\r\n\r\nWhen we upgrade the installed app to the new app version with a build using version 2.0.2 of appcelerator.encrypteddatabase and sdk version 6.0.2.GA and and including pspdfkit version 6.5.0 titanium module.\r\n\r\nWe get the error at the bottom of this message, when trying launch our app.\r\n\r\n It appears to be a conflict with maybe SQLCipher versions between PDFkit and the encrypted database module we use? It's strange that as soon as we remove PSPDFKIT from the project, we have no database problems at all. \r\n\r\nPSPDFKIT say they don't ship SQLite with their module, so confusing why it is happening. As soon as we comment out the PSPDFKIT module from our tiapp.xml with literally no other changes. Clean and build...we have no problems at all. \r\n\r\n\r\n[ERROR] : A SQLite database error occurred on database '/var/mobile/Containers/Data/Application/D267402E-F179-4B0E-9D4A-D0CF969E866E/Library/Private Documents/alloy.enc.db.sql': Error Domain=com.plausiblelabs.EncPLDatabase Code=3 \"An error occured parsing the provided SQL statement.\" UserInfo={com.plausiblelabs.EncPLDatabase.error.vendor.code=26, com.plausiblelabs.EncPLDatabase.error.vendor.string=file is encrypted or is not a database, com.plausiblelabs.EncPLDatabase.error.query.string=CREATE TABLE IF NOT EXISTS migrations (latest TEXT, model TEXT);, NSLocalizedDescription=An error occured parsing the provided SQL statement.} (SQLite #26: file is encrypted or is not a database) (query: 'CREATE TABLE IF NOT EXISTS migrations (latest TEXT, model TEXT);')\r\n[ERROR] : Script Error {\r\n[ERROR] : column = 4383;\r\n[ERROR] : line = 1;\r\n[ERROR] : message = \"invalid SQL statement\";\r\n[ERROR] : nativeLocation = \"-[AppceleratorEncrypteddatabaseDBProxy execute:] (AppceleratorEncrypteddatabaseDBProxy.m:261)\";\r\n[ERROR] : nativeReason = \"Error Domain=com.plausiblelabs.EncPLDatabase Code=3 \\\"An error occured parsing the provided SQL statement.\\\" UserInfo={com.plausiblelabs.EncPLDatabase.error.vendor.code=26, com.plausiblelabs.EncPLDatabase.error.vendor.string=file is encrypted or is not a database, com.plausiblelabs.EncPLDatabase.error.query.string=CREATE TABLE IF NOT EXISTS migrations (latest TEXT, model TEXT);, NSLocalizedDescription=An error occured parsing the provided SQL statement.}\";\r\n[ERROR] : sourceURL = \"file:///var/containers/Bundle/Application/A32BB2A9-DF9C-4414-A1F9-3242E4843DB2/Q-Pulse.app/alloy/sync/enc.db.js\";\r\n[ERROR] : stack = \"[native code]\\nGetMigrationFor@file:///var/containers/Bundle/Application/A32BB2A9-DF9C-4414-A1F9-3242E4843DB2/Q-Pulse.app/alloy/sync/enc.db.js:1:4383\\nMigrate@file:///var/containers/Bundle/Application/A32BB2A9-DF9C-4414-A1F9-3242E4843DB2/Q-Pulse.app/alloy/sync/enc.db.js:1:5124\\nafterModelCreate@file:///var/containers/Bundle/Application/A32BB2A9-DF9C-4414-A1F9-3242E4843DB2/Q-Pulse.app/alloy/sync/enc.db.js:1:8395\\nM@file:///var/containers/Bundle/Application/A32BB2A9-DF9C-4414-A1F9-3242E4843DB2/Q-Pulse.app/alloy.js:1:1939\\nfile:///var/containers/Bundle/Application/A32BB2A9-DF9C-4414-A1F9-3242E4843DB2/Q-Pulse.app/alloy/models/User.js:1:648\\nglobal code@file:///var/containers/Bundle/Application/A32BB2A9-DF9C-4414-A1F9-3242E4843DB2/Q-Pulse.app/alloy/models/User.js:2:70\\nrequire@[native code]\\ncreateCollection@file:///var/containers/Bundle/Application/A32BB2A9-DF9C-4414-A1F9-3242E4843DB2/Q-Pulse.app/alloy.js:1:5408\\ngetLoginUserModel@file:///var/containers/Bundle/App\r\nlication/A32BB2A9-DF9C-4414-A1F9-3242E4843DB2/Q-Pulse.app/alloy/controllers/Account/login.js:1:22842\\nlogin@file:///var/containers/Bundle/Application/A32BB2A9-DF9C-4414-A1F9-3242E4843DB2/Q-Pulse.app/alloy/controllers/Account/login.js:1:20470\";\r\n[ERROR] : }\r\n[ERROR] : Script Error Module \"alloy/models/User.js\" failed to leave a valid exports object\r\n[ERROR] : ErrorController is up. ABORTING showing of modal controller\r\n", "attachment": [], "flagged": false, "summary": "iOS: appcelerator.encrypteddatabase and pspdfkit modules conflict and throw database error", "creator": { "name": "joef", "key": "joef", "displayName": "Joe Finnigan", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "joef", "key": "joef", "displayName": "Joe Finnigan", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "412523", "author": { "name": "steipete", "key": "steipete", "displayName": "Peter Steinberger", "active": true, "timeZone": "Europe/Berlin" }, "body": "PSPDFKit founder here. I can confirm that we do not ship any version of SQLite or SQLCipher. However, we internally use sqlite; but simply by linking not much code runs. We use some runtime discovery to automatically find and adopt SQLCipher if it's in the runtime:\r\nhttps://pspdfkit.com/guides/ios/current/security/encryption-support-in-pspdflibrary/\r\n\r\nWe also prefix all of our classes with \"PSPDF\" so we can rule out a naming conflict.\r\nWe user a dynamic framework so we can rule out a function clash as mach does two-level namespacing.\r\n\r\nIs the source code of appcelerator.encrypteddatabase available somewhere? I feel the only sane way to debug this will be stepping through the code and comparing. \r\n\r\nYou'll find more infos and how to download our module here. You don't need a login for that - download + demo license is fully automated:\r\nhttps://pspdfkit.com/guides/ios/current/other-languages/appcelerator-titanium/", "updateAuthor": { "name": "steipete", "key": "steipete", "displayName": "Peter Steinberger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-15T17:34:41.000+0000", "updated": "2017-03-15T17:34:41.000+0000" }, { "id": "412576", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Quick update from our side: I'm in direct contact with Peter to resolve this together. We found a possible solution that won't require an update if it works, only a change in the module metadata. More updates as soon we received feedback, thanks!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-15T18:20:08.000+0000", "updated": "2017-03-15T18:20:08.000+0000" }, { "id": "413858", "author": { "name": "steipete", "key": "steipete", "displayName": "Peter Steinberger", "active": true, "timeZone": "Europe/Berlin" }, "body": "Confirmed to be fixed when `-lsqlite3` is removed from the module.xcconfig. Thanks Hans for your help! :)", "updateAuthor": { "name": "steipete", "key": "steipete", "displayName": "Peter Steinberger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-20T18:02:55.000+0000", "updated": "2017-03-20T18:02:55.000+0000" }, { "id": "413863", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks Joe and Peter!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-20T18:08:06.000+0000", "updated": "2017-03-20T18:08:06.000+0000" }, { "id": "421247", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing issue with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-07T21:30:08.000+0000", "updated": "2017-06-07T21:30:08.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }