PostgreSQL backup running infinitely #940
Labels
No labels
blocked
breaking
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
borgmatic-collective/borgmatic#940
Loading…
Reference in a new issue
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_directoriesin 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 2and 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_patternsin borgmatic's configuration.Hello @witten! Thanks for the suggestions. I'm not sure what was causing the issue, but it resolved after changing the backup time to a different one.
I'm glad to hear it's working now! If this starts happening again though, feel free to reopen the ticket.