PostgreSQL backup running infinitely #940
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
Hello, I'm trying to back up PostgreSQL. It usually takes about 20 minutes, but sometimes it hangs indefinitely. It's been about 10 hours since the last backup started, and it is still running. There is no disk or network activity, and it seems like nothing is happening. Here is the log:
Steps to reproduce
borgmatic create --verbosity 2 --list --stats --conf borgmatic_postgres.example.com.yaml
Actual behavior
After 10 hours backup is still not finished
Expected behavior
Backup finished in 20 minutes
Other notes / implementation ideas
No response
borgmatic version
1.8.3
borgmatic installation method
pipx install borgmatic
Borg version
1.2.8
Python version
Python 3.12.3
Database version (if applicable)
PostgreSQL 14.6
Operating system and version
Ubuntu 22.04.5 LTS
Thanks for the detailed ticket. Normally I'd presume that Borg is hanging on a special file unrelated to the database dump, but it looks like you don't even have any
source_directories
in your configuration. So if there is a hang related to a special file, it's got to be on one of the database dumps itself. So two ideas:rm -fr ~/.borgmatic/postgresql_databases
. There shouldn't be any stale named pipes, because they get cleaned up automatically. But there could be a bug preventing that from happening.all
, try dumping one or a handful of databases at a time to see if the hang starts happening on a particular database.Another idea: Is it possible that the borgmatic runtime directory happens to be listed in your exclude patterns? This was the issue discovered in #947, and the fix for it will be in the next release. But in the meantime, if this is the issue you're having, you can work around it by removing the borgmatic runtime directory from your excludes.
To find out what borgmatic runtime directory is being used, run borgmatic with
--verbosity 2
and look for something like the following:And then make sure that path (or a parent directory of it) isn't listed in, for instance,
exclude_patterns
in borgmatic's configuration.