puppet-postgres error

296 views
Skip to first unread message

Rajesh Taneja

unread,
Jul 14, 2014, 2:35:29 AM7/14/14
to puppet...@googlegroups.com
While running puppet agent, I am getting following error. Can someone help me understand what might be wrong.

Warning: Exec[validate postgres connection for /postgres](provider=posix): Cannot understand environment setting "PGPASSWORD="
Warning: Exec[validate postgres connection for /postgres](provider=posix): Cannot understand environment setting "PGPASSWORD="
Notice: /Stage[main]/Postgresql::Server::Service/Postgresql::Validate_db_connection[validate_service_is_running]/Exec[validate postgres connection for /postgres]/returns: Unable to connect to defined database using: /usr/bin/psql --tuples-only --quiet -h  -U  -p  --dbname postgres 
Error: echo 'Unable to connect to defined database using: /usr/bin/psql --tuples-only --quiet -h  -U  -p  --dbname postgres ' && false returned 1 instead of one of [0]
Error: /Stage[main]/Postgresql::Server::Service/Postgresql::Validate_db_connection[validate_service_is_running]/Exec[validate postgres connection for /postgres]/returns: change from notrun to 0 failed: echo 'Unable to connect to defined database using: /usr/bin/psql --tuples-only --quiet -h  -U  -p  --dbname postgres ' && false returned 1 instead of one of [0]

Felix Frank

unread,
Jul 15, 2014, 4:41:24 PM7/15/14
to puppet...@googlegroups.com
Hi,

it would be helpful to see the manifest that declares the Exec[validate postgres connection for /postgres].

For debugging, the easiest approach is pasting the failing commands to a shell.

Regards,
Felix
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d4866842-9ae8-4ade-89c9-34aa9e82e074%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hunter Haugen

unread,
Jul 15, 2014, 5:29:49 PM7/15/14
to puppet-users
The validate_db_connection would come from https://github.com/puppetlabs/puppetlabs-postgresql#resource-postgresqlvalidate_db_connection which is declared by the postgresql::server -> postgresql::server::service class https://github.com/puppetlabs/puppetlabs-postgresql/blob/master/manifests/server/service.pp#L29 . The exec is https://github.com/puppetlabs/puppetlabs-postgresql/blob/master/manifests/validate_db_connection.pp#L51

So it appears that the service tries to start but isn't accepting connections via the psql command? There isn't enough information in the pasted errors to tell why though. One thing that is weird is the "-h  -U  -p  " arguments with double spaces, indicating that a hostname/user/password is blan, so that might be why (even though this code is supposed to guard against it https://github.com/puppetlabs/puppetlabs-postgresql/blob/master/manifests/validate_db_connection.pp#L23-L34).

What version of puppetlabs-postgresql is this?





-Hunter


Huaqing Zheng

unread,
Jul 31, 2014, 7:09:33 PM7/31/14
to puppet...@googlegroups.com
I'm hitting the same issue with module version 3.4.1 and postgres version 9.3.

Looking at these selector statements:

  $cmd_host = $database_host ? {
    default => "-h ${database_host} ",
    undef   => "",
  }


Shoudln't undef be before default?





For more options, visit https://groups.google.com/d/optout.



--
Huaqing Zheng
Code Wrangler

sinc

unread,
Jan 27, 2015, 8:37:13 AM1/27/15
to puppet...@googlegroups.com
Hello huasome,

did you have find a solution ?
(I have the same issue)
Reply all
Reply to author
Forward
0 new messages