Closed asifiqbal closed 3 years ago
@asifiqbal hi, thanks for the report! I investigated a little bit.
There's no artificial exceptions thrown around this functionality (and in general containing this message).
The dump functionality is implemented via
503 def do_with_password(module, cmd, password):
504 env = {}
505 if password:
506 env = {"PGPASSWORD": password}
507 executed_commands.append(cmd)
508 rc, stderr, stdout = module.run_command(cmd, use_unsafe_shell=True, environ_update=env)
509 return rc, stderr, stdout, cmd
This runs pg_dump
via shell and return pg_dump
s stderr when the command fails
653 if rc != 0:
654 module.fail_json(msg=stderr, stdout=stdout, rc=rc, cmd=cmd)
pg_dump: [archiver (db)] connection to database \"jira\" failed: FATAL: password authentication failed for user \"jirauser\"\nFATAL: password authentication failed for user \"jirauser\"\n
it is definitely thrown by pg_dump
.
@asifiqbal could you try
1) to do the same on your server directly via shell using bare pg_dump
, the user, password, host, and dump location just to see what will happen?
2) i tried this with PostgreSQL 13 on Fedora33, got only filename: Permission denied
. It can also be related to RDS. I don't use it but there were reports related to databases on RDS because they are internally customized.
@asifiqbal could you please look at my previous comment and give feedback? Thanks!
as no response, I'll close the issue. We could reopen it if there are any updates.
SUMMARY
When no permission to write on target during dump, postgresql_db gives wrong error message "FATAL: password authentication failed for user". It works fine when become: yes
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
STEPS TO REPRODUCE
$ ansible-playbook --tags database playbooks/dev/jira_refresh.yml
EXPECTED RESULTS
When I uncomment become: yes, the task runs fine.
ACTUAL RESULTS