-
Notifications
You must be signed in to change notification settings - Fork 290
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
Using rabbitmq_cluster works only the first time puppet runs #598
Comments
|
I can confirm that I am having the same issue. I tried using a forked module with johanek's pull request above, but I still get the same error: "Could not evaluate: no implicit conversion of String into Integer " after the rabbitmq.json file has already been generated. I am also on Debian Jesse. |
|
@b-0-b @csoleimani are you setting values for any |
|
@cwjohnston , I checked a previous revision of our code and the only rabbitmq parameter that was being passed was rabbitmq_cluster - I can post what my code looked like if you'd like. |
|
@csoleimani please share your code. Myself and others have used rabbitmq_cluster parameter successfully so whatever code you can share may help us identify the delta. |
|
Sure, here is some of the code below. I'm only pasting the important stuff rather than the whole manifest. |
|
Hi, I tried to do it all in hiera sensu::rabbitmq_cluster:
- port: 5671
host: 192.168.113.9
user: sensu
password: password
vhost: "sensu"
ssl: {
cert_chain_file: "/etc/sensu/ssl/cert.pem",
private_key_file: "/etc/sensu/ssl/key.pem"
}
- port: 5671
host: 192.168.113.10
user: sensu
password: password
vhost: "sensu"
ssl: {
cert_chain_file: "/etc/sensu/ssl/cert.pem",
private_key_file: "/etc/sensu/ssl/key.pem"
}
- port: 5671
host: 192.168.113.11
user: sensu
password: password
vhost: "sensu"
ssl: {
cert_chain_file: "/etc/sensu/ssl/cert.pem",
private_key_file: "/etc/sensu/ssl/key.pem"
}This is what I was unsure about how to do. This will create My puppet code is class { '::sensu':
init_stop_max_wait => 120,
log_level => 'info',
manage_user => false,
rabbitmq_reconnect_on_error => true,
redis_reconnect_on_error => true,
redis_port => 6380,
install_repo => true,
use_embedded_ruby => true,
manage_plugins_dir => false,
purge => {
config => true,
mutators => true,
handlers => true,
extensions => true,
plugins => false,
},
} |
|
I had the same problem, and confirmed that it was because i had rabbitmq_password set in hiera. |
|
Right. Thanks for the info. I now found I have these in hiera as well sensu::rabbitmq_password: eeCiephahx0kah5hoh4a
sensu::rabbitmq_ssl: true |
|
I just tried hardcoding the password into the manifest and not doing a hiera lookup, but I'm still seeing the same issue. Could you please post what your code looks like, @kmcfate ? I just tried taking all of the hiera lookups out of my rabbitmq_cluster variable and it still is showing the same behavior. |
|
@csoleimani for your case i suspect that |
|
Thanks for the suggestion, @cwjohnston . I just tried removing it and unfortunately, removing that attribute didn't seem to get rid of the issue. |
|
This works for me now after refactoring my puppet an hiera code. manifest class foo::sensu
class { '::sensu':
init_stop_max_wait => 120,
log_level => 'info',
manage_user => false,
rabbitmq_cluster => $rabbitmq_cluster,
redis_password => "redis_pass",
redis_db => 0,
redis_auto_reconnect => true,
redis_sentinels => $sentinels,
redis_master => "sensu",
install_repo => true,
use_embedded_ruby => true,
manage_plugins_dir => false,
purge => {
config => true,
mutators => true,
handlers => true,
extensions => true,
plugins => false,
},
}hiera foo::sensu::rabbitmq_cluster:
- port: 5671
host: 192.168.113.9
user: sensu
password: rabbitmq_pw
vhost: "sensu"
prefetch: 50
heartbeat: 30
ssl: {
cert_chain_file: "/etc/sensu/rabbitmq_ssl_cert.pem",
private_key_file: "/etc/sensu/rabbitmq_ssl_key.pem"
}
- port: 5671
host: 192.168.113.10
user: sensu
password: rabbitmq_pw
vhost: "sensu"
prefetch: 50
heartbeat: 30
ssl: {
cert_chain_file: "/etc/sensu/rabbitmq_ssl_cert.pem",
private_key_file: "/etc/sensu/rabbitmq_ssl_key.pem"
}
- port: 5671
host: 192.168.113.11
user: sensu
password: rabbitmq_pw
vhost: "sensu"
prefetch: 50
heartbeat: 30
ssl: {
cert_chain_file: "/etc/sensu/rabbitmq_ssl_cert.pem",
private_key_file: "/etc/sensu/rabbitmq_ssl_key.pem"
}and foo::sensu::sentinels:
- host: 192.168.113.9
port: 26379
- host: 192.168.113.10
port: 26379
- host: 192.168.113.11
port: 26379Don't use any rabbitmq_foo parameters except for rabbitmq_cluster. Manage the SSL certs for RabbitMQ outside the sensu module if you use SSL. Hope that helps :) |
|
Thanks @b-0-b for showing us the working config! |
|
I too had this problem, and undefining any It's a bit of a shame that setting Thanks for figuring this out @b-0-b! |
|
I've tried updating to the latest version of the module and am still facing this issue. Here is what my code looks like: Manifest: Do you see any issues with my code? Could it be possible that I'm facing the issue because I'm using enterprise? |
|
I'm working on this and able to reproduce the error. Thank you so much @b-0-b for the wonderful bug report. I can't express how wonderful it is working on a project like this where the issues are so clearly reported, it's saved me tremendous time trying to understand and reproduce the issue. With this one, and other issues I've recently worked on, it's been downright fun to work them through. Thanks again! Here's a partial backtrace leading to the issue in the provider, obtained with The provider behavior assumes I'll pick back up tomorrow coming up with a game plan to improve this surprising behavior. |
Without this patch, Puppet errors out when both `sensu::rabbitmq_password`, or
any of the `sensu::rabbitmq_*` parameters are specified along with
`sensu::rabbitmq_cluster`. The error is:
Error: /Stage[main]/Sensu::Rabbitmq::Config/Sensu_rabbitmq_config[sensu-server.example.com]: Could not evaluate: no implicit conversion of String into Integer
/vagrant/lib/puppet/provider/sensu_rabbitmq_config/json.rb:137:in `[]'
/vagrant/lib/puppet/provider/sensu_rabbitmq_config/json.rb:137:in `password'
This patch addresses the problem by changing sensu::rabbitmq::config to ignore
sensu::rabbitmq_* class parameters when the cluster configuration is specified
via `sensu::rabbitmq_cluster`.
Resolves sensu#598
|
The way the module is currently implemented, setting rabbitmq_* class parameters is mutually exclusive with setting rabbitmq_cluster. #742 changes the behavior to avoid the error by ignoring the sensu::rabbitmq_* class parameters when rabbitmq_cluster is defined. |
|
PR #742 address the original issue reported by @b-0-b . @csoleimani I'm taking a look at the related issue you reported with sensu-enterprise now. Thanks for the example code. |
|
Hi @csoleimani I've looked into the issue you're facing and you're running into the same issue originally reported. Consider this hiera data you have: password: "%{lookup('sensu::rabbitmq_password')}"This means The change in #742 should fix the issue for you. The change causes sensu::rabbitmq_password to be ignored. With your code the password will take effect in the cluster configuration. Please keep an eye here for the released version, or give the code in #724 a shot and let us know if it's still broken for you. Thanks for the clear information about how to reproduce your issue. |
Without this patch, Puppet errors out when both `sensu::rabbitmq_password`, or
any of the `sensu::rabbitmq_*` parameters are specified along with
`sensu::rabbitmq_cluster`. The error is:
Error: /Stage[main]/Sensu::Rabbitmq::Config/Sensu_rabbitmq_config[sensu-server.example.com]: Could not evaluate: no implicit conversion of String into Integer
/vagrant/lib/puppet/provider/sensu_rabbitmq_config/json.rb:137:in `[]'
/vagrant/lib/puppet/provider/sensu_rabbitmq_config/json.rb:137:in `password'
This patch addresses the problem by changing sensu::rabbitmq::config to ignore
sensu::rabbitmq_* class parameters when the cluster configuration is specified
via `sensu::rabbitmq_cluster`.
Resolves sensu#598
Without this patch, Puppet errors out when both `sensu::rabbitmq_password`, or
any of the `sensu::rabbitmq_*` parameters are specified along with
`sensu::rabbitmq_cluster`. The error is:
Error: /Stage[main]/Sensu::Rabbitmq::Config/Sensu_rabbitmq_config[sensu-server.example.com]: Could not evaluate: no implicit conversion of String into Integer
/vagrant/lib/puppet/provider/sensu_rabbitmq_config/json.rb:137:in `[]'
/vagrant/lib/puppet/provider/sensu_rabbitmq_config/json.rb:137:in `password'
This patch addresses the problem by changing sensu::rabbitmq::config to ignore
sensu::rabbitmq_* class parameters when the cluster configuration is specified
via `sensu::rabbitmq_cluster`.
Resolves sensu#598
(#598) Improve rabbitmq clustering robustness
|
Fix implemented in v2.24.0 |
Description of problem
What did you do?
What happened?
If I remove /etc/sensu/conf.d/rabbitmq.json the following puppet run will work again but fail on the puppet run after.
include ::sensusensu::rabbitmq_cluster: - port: 5671 host: 192.168.113.9 user: sensu password: REDACTED vhost: "sensu" ssl: { cert_chain_file: "/etc/sensu/ssl/cert.pem", private_key_file: "/etc/sensu/ssl/key.pem" } - port: 5671 host: 192.168.113.10 user: sensu password: REDACTED vhost: "sensu" ssl: { cert_chain_file: "/etc/sensu/ssl/cert.pem", private_key_file: "/etc/sensu/ssl/key.pem" } - port: 5671 host: 192.168.113.11 user: sensu password: REDACTED vhost: "sensu" ssl: { cert_chain_file: "/etc/sensu/ssl/cert.pem", private_key_file: "/etc/sensu/ssl/key.pem" }Command used and debugging output
Platform and version information
Client:
sensu-26-0 /root # ruby -version ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]Puppetmaster
Client
sensu-26-0 /root # puppet --version 4.3.1Puppetmaster
The text was updated successfully, but these errors were encountered: