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

Changing Handler type fails with 'keys' error #360

Closed
magmax opened this issue Jun 10, 2015 · 7 comments
Closed

Changing Handler type fails with 'keys' error #360

magmax opened this issue Jun 10, 2015 · 7 comments

Comments

@magmax
Copy link

magmax commented Jun 10, 2015

I have the configuration:

sensu::handler{'whatever':
  type => 'pipe',
  command => 'whatever',
  socket => {
    host => 'whatever',
    port => 12345
  },
}

I run puppet and I realize there is an error: the type. I fix it, but when I run puppet again it returns:

Error: undefined method `keys' for nil:NilClass
Error: /Stage[main]/Sensu_plugins::Handler/Sensu::Handler[whatever]/Sensu_handler[whatever]: Could not evaluate: Puppet::Util::Log requires a message

And puppet do not work again.

Bypass: remove the handler, run puppet, and write it again.

@jlambert121
Copy link
Contributor

When I apply

class { 'sensu': }
sensu::handler{'whatever':
  type => 'pipe',
  command => 'whatever',
  socket => {
    host => 'whatever',
    port => 12345
  },
}

to a clean machine I don't get any errors. Could you provide some more details as to what is generating the error you're seeing?

@magmax
Copy link
Author

magmax commented Jun 13, 2015

The problem appears when you apply the type "pipe" to a machine and then you try to change it to "tcp".

@roobert
Copy link

roobert commented Jul 23, 2015

I've also run into this bug.

If I have a handler defined that deploys the following:

{
  "handlers": {
    "graphite": {
      "command": null,
      "type": "tcp",
      "socket": {
        "host": "graphite",
        "port": 8126
      },
      "severities": [
        "ok",
        "warning",
        "critical",
        "unknown"
      ]
    }
  }
}

and then change the definition to deploy:

{
  "handlers": {
    "graphite": {
      "command": null,
      "type": "set",
      "severities": [
        "ok",
        "warning",
        "critical",
        "unknown"
      ],
      "handlers": [
        "relay",
        "graphite_to_influxdb"
      ]
    }
  }
}

I get:

Error: undefined method `sort' for nil:NilClass
Error: /Stage[main]/Sensu/Sensu::Handler[graphite]/Sensu_handler[graphite]/handlers: change from  to relay graphite_to_influxdb failed: undefined method `sort' for nil:NilClass
Error: Could not start Service[sensu-client]: Execution of '/etc/init.d/sensu-client start' returned 1: Starting sensu-client: failed!
Wrapped exception:
Execution of '/etc/init.d/sensu-client start' returned 1: Starting sensu-client: failed!
Error: /Stage[main]/Sensu::Client::Service/Service[sensu-client]/ensure: change from stopped to running failed: Could not start Service[sensu-client]: Execution of '/etc/init.d/sensu-client start' returned 1: Starting sensu-client: failed!

@jaxxstorm
Copy link
Contributor

jaxxstorm commented Sep 15, 2016

Is this still an issue? Will close in ~2 weeks if we have no response.

@roobert
Copy link

roobert commented Sep 15, 2016

I think this is probably still an issue but have no way to test at the moment..

@jaxxstorm
Copy link
Contributor

I think this is related to #531

@jaxxstorm
Copy link
Contributor

#531 was merged, so closing this

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

4 participants