Skip to content

bug: 备份恢复时崩溃 #10

Closed
Closed

Description

@chanho0
## 问题描述 | Problem Description

从 **RikkaHub 2.4.1** 备份,恢复至 **RikkaHub-Agent 2.4.1-0** 后,无法进入 App,启动即崩溃。

### 崩溃日志

```text
Thread: main
android.database.sqlite.SQLiteException: duplicate column name: custom_system_prompt (code 1): , while compiling: ALTER TABLE ConversationEntity ADD COLUMN custom_system_prompt TEXT NOT NULL DEFAULT ''
 at io.requery.android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
 at io.requery.android.database.sqlite.SQLiteConnection.acquirePreparedStatement(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:23)
 at io.requery.android.database.sqlite.SQLiteConnection.prepare(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:12)
 at io.requery.android.database.sqlite.SQLiteSession.prepare(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:13)
 at io.requery.android.database.sqlite.SQLiteProgram.<init>(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:44)
 at io.requery.android.database.sqlite.SQLiteStatement.<init>(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:2)
 at io.requery.android.database.sqlite.SQLiteDatabase.compileStatement(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:7)
 at io.requery.android.database.sqlite.SQLiteDatabase.compileStatement(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:19)
 at androidx.sqlite.driver.SupportSQLiteStatement$OtherSQLiteStatement.<init>(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:13)
 at androidx.sqlite.driver.SupportSQLiteConnection.prepare(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:347)
 at androidx.sqlite.SQLite.execSQL(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:4)
 at me.rerere.rikkahub.data.db.AppDatabase_AutoMigration_1_2_Impl.migrate(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:1434)
 at okio.FileMetadata.onMigrate(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:189)
 at androidx.room.RoomConnectionManager$SupportOpenHelperCallback.onUpgrade(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:11)
 at io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory$CallbackSQLiteOpenHelper.onUpgrade(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:3)
 at io.requery.android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:190)
 at io.requery.android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:3)
 at io.requery.android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:12)
 at androidx.paging.HintHandler.open(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:73)
 at androidx.work.Worker$$ExternalSyntheticLambda0.invoke(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:131)
 at kotlin.SynchronizedLazyImpl.getValue(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:21)
 at androidx.room.coroutines.PassthroughConnectionPool.useConnection(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:31)
 at androidx.room.RoomDatabase.useConnection(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:9)
 at androidx.room.util.DBUtil__DBUtil_androidKt$performBlocking$1$1.invokeSuspend(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:47)
 at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:8)
 at kotlinx.coroutines.DispatchedTask.run(r8-map-id-5523d99f76c5a86879f805b58526e251c32e707fc737ac2d46f9429da2b3b43b:114)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
 at java.lang.Thread.run(Thread.java:1012)
 Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@3c24cd8, Dispatchers.Main.immediate]

关键错误:

SQLiteException: duplicate column name: custom_system_prompt
ALTER TABLE ConversationEntity ADD COLUMN custom_system_prompt TEXT NOT NULL DEFAULT ''

触发位置: AppDatabase_AutoMigration_1_2_Impl.migrate


期望行为 | Expected Behavior

能够从原版 RikkaHub 2.4.1 备份成功恢复至 RikkaHub-Agent 2.4.1-0,正常进入 App。


截图 | Screenshots

崩溃截图

环境信息 | Environment

项目 信息
提供商 (Provider) —
模型 (Model) —
接口类型 (API Type) None
APP 版本 2.4.1
安卓版本 Android 15
手机型号 OnePlus 13

Activity

  1. ExTV commented on Jul 13, 2026

    @ExTV
    Owner

    Fixed in v2.4.1-agent.2.

    The crash came from a database schema-version mismatch. A backup exported by the original RikkaHub is stamped with a lower internal DB version than this fork uses, so on import the app replayed a migration that re-added a column the backup already had (custom_system_prompt) and then crashed on every launch.

    To recover: install v2.4.1-agent.2, then import your backup again. It now restores and opens normally.

    Note: backups from RikkaHub versions older than 2.4 may still not import cleanly. If you hit that, update the original RikkaHub to a current version and export a fresh backup first.

    Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions