QuiltServerTools / Ledger

A server-side logging mod for fabric 1.17+
https://www.quiltservertools.net/Ledger/latest/
GNU Lesser General Public License v3.0
190 stars 53 forks source link

Throw WARN sometimes #69

Closed Glucy-2 closed 3 years ago

Glucy-2 commented 3 years ago

Expected behavior

No WARNs or ERRORs.

Observed/actual behavior

WARN:

[Server] [01:31:30] [DefaultDispatcher-worker-2/WARN]: Transaction attempt #1 failed: org.sqlite.SQLiteException: [SQLITE_CORRUPT]  The database disk image is malformed (database disk image is malformed). Statement(s): INSERT INTO actions (action_id, extra_data, object_id, old_object_id, rolled_back, "source", "time", world_id, x, y, z) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
[Server] org.jetbrains.exposed.exceptions.ExposedSQLException: org.sqlite.SQLiteException: [SQLITE_CORRUPT]  The database disk image is malformed (database disk image is malformed)
[Server]        at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.java:62) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.sql.Transaction.exec(Transaction.java:129) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.sql.Transaction.exec(Transaction.java:115) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.sql.statements.Statement.execute(Statement.java:28) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.sql.QueriesKt.batchInsert(QueriesKt.java:134) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.sql.QueriesKt.batchInsert$default(QueriesKt.java:89) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.dao.EntityCache.flushInserts$exposed_dao(EntityCache.java:119) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.dao.EntityCache.flush(EntityCache.java:79) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.dao.EntityCache.flush(EntityCache.java:48) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.dao.EntityCacheKt.flushCache(EntityCacheKt.java:161) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.dao.EntityLifecycleInterceptor.beforeCommit(EntityLifecycleInterceptor.java:40) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.sql.Transaction.commit(Transaction.java:63) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.sql.transactions.experimental.SuspendedKt$suspendedTransactionAsyncInternal$1.invokeSuspend(SuspendedKt.java:117) [%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) [af536ab9-91eb-48d0-a168-eff675c274ba.jar:?]
[Server]        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) [bf32989f-e0ba-4ff1-9530-8c3560d37a97.jar:?]
[Server]        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) [bf32989f-e0ba-4ff1-9530-8c3560d37a97.jar:?]
[Server]        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) [bf32989f-e0ba-4ff1-9530-8c3560d37a97.jar:?]
[Server]        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) [bf32989f-e0ba-4ff1-9530-8c3560d37a97.jar:?]
[Server]        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665) [bf32989f-e0ba-4ff1-9530-8c3560d37a97.jar:?]
[Server] Caused by: org.sqlite.SQLiteException: [SQLITE_CORRUPT]  The database disk image is malformed (database disk image is malformed)
[Server]        at org.sqlite.core.DB.newSQLException(DB.java:1012) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.sqlite.core.DB.newSQLException(DB.java:1024) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.sqlite.core.DB.throwex(DB.java:989) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.sqlite.core.DB.executeBatch(DB.java:814) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.sqlite.core.CorePreparedStatement.executeBatch(CorePreparedStatement.java:64) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.sql.statements.jdbc.JdbcPreparedStatementImpl.executeBatch(JdbcPreparedStatementImpl.java:48) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.sql.statements.InsertStatement.execInsertFunction(InsertStatement.java:111) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.sql.statements.InsertStatement.executeInternal(InsertStatement.java:117) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.sql.statements.InsertStatement.executeInternal(InsertStatement.java:11) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.java:60) ~[%5B%E6%A0%B8%E5%BF%83%E4%BF%9D%E6%8A%A4%5D%20ledger-1.0.2.jar:?]
[Server]        ... 18 more
[Server] Exception in thread "DefaultDispatcher-worker-2" org.jetbrains.exposed.exceptions.ExposedSQLException: org.sqlite.SQLiteException: [SQLITE_CORRUPT]  The database disk image is malformed (database disk image is malformed)
[Server] SQL: [INSERT INTO actions (action_id, extra_data, object_id, old_object_id, rolled_back, "source", "time", world_id, x, y, z) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
[Server]        at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.java:62)
[Server]        at org.jetbrains.exposed.sql.Transaction.exec(Transaction.java:129)
[Server]        at org.jetbrains.exposed.sql.Transaction.exec(Transaction.java:115)
[Server]        at org.jetbrains.exposed.sql.statements.Statement.execute(Statement.java:28)
[Server]        at org.jetbrains.exposed.sql.QueriesKt.batchInsert(QueriesKt.java:134)
[Server]        at org.jetbrains.exposed.sql.QueriesKt.batchInsert$default(QueriesKt.java:89)
[Server]        at org.jetbrains.exposed.dao.EntityCache.flushInserts$exposed_dao(EntityCache.java:119)
[Server]        at org.jetbrains.exposed.dao.EntityCache.flush(EntityCache.java:79)
[Server]        at org.jetbrains.exposed.dao.EntityCache.flush(EntityCache.java:48)
[Server]        at org.jetbrains.exposed.dao.EntityCacheKt.flushCache(EntityCacheKt.java:161)
[Server]        at org.jetbrains.exposed.dao.EntityLifecycleInterceptor.beforeCommit(EntityLifecycleInterceptor.java:40)
[Server]        at org.jetbrains.exposed.sql.Transaction.commit(Transaction.java:63)
[Server]        at org.jetbrains.exposed.sql.transactions.experimental.SuspendedKt$suspendedTransactionAsyncInternal$1.invokeSuspend(SuspendedKt.java:117)
[Server]        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
[Server]        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
[Server]        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
[Server]        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
[Server]        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
[Server]        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
[Server] Caused by: org.sqlite.SQLiteException: [SQLITE_CORRUPT]  The database disk image is malformed (database disk image is malformed)
[Server]        at org.sqlite.core.DB.newSQLException(DB.java:1012)
[Server]        at org.sqlite.core.DB.newSQLException(DB.java:1024)
[Server]        at org.sqlite.core.DB.throwex(DB.java:989)
[Server]        at org.sqlite.core.DB.executeBatch(DB.java:814)
[Server]        at org.sqlite.core.CorePreparedStatement.executeBatch(CorePreparedStatement.java:64)
[Server]        at org.jetbrains.exposed.sql.statements.jdbc.JdbcPreparedStatementImpl.executeBatch(JdbcPreparedStatementImpl.java:48)
[Server]        at org.jetbrains.exposed.sql.statements.InsertStatement.execInsertFunction(InsertStatement.java:111)
[Server]        at org.jetbrains.exposed.sql.statements.InsertStatement.executeInternal(InsertStatement.java:117)
[Server]        at org.jetbrains.exposed.sql.statements.InsertStatement.executeInternal(InsertStatement.java:11)
[Server]        at org.jetbrains.exposed.sql.statements.Statement.executeIn$exposed_core(Statement.java:60)
[Server]        ... 18 more

Steps/models to reproduce

I don't know how it occurs.

What operating system are you running

Linux

Minecraft version

1.17.1

Ledger version

1.0.2

Logs

https://hastebin.com/qibapeyibo.pl

Agreements

Other

No response

PotatoPresident commented 3 years ago

disk image malformed most likely means the database is corrupted. There are many ways corruption can occur, but one common one I've seen is restoring a backup that was taken while the server is running. The database file in the world folder can become corrupted if it's backed up while the server is running because it is likely being written to. The SQLite command line tools has a built in backup command.

sqlite3 ledger.sqlite .backup backup_ledger.sqlite