{"action":"created","issue":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/985","repository_url":"https://api.github.com/repos/couchbase/couchbase-lite-android","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/985/labels{/name}","comments_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/985/comments","events_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/985/events","html_url":"https://github.com/couchbase/couchbase-lite-android/issues/985","id":173953117,"number":985,"title":"SQLiteDatabaseCorruptException: database disk image is malformed (code 11)","user":{"login":"mtrakal","id":1458891,"avatar_url":"https://avatars.githubusercontent.com/u/1458891?v=3","gravatar_id":"","url":"https://api.github.com/users/mtrakal","html_url":"https://github.com/mtrakal","followers_url":"https://api.github.com/users/mtrakal/followers","following_url":"https://api.github.com/users/mtrakal/following{/other_user}","gists_url":"https://api.github.com/users/mtrakal/gists{/gist_id}","starred_url":"https://api.github.com/users/mtrakal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtrakal/subscriptions","organizations_url":"https://api.github.com/users/mtrakal/orgs","repos_url":"https://api.github.com/users/mtrakal/repos","events_url":"https://api.github.com/users/mtrakal/events{/privacy}","received_events_url":"https://api.github.com/users/mtrakal/received_events","type":"User","site_admin":false},"labels":[{"id":194413337,"url":"https://api.github.com/repos/couchbase/couchbase-lite-android/labels/bug","name":"bug","color":"e11d21","default":true},{"id":136678803,"url":"https://api.github.com/repos/couchbase/couchbase-lite-android/labels/needsmoreinfo","name":"needsmoreinfo","color":"5319e7","default":false},{"id":110660005,"url":"https://api.github.com/repos/couchbase/couchbase-lite-android/labels/P1:%20high","name":"P1: high","color":"e11d21","default":false},{"id":113343074,"url":"https://api.github.com/repos/couchbase/couchbase-lite-android/labels/review","name":"review","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"hideki","id":15889,"avatar_url":"https://avatars.githubusercontent.com/u/15889?v=3","gravatar_id":"","url":"https://api.github.com/users/hideki","html_url":"https://github.com/hideki","followers_url":"https://api.github.com/users/hideki/followers","following_url":"https://api.github.com/users/hideki/following{/other_user}","gists_url":"https://api.github.com/users/hideki/gists{/gist_id}","starred_url":"https://api.github.com/users/hideki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hideki/subscriptions","organizations_url":"https://api.github.com/users/hideki/orgs","repos_url":"https://api.github.com/users/hideki/repos","events_url":"https://api.github.com/users/hideki/events{/privacy}","received_events_url":"https://api.github.com/users/hideki/received_events","type":"User","site_admin":false},"assignees":[{"login":"hideki","id":15889,"avatar_url":"https://avatars.githubusercontent.com/u/15889?v=3","gravatar_id":"","url":"https://api.github.com/users/hideki","html_url":"https://github.com/hideki","followers_url":"https://api.github.com/users/hideki/followers","following_url":"https://api.github.com/users/hideki/following{/other_user}","gists_url":"https://api.github.com/users/hideki/gists{/gist_id}","starred_url":"https://api.github.com/users/hideki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hideki/subscriptions","organizations_url":"https://api.github.com/users/hideki/orgs","repos_url":"https://api.github.com/users/hideki/repos","events_url":"https://api.github.com/users/hideki/events{/privacy}","received_events_url":"https://api.github.com/users/hideki/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-android/milestones/17","html_url":"https://github.com/couchbase/couchbase-lite-android/milestones/1.5.0","labels_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/milestones/17/labels","id":1846143,"number":17,"title":"1.5.0","description":"Place holder for post 1.3.0","creator":{"login":"hideki","id":15889,"avatar_url":"https://avatars.githubusercontent.com/u/15889?v=3","gravatar_id":"","url":"https://api.github.com/users/hideki","html_url":"https://github.com/hideki","followers_url":"https://api.github.com/users/hideki/followers","following_url":"https://api.github.com/users/hideki/following{/other_user}","gists_url":"https://api.github.com/users/hideki/gists{/gist_id}","starred_url":"https://api.github.com/users/hideki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hideki/subscriptions","organizations_url":"https://api.github.com/users/hideki/orgs","repos_url":"https://api.github.com/users/hideki/repos","events_url":"https://api.github.com/users/hideki/events{/privacy}","received_events_url":"https://api.github.com/users/hideki/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":14,"state":"open","created_at":"2016-06-23T20:39:41Z","updated_at":"2016-11-28T19:53:38Z","due_on":null,"closed_at":null},"comments":108,"created_at":"2016-08-30T07:57:07Z","updated_at":"2016-12-05T18:17:56Z","closed_at":null,"body":"```\n    compile 'com.couchbase.lite:couchbase-lite-android:1.3.1-16'\n    compile 'com.couchbase.lite:couchbase-lite-android-forestdb:1.3.1-16'\n```\n\nWe release new version with 1.3.1-16 (previous was 1.2.1). On Android 5 and 6 we get this error with malformed database (on 7 we use forestDB).\n\nIt come from Lollipop and Marshmallow (both use SQLite).\nFrom our code it looks that app is OOM, because database return null object instead of item in.\n`StandingOrderGeneratorService.java:227` get records from DB and add them to array. Than it check, that is item null (if null, continue). On this continue it's last part of our code.\n\nI'll try to replicate by myself, this crash comes from users.\n\n```\nFatal Exception: java.lang.RuntimeException: An error occurred while executing doInBackground()\n       at android.os.AsyncTask$3.done(AsyncTask.java:309)\n       at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)\n       at java.util.concurrent.FutureTask.setException(FutureTask.java:223)\n       at java.util.concurrent.FutureTask.run(FutureTask.java:242)\n       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)\n       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)\n       at java.lang.Thread.run(Thread.java:818)\nCaused by com.couchbase.lite.internal.database.sqlite.exception.SQLiteDatabaseCorruptException: database disk image is malformed (code 11)\n       at com.couchbase.lite.internal.database.sqlite.SQLiteQueryCursor.nativeMoveToNext(SQLiteQueryCursor.java)\n       at com.couchbase.lite.internal.database.sqlite.SQLiteQueryCursor.moveToNext(SQLiteQueryCursor.java:58)\n       at com.couchbase.lite.storage.SQLiteStorageEngineBase$SQLiteCursor.moveToNext(SQLiteStorageEngineBase.java:257)\n       at com.couchbase.lite.store.SQLiteStore.getDocument(SQLiteStore.java:767)\n       at com.couchbase.lite.Database.getDocument(Database.java:1454)\n       at com.couchbase.lite.Document.getRevision(Document.java:308)\n       at com.couchbase.lite.Document.getCurrentRevision(Document.java:205)\n       at com.couchbase.lite.Document.getProperties(Document.java:255)\n       at com.droid4you.application.wallet.v3.memory.VogelRecord.getRecord(VogelRecord.java:50)\n       at com.droid4you.application.wallet.service.StandingOrderGeneratorService$1.onWork(StandingOrderGeneratorService.java:227)\n       at com.droid4you.application.wallet.v3.memory.Vogel.run(Vogel.java:244)\n       at com.droid4you.application.wallet.v3.memory.Vogel.run(Vogel.java:204)\n       at com.droid4you.application.wallet.service.StandingOrderGeneratorService$2.doInBackground(StandingOrderGeneratorService.java:240)\n       at com.droid4you.application.wallet.service.StandingOrderGeneratorService$2.doInBackground(StandingOrderGeneratorService.java:236)\n       at android.os.AsyncTask$2.call(AsyncTask.java:295)\n       at java.util.concurrent.FutureTask.run(FutureTask.java:237)\n       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)\n       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)\n       at java.lang.Thread.run(Thread.java:818)\n```\n"},"comment":{"url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/comments/264932155","html_url":"https://github.com/couchbase/couchbase-lite-android/issues/985#issuecomment-264932155","issue_url":"https://api.github.com/repos/couchbase/couchbase-lite-android/issues/985","id":264932155,"user":{"login":"hideki","id":15889,"avatar_url":"https://avatars.githubusercontent.com/u/15889?v=3","gravatar_id":"","url":"https://api.github.com/users/hideki","html_url":"https://github.com/hideki","followers_url":"https://api.github.com/users/hideki/followers","following_url":"https://api.github.com/users/hideki/following{/other_user}","gists_url":"https://api.github.com/users/hideki/gists{/gist_id}","starred_url":"https://api.github.com/users/hideki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hideki/subscriptions","organizations_url":"https://api.github.com/users/hideki/orgs","repos_url":"https://api.github.com/users/hideki/repos","events_url":"https://api.github.com/users/hideki/events{/privacy}","received_events_url":"https://api.github.com/users/hideki/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T18:17:56Z","updated_at":"2016-12-05T18:17:56Z","body":"Hi @mtrakal,\r\n\r\nCBL ported SQLiteDatabase classes from Android, and CBL use it to access SQLite internally. Android version of SQLiteDatabase class is implemented DatabaseErrorHandler, and it deletes the database file if it detects Database corruption. However, when we ported it into CBL, we removed that code as it hides the problem and we considered just deleting the database file is not right solution.\r\n\r\nWe will consider to provide the API to set DatabaseErrorHandler. \r\n\r\nThanks,\r\nHideki "}}
{"actor":{"display_login":"hideki"}}