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

sensu fails to start as client_port is a string. #456

Merged
merged 1 commit into from
Dec 10, 2015
Merged

sensu fails to start as client_port is a string. #456

merged 1 commit into from
Dec 10, 2015

Conversation

sathlan
Copy link
Contributor

@sathlan sathlan commented Dec 9, 2015

Related to #454 and to #453

No matter what you put as a value for $client_port the first run of
sensu fails because the rendered /etc/sensu/conf.d/client.json has a
string for port value. It works at the second run.

The reason is that the value returned by puppet for the hash in socket
is always a string whatever you put in $client_port (string or int). It
works the second time because is get munged by in the insync? method in
the type definition.

This is why also it can work at the first run depending of the
distribution. If the distribution install a valid
/etc/sensu/conf.d/client.json by default, then this problem will get
unnoticed (munged by insync?). Unfortunately this is not the case for
centos where no such file is installed.

I added the munge at every place this could be a problem. I ran the
beaker tests on centos and got:

Finished in 6 minutes 20 seconds (files took 1 minute 40.05 seconds to load)
16 examples, 0 failures

real 8m3.775s
user 0m15.046s
sys 0m1.130s

puppet --version -> 3.8.4, centos7

No matter what you put as a value for $client_port the first run of
sensu fails because the rendered /etc/sensu/conf.d/client.json has a
string for port value.  It works at the second run.

The reason is that the value returned by puppet for the hash in socket
is always a string whatever you put in $client_port (string or int).  It
works the second time because is get munged by in the insync?  method in
the type definition.

This is why also it can work at the first run depending of the
distribution.  If the distribution install a valid
/etc/sensu/conf.d/client.json by default, then this problem will get
unnoticed (munged by insync?).  Unfortunately this is not the case for
centos where no such file is installed.

I added the munge at every place this could be a problem.  I ran the
beaker tests on centos and got:

Finished in 6 minutes 20 seconds (files took 1 minute 40.05 seconds to load)
16 examples, 0 failures

real    8m3.775s
user    0m15.046s
sys     0m1.130s

puppet --version -> 3.8.4, centos7
@EmilienM
Copy link

EmilienM commented Dec 9, 2015

I've noticed that I did not run the bug when using Hiera and setting sensu::client_port like this.

@superseb
Copy link
Contributor

superseb commented Dec 9, 2015

Reproduced the issue on CentOS 6.6, checked out this pull and re-ran, no issues.

@jlambert121
Copy link
Contributor

Thanks!

jlambert121 added a commit that referenced this pull request Dec 10, 2015
…_alway_a_string

sensu fails to start as client_port is a string.
@jlambert121 jlambert121 merged commit 9b9eb3c into sensu:master Dec 10, 2015
@sathlan sathlan deleted the fix/default_client_port_value_is_alway_a_string branch December 10, 2015 09:38
@zbintliff zbintliff mentioned this pull request Dec 11, 2015
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 this pull request may close these issues.

4 participants