puppetlabs-puppetdb icon indicating copy to clipboard operation
puppetlabs-puppetdb copied to clipboard

Error adding extension to PostgresSQL database with custom port

Open qingbo opened this issue 8 years ago • 3 comments

Seeing this error with custom port:

Error: /Stage[main]/Puppetdb::Database::Postgresql/Postgresql::Server::Extension[pg_trgm]/Postgresql_psql[Add pg_trgm extension to puppetdb]: Could not evaluate: Error evaluating 'unless' clause, returned pid 26843 exit 2: 'psql: FATAL:  database "puppetdb" does not exist
'

OS: CentOS 7.3.1611 Module versions: mod 'puppetlabs/puppetdb', '6.0.1' mod 'puppetlabs/postgresql', '5.1.0'

qingbo avatar Sep 25 '17 03:09 qingbo

The problem is probably something else. The error states that the database is not found. Does it work in a second run?

The dependency to the database is missing. This should be explicitly added. postgresql::server::extension does not add the dependency automatically, because the database is definded below, after the extension, so the defined() check does not work. https://github.com/puppetlabs/puppetlabs-postgresql/blob/34aa0affa233e04a25c3b4d130e6db867bff08bd/manifests/server/extension.pp#L48-L50

    postgresql::server::extension { 'pg_trgm':
      database  => $database_name,
      require   => Postgresql::Server::Db[$database_name],
    }

pgassmann avatar Oct 18 '17 15:10 pgassmann

@pgassmann : it does work in a second run (although it seems that puppetdb fails to start unless you set disable_ssl to true and match listen_address with puppet::master::config (defaults don't match), but that's probably unrelated to this issue)

akomakom avatar Oct 31 '17 19:10 akomakom

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Qingbo Zhou seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Feb 24 '21 17:02 CLAassistant