Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Docker 环境下无法启动,报 org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked) 错误 #725

Open
7 of 18 tasks
Luke-li-Chen opened this issue Nov 11, 2024 · 6 comments
Labels
waiting-reply 等待Issue/PR所有者回复

Comments

@Luke-li-Chen
Copy link

版本号 - Version

v7.1.4

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

AlmaLinux 9.4 x86_64 (基于 ESXi 的虚拟机)
Docker 27.3.1

部署方式 - Deploy methods

  • Windows .exe 安装程序 (Windows .exe Installer)
  • Windows .zip 绿色部署包 (Windows .zip Portable)
  • Docker
  • JAR 包直接启动 (Start via .JAR directly)
  • 群晖 DSM 套件 (Synology .spk package)
  • Debian 软件包 (Debian .deb package)
  • RedHat/Fedora 软件包 (RedHat/Fedora .rpm package)

添加的下载器 - Added Downloaders

  • qBittorrent
  • BiglyBT/Azureus/Vuze
  • Deluge
  • Transmission
  • BitComet

问题描述 - Issue Description

以 docker compose up 方式部署运行,无法启动,日志报错,随后无限重试。无法访问 web 页面

复现步骤 - Reproduce steps

docker-compose.yml 文件内容为:

version: "3.9"
services:
peerbanhelper:
image: "ghostchu/peerbanhelper:v7.1.4"
restart: unless-stopped
container_name: "peerbanhelper"
volumes:
- /home/luke/docker-data/peerbanhelper/data:/app/data
ports:
- "9898:9898"
environment:
- PUID=0
- PGID=0
- TZ=UTC

截图/日志文件 - Screenshot / Logs

peerbanhelper | [17:19:13] [main/INFO]: PeerBanHelper SQLite Connection Pool - Starting...
peerbanhelper | [17:19:14] [main/INFO]: PeerBanHelper SQLite Connection Pool - Added connection org.sqlite.jdbc4.JDBC4Connection@e700eba
peerbanhelper | [17:19:14] [main/INFO]: PeerBanHelper SQLite Connection Pool - Start completed.
peerbanhelper | [17:19:17] [main/WARN]: Failed to set optimized SQLite PRAGMA arguments
peerbanhelper | org.sqlite.SQLiteException: [SQLITE_BUSY] The database file is locked (database is locked)
peerbanhelper | at org.sqlite.core.DB.newSQLException(DB.java:1179)
(中间略)
peerbanhelper | [17:19:20] [main/WARN]: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseHelper' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/DatabaseHelper.class]: Failed to instantiate [com.ghostchu.peerbanhelper.database.DatabaseHelper]: Constructor threw exception
peerbanhelper | [17:19:20] [main/ERROR]: PeerBanHelper encountered fatal error during startup, unable to continue
peerbanhelper | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'databaseHelper' defined in URL [jar:file:/app/PeerBanHelper.jar!/com/ghostchu/peerbanhelper/database/DatabaseHelper.class]: Failed to instantiate [com.ghostchu.peerbanhelper.database.DatabaseHelper]: Constructor threw exception
peerbanhelper | at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:318)
peerbanhelper | at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:306)
(中间略)
peerbanhelper exited with code 1
log

额外信息 - Addition Information

我尝试了 7.1.4、7.1.3、7.0.0 三个版本,均报此错误。在同一台机器上使用 .sh 方式安装,则能正常运行。

检查清单 - Check list

  • PeerBanHelper 已更新到最新版本,非最新版本不接受任何错误反馈,任何非最新版本的 Issue 将被 立 刻 关 闭,不会有人给您提供任何支持 (I'm running the latest version of PBH that can be found in Github Relases, non-latest release won't receive any support)
  • 所添加的下载器已满足 README 中的前置要求(如版本号和插件)(The downloaders that I've added already satisfied the requirements (E.g install plugins/adapters))
  • 我已检查过 PBH 文档(特别是常见问题),且即使使用了搜索也没有找到与此有关的内容 (This not a question/or the question that not listed in README's FAQ or PBH WIKI)
  • 我没有检查这个检查清单,只是闭眼选中了所有的复选框,请关闭这个 Issue (I have not read these checkboxes and therefore I just ticked them all, Please close this issue)
  • 这不是一个安全漏洞,它可以被安全的公开报告。若需要报告安全漏洞,请在此报告 (This not a security related issue, can be safe report in public. If you want report a security exploit, please report it here)
  • 我同意遵守 PBH-BTN 包容性条约,不发布 “嘲讽、骂战、引战、开盒(有时也称为人肉搜索)、人身攻击、仇恨、暴力、侮辱性言辞、违法违规、黑灰产、危害国家安全、实施或帮助他人实施电信犯罪” 等内容。并已知晓如果仍旧发布了这些内容,我的账号将立刻从包括但不限于 PBH-BTN 组织、社交软件中封禁。所有主题、内容都将被立刻删除或折叠,撤销、删除和收回您所做出的一切贡献,并封禁 BTN 网络的中账号权限、排除您所提交的所有数据。在您违反相关规则时,PBH-BTN 将会将您的注册、登录、和最近访问的 IP 地址、电子邮件地址、以及其它可能追踪您或将您去匿名化的信息从定期删除转为永不删除,并在任何国家或地区的政府、公安机关或有关部门需要时无通知的提供这些数据。 (I agree to abide by the PBH-BTN Inclusivity Pact by not posting content such as “taunting, name-calling, war-mongering, open-boxing (sometimes referred to as mansplaining), personal attacks, hatred, violence, insulting language, illegal activities, black and grey business, endangering national security, and committing or assisting others in committing telecommunication crimes”. I am aware that if I continue to post such content, my account will be immediately banned from organizations including but not limited to PBH-BTN, social software. All topics and content will be immediately deleted or collapsed, all contributions will be revoked, deleted and retracted, and you will be banned from the BTN network and all data you have submitted will be excluded. In the event of a violation of these rules, PBH-BTN will delete your registration, login, and most recent IP address, email address, and any other information that may be used to track you or de-anonymize you from regular to permanent deletion, and will make this data available to the government, public security, or other relevant authorities without notice if they request it, no matter what country or region.)
@Ghost-chu
Copy link
Collaborator

Ghost-chu commented Nov 12, 2024

请不要同时运行两个 PeerBanHelper,其中一个会锁定 SQLite 数据库,因此另一个将无法访问。

使用 .sh 安装时,您可能已经将其安装为了系统服务,使用 systemctl status peerbanhelper.service 查看状态。

@Ghost-chu Ghost-chu added the waiting-reply 等待Issue/PR所有者回复 label Nov 12, 2024
@Luke-li-Chen
Copy link
Author

我并没有同时运行两个实例。查看服务状态,显示 Unit peerbanhelper.service could not be found。
我在另一台从未运行过 PeerBanHelper 的虚拟机上以 Docker 方式运行,结果出现了相同的错误。

@Ghost-chu
Copy link
Collaborator

数据目录挂SMB/NFS上了?

@Gaojianli
Copy link
Member

Gaojianli commented Nov 13, 2024 via email

@Ghost-chu
Copy link
Collaborator

我并没有同时运行两个实例。查看服务状态,显示 Unit peerbanhelper.service could not be found。 我在另一台从未运行过 PeerBanHelper 的虚拟机上以 Docker 方式运行,结果出现了相同的错误。

那你试试 PeerBanHelper.service

@azicen
Copy link

azicen commented Nov 19, 2024

遇到过相同的问题,我尝试将smb/cifs挂载路径作为pbh的数据目录,出现同样的错误。通过搜索引擎了解到,这可能是一个sqlite的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-reply 等待Issue/PR所有者回复
Projects
None yet
Development

No branches or pull requests

4 participants