Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get the dependency cycle error when create_admin is true. #767

Open
sbrowne-godaddy opened this issue Jul 24, 2024 · 0 comments
Open

I get the dependency cycle error when create_admin is true. #767

sbrowne-godaddy opened this issue Jul 24, 2024 · 0 comments

Comments

@sbrowne-godaddy
Copy link

On an existing 4.4 mongo cluster with a replica set and authentication on the PRIMARY node, with create_admin => true, I get the dependency cycle error shown below.

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 8.6.0
  • Ruby: 3.2.3 (puppetlabs distribution package)
  • Distribution: RHEL7, RHEL9
  • Module version: v6.0.1 tag

How to reproduce (e.g Puppet code you use)

Against an existing mongo node/cluster with a configured and working 'replset'.

  class { 'mongodb::globals':
    version             => "${package_version}.el${::facts['os']['release']['major']}",
    require             => Profile::Base::Repo[$mongodb_repo],
    manage_package_repo => false,
  }
  class { 'mongodb::server':
    auth             => true,
    verbose          => false,
    replset          => "${db_name}-repl",
    replset_members  => $replset_members,
    keyfile          => '/etc/mongodb-keyfile',
    key              => $replkey,
    create_admin     => true,
    admin_password   => $admin_pass,
    store_creds      => true,
    system_logrotate => 'reopen',
    bind_ip          => [ '0.0.0.0' ],
    require          => Class['mongodb::globals'],
  }
  class { 'mongodb::client':
    require => Class['mongodb::server'],
  }

When run against a node that is not the PRIMARY node, this works fine. When run against a node that is the PRIMARY node, the error seen below.

What are you seeing

Error: Found 1 dependency cycle:
(Mongodb_database[admin] => Mongodb::Db[admin] => Class[Mongodb::Server] => Class[Mongodb::Client] => Package[mongodb_client] => Mongodb_database[admin])\nTry the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz
Error: Failed to apply catalog: One or more resource dependency cycles detected in graph

What behaviour did you expect instead

I expect the puppet run to complete without errors, not having actually attempted to change anything as the admin database exists, as does the admin user with the provided credentials.

Output log

[[email protected] ~]$ /usr/bin/sudo puppet agent --test --environment bekar ; sudo systemctl stop puppet
Info: Refreshing CA certificate
Info: CA certificate is unmodified, using existing CA certificate
Info: Refreshing CRL
Info: CRL is unmodified, using existing CRL
Info: Using environment 'bekar'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Notice: Requesting catalog from puppet.arsrs.local:8140 (10.11.100.40)
Notice: Catalog compiled by puppet1.mel.arsrs.local
Info: Caching catalog for mongodb1.stag.reg.neustar.com
Info: Applying configuration version '[Migration from CREDNS to NSD. Staging configuration only.   - More work required to be a complete drop-in replacement for BIND though.   - We don't have a CREDNS solution for EL9, so default to NSD](http://gitlab1.mel.arsrs.local/sysop/puppet-policies/tree/c9c4665ac7ca6b0b151d7f8e89f3f84cddba6a52)'
Error: Found 1 dependency cycle:
(Mongodb_database[admin] => Mongodb::Db[admin] => Class[Mongodb::Server] => Class[Mongodb::Client] => Package[mongodb_client] => Mongodb_database[admin])\nTry the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz
Error: Failed to apply catalog: One or more resource dependency cycles detected in graph

Any additional information you'd like to impart

This issue appeared when migrating our old environment from EL7/Puppet5 to EL9/Puppet8. This module had to be updated in steps; ab148b5 being the intermediate commit where this all worked, followed by v6.0.1, where this error occurs.

It feels related to #746 but figured it would be rude to attach this there.

For now, I'm just setting the create_admin => false as it already exists in a working state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant