puppetlabs / puppetlabs/puppetlabs-postgresql
Dependency cycle when `postgresql::globals::encoding` is set
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 232
- Forks
- 610
- Avg merge
- 5d 23h
- Merged PRs (30d)
- 4
Description
Describe the Bug
While upgrading the module from 9.1.0 to 10.5.0 we ran into the issue of a dependency cycle, when setting a value for postgresql::globals::encoding.
Info: Applying configuration version '*****.puppetserver01-atm_10130-1e601b89123d47539e44cf03bd0dce23a8d9a166'
Error: Found 1 dependency cycle:
(Anchor[postgresql::server::service::begin::main] => Postgresql_psql[Set template1 encoding to UTF-8] => Postgresql::Server::Instance::Late_initdb[main] => Postgresql::Server::Instance::Initdb[main] => Postgresql_conf[port_for_instance_main] => Postgresql::Server::Instance::Service[main] => Anchor[postgresql::server::service::begin::main])
Expected Behavior
No dependency cycle.
Steps to Reproduce (hiera)
---
classes:
- postgresql::server
postgresql::globals::encoding: 'UTF-8'
Steps to Reproduce (docker)
docker run -it --rm ubuntu:22.04 bash
apt-get update
apt-get install -y wget
wget https://apt.puppetlabs.com/puppet-release-jammy.deb
dpkg -i puppet-release-jammy.deb
apt-get update
apt-get install -y puppet-agent
/opt/puppetlabs/bin/puppet module install puppetlabs-postgresql
/opt/puppetlabs/bin/puppet apply -e "
class { 'postgresql::globals': encoding => 'UTF-8', }
class { 'postgresql::server': }
"
Environment
- Module version 10.5.0
- Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04
Additional Context
Removing the value will compile and apply successful.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided Hiera or Docker reproduction and inspect the reported dependency cycle between Postgresql_psql, Postgresql_conf, the instance initialization resources, and the service anchors. Done means applying the configuration with postgresql::globals::encoding set to UTF-8 completes without a dependency cycle.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, ruby
- Domain
- databases, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100