Jira (PDB-4597) Puppetdb module issues notice every run for postgresql-contrib with postgres11 (on Debian Buster)

12 views
Skip to first unread message

Matthew Lowy (JIRA)

unread,
Dec 5, 2019, 8:56:04 AM12/5/19
to puppe...@googlegroups.com
Matthew Lowy created an issue
 
PuppetDB / Bug PDB-4597
Puppetdb module issues notice every run for postgresql-contrib with postgres11 (on Debian Buster)
Issue Type: Bug Bug
Affects Versions: PDB 6.7.3
Assignee: Unassigned
Components: PuppetDB
Created: 2019/12/05 5:55 AM
Priority: Normal Normal
Reporter: Matthew Lowy

puppetlabs-puppetdb module (V7.4.0) installed on puppetserver 6.7.2 / puppetdb 6.7.3 both on Debian Buster attempts to install postgresql-contrib on every puppet agent run.

It looks like at Debian Buster / Postgresql 11 the postgresql-contrib package is called postgresql-contrib but puppetdb module is attempting to load postgresql-contrib-11 package.

Debug of agent run reports...

Debug: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/creates: Checking that 'creates' path '/var/lib/postgresql/11/main/PG_VERSION' exists
Debug: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]: '/usr/lib/postgresql/11/bin/initdb --pgdata '/var/lib/postgresql/11/main'' won't be executed because of failed check 'creates'
Debug: Executing: '/usr/bin/dpkg-query -W --showformat '${Status} ${Package} ${Version}\n' postgresql-contrib-11'
Debug: Executing: '/usr/bin/apt-get q -y -o DPkg::Options::=-force-confold install postgresql-contrib-11'
Notice: /Stage[main]/Postgresql::Server::Contrib/Package[postgresql-contrib]/ensure: created (corrective)

puppetserver / puppetdb / postgresql all installed on one server, installed from standard repos. Node configured to use existing Postgres11 install instead of default Postgres9.6 configured in puppetdb module by:

include puppetdb::server
class

{'puppetdb::database::postgresql': postgres_version => '11', }

include puppetdb::master::config

 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Matthew Lowy (JIRA)

unread,
Dec 5, 2019, 10:34:04 AM12/5/19
to puppe...@googlegroups.com
Matthew Lowy commented on Bug PDB-4597
 
Re: Puppetdb module issues notice every run for postgresql-contrib with postgres11 (on Debian Buster)

Sorry, opened a little too early... this issue appears to relate to Postgresql module not the puppetdb module, I mis-created it by getting in too soon.

I've now identified what looks like the root cause of the issue and it's not puppetdb module, it's the postgresql module. In Debian, for Postgresql-11 there is no 'real' postgresql-contrib-11 packages, it's been subsumed into postgresql package instead. postgresql-contrib is a virtual package that doesn't point to postgresql-contrib-11 but points to postgresql-11 instead. puppetlabs-postgresql module assumes for Debian that postgres-contrib requires version number appending to identify the package name and this isn't true for version 11 (was true for 9.6 and before). If 'params.pp' in puppetlabs-postgresql (version 6.2.0) at about line 175 is modified to only append version if it's not 11 (or perhaps below 11... who knows, Debian haven't packaged postgresql 12 yet)) issue is resolved. As are various other knock-on issues with the database restarting.

 

For me the below worked... sorry, not diff, just edited the code... replacing line 175 with the block below it.

#$contrib_package_name = pick($contrib_package_name, "postgresql-contrib-${version}")
if $version == "11"

{ $contrib_package_name = pick($contrib_package_name, "postgresql-contrib") }

else {
$contrib_package_name = pick($contrib_package_name, "postgresql-contrib-${version}")
}

 

May be neater for Debian / postgresql11 (the Buster default version of postgresql) to just skip that file, but that involves more understanding of the puppetlabs-postgresql module than I have.

Koen Dierckx (Jira)

unread,
Sep 2, 2021, 2:49:03 AM9/2/21
to puppe...@googlegroups.com
Koen Dierckx commented on Bug PDB-4597

We solved by setting the parameter through hiera

postgresql::globals::contrib_package_name: postgresql-contrib

But the correct solution is to fix the default package name inside the manifest code

(we are running Ubuntu 20.04)

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

David McTavish (Jira)

unread,
Jan 12, 2022, 7:25:02 PM1/12/22
to puppe...@googlegroups.com
David McTavish updated an issue
 
Change By: David McTavish
Labels: has_workaround
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

David McTavish (Jira)

unread,
Jan 12, 2022, 7:25:02 PM1/12/22
to puppe...@googlegroups.com

David McTavish (Jira)

unread,
Feb 10, 2022, 10:10:02 AM2/10/22
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages