org.gnucash.android.importer.ImportAsyncTask: FOREIGN KEY constraint failed (code 787) 10:11:47.569 E/CrashlyticsCore: Crashlytics must be initialized by calling Fabric.with(Context) prior to logging messages. 10:11:47.569 E/CrashlyticsCore: Crashlytics must be initialized by calling Fabric.with(Context) prior to logging exceptions. 10:11:47.570 W/System.err: android.database.sqlite.SQLiteConstraintException: FOREIGN KEY constraint failed (code 787) 10:11:47.606 W/System.err: at android.database.sqlite.SQLiteConnection.nativeExecute(Native Method) 10:11:47.606 W/System.err: at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:559) 10:11:47.606 W/System.err: at android.database.sqlite.SQLiteSession.execute(SQLiteSession.java:619) 10:11:47.606 W/System.err: at android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:44) 10:11:47.606 W/System.err: at org.gnucash.android.db.adapter.DatabaseAdapter.doAddModels(DatabaseAdapter.java:260)

GitHub | rivaldi8 | 4 months ago
  1. 0

    787 foreign key constraint error caused by unfixed balance split

    GitHub | 4 months ago | rivaldi8
    org.gnucash.android.importer.ImportAsyncTask: FOREIGN KEY constraint failed (code 787) 10:11:47.569 E/CrashlyticsCore: Crashlytics must be initialized by calling Fabric.with(Context) prior to logging messages. 10:11:47.569 E/CrashlyticsCore: Crashlytics must be initialized by calling Fabric.with(Context) prior to logging exceptions. 10:11:47.570 W/System.err: android.database.sqlite.SQLiteConstraintException: FOREIGN KEY constraint failed (code 787) 10:11:47.606 W/System.err: at android.database.sqlite.SQLiteConnection.nativeExecute(Native Method) 10:11:47.606 W/System.err: at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:559) 10:11:47.606 W/System.err: at android.database.sqlite.SQLiteSession.execute(SQLiteSession.java:619) 10:11:47.606 W/System.err: at android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:44) 10:11:47.606 W/System.err: at org.gnucash.android.db.adapter.DatabaseAdapter.doAddModels(DatabaseAdapter.java:260)

    Root Cause Analysis

    1. org.gnucash.android.importer.ImportAsyncTask

      FOREIGN KEY constraint failed (code 787) 10:11:47.569 E/CrashlyticsCore: Crashlytics must be initialized by calling Fabric.with(Context) prior to logging messages. 10:11:47.569 E/CrashlyticsCore: Crashlytics must be initialized by calling Fabric.with(Context) prior to logging exceptions. 10:11:47.570 W/System.err: android.database.sqlite.SQLiteConstraintException: FOREIGN KEY constraint failed (code 787) 10:11:47.606 W/System.err: at android.database.sqlite.SQLiteConnection.nativeExecute(Native Method) 10:11:47.606 W/System.err: at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:559) 10:11:47.606 W/System.err: at android.database.sqlite.SQLiteSession.execute(SQLiteSession.java:619) 10:11:47.606 W/System.err: at android.database.sqlite.SQLiteStatement.execute(SQLiteStatement.java:44) 10:11:47.606 W/System.err: at org.gnucash.android.db.adapter.DatabaseAdapter.doAddModels(DatabaseAdapter.java:260)

      at org.gnucash.android.db.adapter.DatabaseAdapter.bulkAddRecords()
    2. org.gnucash.android
      GncXmlHandler.endDocument
      1. org.gnucash.android.db.adapter.DatabaseAdapter.bulkAddRecords(DatabaseAdapter.java:298)
      2. org.gnucash.android.db.adapter.TransactionsDbAdapter.bulkAddRecords(TransactionsDbAdapter.java:160)
      3. org.gnucash.android.importer.GncXmlHandler.saveToDatabase(GncXmlHandler.java:1000)
      4. org.gnucash.android.importer.GncXmlHandler.endDocument(GncXmlHandler.java:967)
      4 frames
    3. Android
      ExpatReader.parse
      1. org.apache.harmony.xml.ExpatParser.endDocument(ExpatParser.java:532)
      2. org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:476)
      3. org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:316)
      4. org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:279)
      4 frames
    4. org.gnucash.android
      ImportAsyncTask.doInBackground
      1. org.gnucash.android.importer.GncXmlImporter.parse(GncXmlImporter.java:69)
      2. org.gnucash.android.importer.ImportAsyncTask.doInBackground(ImportAsyncTask.java:85)
      3. org.gnucash.android.importer.ImportAsyncTask.doInBackground(ImportAsyncTask.java:49)
      3 frames
    5. Android Platform
      AsyncTask$2.call
      1. android.os.AsyncTask$2.call(AsyncTask.java:288)
      1 frame
    6. Java RT
      FutureTask.run
      1. java.util.concurrent.FutureTask.run(FutureTask.java:237)
      1 frame
    7. Android Platform
      AsyncTask$SerialExecutor$1.run
      1. android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
      1 frame
    8. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
      3. java.lang.Thread.run(Thread.java:818)
      3 frames