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

Systemd dependencies cycle with rabbitmq and rabbitmq-exporter #434

Closed
gokuatkai opened this issue Feb 28, 2020 · 5 comments
Closed

Systemd dependencies cycle with rabbitmq and rabbitmq-exporter #434

gokuatkai opened this issue Feb 28, 2020 · 5 comments

Comments

@gokuatkai
Copy link

Hello,
I am not sure if this is a puppet-prometheus or a puppet-rabbitmq issue but I am having a dependency cycle using them both:
puppet-server: 2.8.1
puppet: 4.10.12
puppet-rabbitmq: 8.5.0
puppet-prometheus: 6.4.0
system: centos7

My manifest is has followed (The prometheus exporter should be added after Rabbitmq, that is why I have a require in the 'prometheus::rabbitmq_exporter' class)

node /^rabbitmq-node-.*.org$/ {
    class { 'rabbitmq':
        [some_config]
    } ->
    rabbitmq_vhost {
        'some-vhost': [...];
    } ->
    rabbitmq_policy {
        'some-policy': [...];
    } ->
    rabbitmq_user {
        'some_user': [...];
    } ->
    rabbitmq_user_permissions {
        'some_user_perms': [...];
    }
    rabbitmq_plugin {
        some_plugin': [...];
    }

    class { 'prometheus::rabbitmq_exporter':
        [some_config]
        require => Class['rabbitmq']
    }
}

The error that I have is:

Error: Failed to apply catalog: Found 1 dependency cycle:
(Exec[systemctl-daemon-reload] => Class[Systemd::Systemctl::Daemon_reload] => Service[rabbitmq-server] => Class[Rabbitmq::Service] => Class[Rabbitmq] => Class[Prometheus::Rabbitmq_exporter] => Prometheus::Daemon[rabbitmq_exporter] => Systemd::Unit_file[rabbitmq_exporter.service] => File[/etc/systemd/system/rabbitmq_exporter.service] => Class[Systemd::Systemctl::Daemon_reload] => Exec[systemctl-daemon-reload])

Any ideas ?

@jakubjakubik
Copy link

I've noticed the same error with other services that use the class Class[Systemd::Systemctl::Daemon_reload] so this is not limited to rabbitmq

@gdubicki
Copy link
Member

I did a quick workaround in https://github.com/egnyte/puppet-prometheus/tree/v10.0.0_workaround_434 but I am not sure if it doesn't have side effects yet, so it's definitely not ready to create a PR.

@alexjfisher
Copy link
Member

You could be less strict with your relationships. You probably don't actually need every resource declared in the exporter (and specifically the unit_file) to come after every resource in rabbitmq.

Something like

class { 'prometheus::rabbitmq_exporter':
  ...
  require => Class['rabbitmq::service'],
}

will probably break the dependency cycle.

@gdubicki
Copy link
Member

I think that less ordering won't help, @alexjfisher .

Because in our code we do not have any ordering between the class that contains prometheus::rabbitmq_exporter and the rabbitmq resources and we still had this dependency cycle.

gdubicki pushed a commit to egnyte/puppet-prometheus that referenced this issue Feb 28, 2021
@TheMeier
Copy link
Contributor

TheMeier commented Jun 3, 2024

I think this is obsolete and only affects outdated puppet versions. Pleas re-open the issue if I am wrong.

@TheMeier TheMeier closed this as completed Jun 3, 2024
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

Successfully merging a pull request may close this issue.

5 participants