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

Collectd fails to start when wsrepstats is enabled #757

Closed
steventwheeler opened this issue Mar 1, 2018 · 3 comments · Fixed by #758
Closed

Collectd fails to start when wsrepstats is enabled #757

steventwheeler opened this issue Mar 1, 2018 · 3 comments · Fixed by #758
Labels
bug Something isn't working

Comments

@steventwheeler
Copy link
Contributor

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.10
  • Ruby: ruby 2.1.9p490 (2016-03-30 revision 54437) [x86_64-linux]
  • Distribution: CentOS Linux release 7.4.1708 (Core)
  • Module version: 8.1.0

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

collectd::plugin::mysql::database { 'mysql':
  host        => 'localhost',
  username    => 'collectd',
  password    => '*****',
  port        => '3306',
  masterstats => true,
  innodbstats => true,
  wsrepstats  => true,
}

What are you seeing

The collectd service fails to start.

What behaviour did you expect instead

The collectd service should start.

Output log

Mar  1 14:23:57 database collectd: Parse error in file `/etc/collectd.d/mysql-mysql.conf', line 125 near `<newline>': syntax error, unexpected EOL
Mar  1 14:23:57 database collectd: yyparse returned error #1
Mar  1 14:23:57 database collectd: configfile: Cannot read file `/etc/collectd.d/mysql-mysql.conf'.
Mar  1 14:23:57 database collectd: Unable to read config file /etc/collectd.conf.
Mar  1 14:23:57 database collectd: Error: Reading the config file failed!
Mar  1 14:23:57 database collectd: Read the logs for details.

The strange thing is there are not 125+ lines in /etc/collectd.d/mysql-mysql.conf, my guess is that collectd must concatenate all of the config files into on massive file when parsing. What I do notice is that the value true is not included after the WsrepStatsStats parameter. Also, this parameter appears to be misnamed, I believe it should be WsrepStats.

# Generated by Puppet

<Plugin mysql>
  <Database "mysql">
    Host "localhost"
    User "collectd"
    Password "********"
    Port "3306"
    MasterStats true
    SlaveStats false
    InnodbStats true
    WsrepStatsStats
  </Database>
</Plugin>

Any additional information you'd like to impart

My best guess is that this is a problem with the ERB template. The case used for the variable's name is inconsistent on lines 22 and 23 @wsrepstats vs @WsrepStats respectively.

@juniorsysadmin juniorsysadmin added the bug Something isn't working label Mar 2, 2018
@bastelfreak
Copy link
Member

Hi @steventwheeler. thanks for bringing this up. Are you able to provide a test that verifies this? Or can you test if it works for you when you correct the variable naming?

@steventwheeler
Copy link
Contributor Author

steventwheeler commented Mar 2, 2018

@bastelfreak thanks for the quick response. I can confirm that it works with the configuration below. I will see if I can find some time today to write up a test.

# Generated by Puppet

<Plugin mysql>
  <Database "mysql">
    Host "localhost"
    User "collectd"
    Password "*****"
    Port "3306"
    MasterStats true
    SlaveStats false
    InnodbStats true
    WsrepStats true
  </Database>
</Plugin>

steventwheeler added a commit to steventwheeler/puppet-collectd that referenced this issue Mar 2, 2018
Adds tests as requested in voxpupuli#757
@steventwheeler
Copy link
Contributor Author

@bastelfreak I have implemented a fix for this in #758.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants