You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: backup locks the MySQL database and takes the panel down #961
I searched existing issues and did not find the same problem.
I am using the latest available PasarGuard version, or I included the exact version below.
PasarGuard version
5.4.1
Installation type
Docker Compose
What happened?
On a MySQL setup, pasarguard backup runs mysqldump without --single-transaction, so it takes a table READ lock for the whole dump. On a large DB the lock lasts minutes and blocks all writes: the panel becomes unresponsive (Cloudflare 521) and nodes/users drop until the backup finishes.
Steps to reproduce
Use MySQL as the database.
Run pasarguard backup (or the nightly cron) while the panel is in use.
During the dump, writes are blocked and the panel returns 521 until it finishes.
Expected behavior
mysqldump should run with --single-transaction so the backup takes a consistent InnoDB snapshot without locking the database, and the panel stays up during backup.
Logs and error messages
mysqldump warning during backup:
"In order to ensure a consistent backup of the database, pass --single-transaction or --lock-all-tables or --source-data."
Environment
OS: Ubuntu 26
Database: MySQL
Relevant configuration
Screenshots or videos
No response
Additional context
Note: the backup code lives in the PasarGuard/scripts repo → lib/pasarguard-backup.sh,
where mysqldump is called as: mysqldump ... --databases --events --triggers (no --single-transaction).
Adding --single-transaction there fixes it — it's InnoDB-safe and automatically turns off --lock-tables,
so it's a one-flag change with no downside for the panel's schema.
Opened a fix in PasarGuard/scripts#49: every mysqldump / mariadb-dump call in pasarguard backup (seven of them) now runs with --single-transaction, so the dump reads a consistent InnoDB snapshot instead of locking the tables and the panel keeps serving while a backup runs. It carries the same script change as PasarGuard/scripts#40 (closed without merging), rebased on current main, plus a unit test that fails if any dump call loses the flag.
Activity
JavadMoqaddam commentedon Nov 23, 2026
Opened a fix in PasarGuard/scripts#49: every
mysqldump/mariadb-dumpcall inpasarguard backup(seven of them) now runs with--single-transaction, so the dump reads a consistent InnoDB snapshot instead of locking the tables and the panel keeps serving while a backup runs. It carries the same script change as PasarGuard/scripts#40 (closed without merging), rebased on currentmain, plus a unit test that fails if any dump call loses the flag.