Troubles to setup postgresql dump #550
Labels
No Label
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#550
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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
want to backup all local databases of postgresql. But failing.
Not sure if ISO layer 8 problem or really a bug.
Hope someone can help?
Steps to reproduce
config.yml
created a
~/.pgpass
tried password also in config.yml without success
run
Actual behavior (if a bug)
Expected behavior (if a bug)
to process the backups of all databases
if executing
pg_dumpall creates the database dumps and finishes successfully
Other notes / implementation ideas
Environment
borgmatic version: [version here]
borgmatic installation method: [e.g., Debian package, Docker container, etc.]
pip3
Borg version: [version here]
Python version: [version here]
Database version (if applicable): [version here]
but tried also with 10
operating system and version: [OS here]
ubuntu 20.04 x64
I'm really not sure what might be going on here, especially since the
pg_dumpall
invocations run by borgmatic and manually without borgmatic look pretty identical. Here are some ideas for things to try:~/.pgpass
as well, but I wonder if perhaps the database password in borgmatic's configuration file is incorrect. It's possible there's an issue with YAML misinterpreting a character in your password (say, a backslash) and passing a different password string to Postgres than intended.pg_hba.conf
. Are you perhaps using something likepeer
instead ofmd5
for the auth method forlocal
connections?Hi @witten,
thank you for your feedback
tried to change the password without special chars => no success on
checked pg_hba.conf
looks also good to me
is there a way to reproduce all steps? Parior to
for me it is not clear how the login context is switche
found one issue:
if I run
as the same user as the borgmatic (in current case root) the command is failing with the above error message.
for both .pgpass and config.yaml is set
Any hints?
to exclude ISO layer 8 problems, I did
changed to new password in .pgpass and in config.yaml
finally found the issue
needed to add hostname: localhost to the config and the process went through. Not obvious to me, but works now
Glad to hear it's working now! I think the way the
peer
auth method works is that it checks the current Unix user. So if you're running borgmatic as root, yeah, that first line inpg_hba.conf
won't work, since you need to auth to your database as userpostgres
.When you added
hostname
to borgmatic's configuration, I think what that did was switch to using the third line of yourpg_hba.conf
since it's now a TCP connection rather than a local one.