Skip to content

Commit

Permalink
[pulpcore] psql: error: FATAL: password authentication failed for use…
Browse files Browse the repository at this point in the history
…r "pulp"

Signed-off-by: Pablo Fernández Rodríguez <[email protected]>
  • Loading branch information
pafernanr authored and arif-ali committed Feb 14, 2025
1 parent 06379ff commit c506cee
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sos/report/plugins/pulpcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class PulpCore(Plugin, IndependentPlugin):
dbhost = "localhost"
dbport = 5432
dbname = "pulpcore"
dbuser = "pulp"
dbpasswd = ""
staticroot = "/var/lib/pulp/assets"
uploaddir = "/var/lib/pulp/media/upload"
Expand Down Expand Up @@ -66,6 +67,8 @@ def separate_value(line, sep=':'):
self.dbport = separate_value(line)
if databases_scope and match(pattern % 'NAME', line):
self.dbname = separate_value(line)
if databases_scope and match(pattern % 'USER', line):
self.dbuser = separate_value(line)
if databases_scope and match(pattern % 'PASSWORD', line):
self.dbpasswd = separate_value(line)
# if line contains closing '}' database_scope end
Expand Down Expand Up @@ -148,8 +151,9 @@ def build_query_cmd(self, query, csv=False):
if csv:
query = f"COPY ({query}) TO STDOUT " \
"WITH (FORMAT 'csv', DELIMITER ',', HEADER)"
_dbcmd = "psql --no-password -h %s -p %s -U pulp -d %s -c %s"
return _dbcmd % (self.dbhost, self.dbport, self.dbname, quote(query))
_dbcmd = "psql --no-password -h %s -p %s -U %s -d %s -c %s"
return _dbcmd % (self.dbhost, self.dbport,
self.dbuser, self.dbname, quote(query))

def postproc(self):
# obfuscate from /etc/pulp/settings.py and "dynaconf list":
Expand Down

0 comments on commit c506cee

Please sign in to comment.