PBH-BTN / PeerBanHelper

BT 反吸血工具 - 自动封禁不受欢迎、吸血和异常的 BT 客户端,并支持自定义规则。PeerId黑名单/UserAgent黑名单/IP CIDR/假进度/超量下载/进度回退/多播追猎/连锁封禁/伪装检测 支持 qBittorrent/Transmission/Deluge/BiglyBT/Vuze(Azureus)/BitComet
GNU General Public License v3.0
2.48k stars 81 forks source link

[BUG] Unable flush records into database #512

Closed yueisme closed 1 month ago

yueisme commented 1 month ago

版本号 - Version

6.2.8

操作系统平台和系统架构 - OS and CPU Arch

OS 名称: Microsoft Windows 11 专业版 OS 版本: 10.0.22631 暂缺 Build 22631

部署方式 - Deploy methods

添加的下载器 - Added Downloaders

问题描述 - Issue Description

查看日志发现有报错

复现步骤 - Reproduce steps

偶然出现的问题,不知道复现的办法

截图/日志文件 - Screenshot / Logs

[16:45:14] [/ERROR]: Unable flush records into database
org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (cannot start a transaction within a transaction)
    at org.sqlite.core.DB.newSQLException(DB.java:1179) ~[PeerBanHelper.jar:6.2.8]
    at org.sqlite.core.DB.newSQLException(DB.java:1190) ~[PeerBanHelper.jar:6.2.8]
    at org.sqlite.core.DB.throwex(DB.java:1150) ~[PeerBanHelper.jar:6.2.8]
    at org.sqlite.core.DB.exec(DB.java:198) ~[PeerBanHelper.jar:6.2.8]
    at org.sqlite.SQLiteConnection.setAutoCommit(SQLiteConnection.java:369) ~[PeerBanHelper.jar:6.2.8]
    at com.zaxxer.hikari.pool.ProxyConnection.setAutoCommit(ProxyConnection.java:402) ~[PeerBanHelper.jar:6.2.8]
    at com.zaxxer.hikari.pool.HikariProxyConnection.setAutoCommit(HikariProxyConnection.java) ~[PeerBanHelper.jar:6.2.8]
    at com.j256.ormlite.jdbc.JdbcDatabaseConnection.setAutoCommit(JdbcDatabaseConnection.java:61) ~[PeerBanHelper.jar:6.2.8]
    at com.j256.ormlite.stmt.StatementExecutor.doCallBatchTasks(StatementExecutor.java:646) ~[PeerBanHelper.jar:6.2.8]
    at com.j256.ormlite.stmt.StatementExecutor.doCallBatchTasks(StatementExecutor.java:623) ~[PeerBanHelper.jar:6.2.8]
    at com.j256.ormlite.stmt.StatementExecutor.callBatchTasks(StatementExecutor.java:603) ~[PeerBanHelper.jar:6.2.8]
    at com.j256.ormlite.dao.BaseDaoImpl.callBatchTasks(BaseDaoImpl.java:734) ~[PeerBanHelper.jar:6.2.8]
    at com.ghostchu.peerbanhelper.database.dao.impl.ProgressCheatBlockerPersistDao.flushDatabase(ProgressCheatBlockerPersistDao.java:56) ~[PeerBanHelper.jar:6.2.8]
    at com.ghostchu.peerbanhelper.module.impl.rule.ProgressCheatBlocker.flushDatabase(ProgressCheatBlocker.java:122) ~[PeerBanHelper.jar:6.2.8]
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
    at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358) ~[?:?]
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.base/java.lang.VirtualThread.run(VirtualThread.java:329) ~[?:?]

额外信息 - Addition Information

No response

检查清单 - Check list

Ghost-chu commented 1 month ago

删除 persist/peerbanhelper.db 数据库文件,重建db

yueisme commented 1 month ago

这是旧版本的数据引发的问题吗

yueisme commented 1 month ago

删除后封禁的数据被清空了,运行一段时间发现有解封的动作,但是封禁日志里看到最快的解封在10月

[17:48:35] [Ban Wave/INFO]: [解封] 解除了 1 个过期的对等体封禁
[17:51:00] [Ban Wave/INFO]: [解封] 解除了 1 个过期的对等体封禁
[17:54:40] [Ban Wave/INFO]: [解封] 解除了 1 个过期的对等体封禁
Ghost-chu commented 1 month ago

删除后封禁的数据被清空了,运行一段时间发现有解封的动作,但是封禁日志里看到最快的解封在10月

[17:48:35] [Ban Wave/INFO]: [解封] 解除了 1 个过期的对等体封禁
[17:51:00] [Ban Wave/INFO]: [解封] 解除了 1 个过期的对等体封禁
[17:54:40] [Ban Wave/INFO]: [解封] 解除了 1 个过期的对等体封禁

https://github.com/PBH-BTN/PeerBanHelper/pull/459