Project

General

Profile

Actions

Bug #3397

closed

psql error when running rudder-init.sh

Added by Michael Gliwinski almost 11 years ago. Updated almost 11 years ago.

Status:
Released
Priority:
3
Category:
System techniques
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

Nothing critical, just a bit confusing.

When running rudder-init.sh to setup a server (2.5), and specifically when this script runs cf-agent, errors from psql are visible in the output:

R: @@DistributePolicy@@log_info@@root-DP@@root-distributePolicy@@00@@reports@@None@@2013-04-06 19:30:47+01:00##root@#slapd has been restarted
psql: FATAL:  password authentication failed for user "rudder" 
FATAL:  password authentication failed for user "rudder" 
password retrieved from file "/root/.pgpass" 
R: @@DistributePolicy@@result_repaired@@root-DP@@root-distributePolicy@@00@@reports@@None@@2013-04-06 19:30:47+01:00##root@#The Rudder Webapp configuration files were updated with a new SQL password
R: @@DistributePolicy@@result_repaired@@root-DP@@root-distributePolicy@@00@@reports@@None@@2013-04-06 19:30:47+01:00##root@#The Rudder PostgreSQL user account's password has been changed

This is a bit confusing as it appears there is nothing fatal about this error :) In fact it looks like output from psql command used in distributePolicy/1.0/passwordCheck.cf in bundle root_password_check_psql when defining class psql_cant_connect (I was able to reproduce the same errors when the password in .pgpass file is incorrect).

The command uses --output /dev/null option, but psql prints the error to stderr anyway.

Actions #1

Updated by Vincent MEMBRÉ almost 11 years ago

  • Category set to System techniques
  • Target version set to 2.4.5

If we can't connect to the psql database we enforce a new password to make Rudder use its database.

The two result repaired show that there had been a problem, but that the agent was able to fix it.

Maybe the message should should be clearer about the error?

I don't think we want an error report here, because we can fix it immediatly, which is the meaning of result_repaired.

I thinks this happening too in 2.4 server

Actions #2

Updated by Jonathan CLARKE almost 11 years ago

  • Status changed from New to 8
  • Assignee set to Vincent MEMBRÉ
  • Priority changed from N/A to 3

Vincent MEMBRÉ wrote:

If we can't connect to the psql database we enforce a new password to make Rudder use its database.

The two result repaired show that there had been a problem, but that the agent was able to fix it.

Maybe the message should should be clearer about the error?

Vincent, Michael's point is not that the "repaired" messages should not be displayed, but that the errors straight from PSQL should not be. Specifically these lines:

psql: FATAL:  password authentication failed for user "rudder" 
FATAL:  password authentication failed for user "rudder" 
password retrieved from file "/root/.pgpass" 

At least I think so - Michael, please correct me if I'm wrong.

If that is the case, we just need to redirect stderr to /dev/null, since we analyze error based on the return codehere. Can you implement the fix please?

Actions #3

Updated by Jonathan CLARKE almost 11 years ago

  • Status changed from 8 to Pending release
  • % Done changed from 0 to 100

Applied in changeset policy-templates:commit:bfbaa11a7c1b79ac7dba7c386d184b19888ef146.

Actions #4

Updated by Jonathan CLARKE almost 11 years ago

Applied in changeset policy-templates:commit:12b31315b63baccf08c82215eeacc451dc86cded.

Actions #5

Updated by Jonathan CLARKE almost 11 years ago

  • Pull Request set to https://github.com/Normation/rudder-techniques/pull/118
Actions #6

Updated by Matthieu CERDA almost 11 years ago

'tis a shame that psql has no quiet/silent output option...

I approve this PR.

Actions #7

Updated by Nicolas PERRON almost 11 years ago

  • Status changed from Pending release to Released
Actions

Also available in: Atom PDF