{"action":"created","issue":{"url":"https://api.github.com/repos/sensu/sensu/issues/1286","repository_url":"https://api.github.com/repos/sensu/sensu","labels_url":"https://api.github.com/repos/sensu/sensu/issues/1286/labels{/name}","comments_url":"https://api.github.com/repos/sensu/sensu/issues/1286/comments","events_url":"https://api.github.com/repos/sensu/sensu/issues/1286/events","html_url":"https://github.com/sensu/sensu/issues/1286","id":156862577,"number":1286,"title":"Sensu Client exception on `standalone` check when `interval` omitted and `publish: false`","user":{"login":"nhooey","id":65458,"avatar_url":"https://avatars.githubusercontent.com/u/65458?v=3","gravatar_id":"","url":"https://api.github.com/users/nhooey","html_url":"https://github.com/nhooey","followers_url":"https://api.github.com/users/nhooey/followers","following_url":"https://api.github.com/users/nhooey/following{/other_user}","gists_url":"https://api.github.com/users/nhooey/gists{/gist_id}","starred_url":"https://api.github.com/users/nhooey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhooey/subscriptions","organizations_url":"https://api.github.com/users/nhooey/orgs","repos_url":"https://api.github.com/users/nhooey/repos","events_url":"https://api.github.com/users/nhooey/events{/privacy}","received_events_url":"https://api.github.com/users/nhooey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-25T22:14:28Z","updated_at":"2016-05-27T04:49:54Z","closed_at":null,"body":"When I have a check defined with `standalone: true`, `publish: false`, and `interval` omitted, I get a stack trace when restarting `sensu-client`.\r\n\r\nThere is no issue when including an arbitrary `interval`, but I don't want the check scheduled standalone on the client, I merely want it to exist so the check will fail when there are no results posted within the `TTL`.\r\n\r\n**Check definition:**\r\n\r\n```json\r\n{\r\n   \"checks\": {\r\n    \"ansible-pull\": {\r\n        \"command\": \"false\",\r\n        \"handlers\": [\r\n            \"all\"\r\n        ],\r\n        \"publish\": false,\r\n        \"standalone\": true,\r\n        \"timeout\": 1200,\r\n        \"ttl\": 1800\r\n    }\r\n}\r\n```\r\n\r\n(Note that `\"command\": \"false\"` refers to the Linux command that always fails, not a JSON boolean value).\r\n\r\n**Stack trace when restarting `sensu-client`:**\r\n```\r\n{\"timestamp\":\"2016-05-25T22:06:47.311233+0000\",\"level\":\"debug\",\"message\":\"scheduling standalone checks\"}\r\nerror reading event: A JSON text must at least contain two octets!\r\n/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-0.23.2/lib/sensu/client/process.rb:262:in `calculate_execution_splay': undefined method `*' for nil:NilClass (NoMethodError)\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-0.23.2/lib/sensu/client/process.rb:279:in `block in schedule_checks'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-0.23.2/lib/sensu/client/process.rb:274:in `each'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-0.23.2/lib/sensu/client/process.rb:274:in `schedule_checks'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-0.23.2/lib/sensu/client/process.rb:300:in `setup_standalone'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-0.23.2/lib/sensu/client/process.rb:371:in `bootstrap'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-0.23.2/lib/sensu/client/process.rb:381:in `block in start'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-0.23.2/lib/sensu/daemon.rb:230:in `block in setup_transport'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-transport-5.0.0/lib/sensu/transport.rb:26:in `block in connect'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/em/deferrable.rb:151:in `set_deferred_status'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/em/deferrable.rb:191:in `succeed'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-transport-5.0.0/lib/sensu/transport/rabbitmq.rb:195:in `block in setup_connection'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/em/deferrable.rb:151:in `set_deferred_status'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/em/deferrable.rb:191:in `succeed'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/amqp-1.5.0/lib/amqp/session.rb:682:in `connection_successful'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/amqp-1.5.0/lib/amqp/session.rb:1040:in `handle_open_ok'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/amqp-1.5.0/lib/amqp/session.rb:1136:in `block in <class:Session>'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/amqp-1.5.0/lib/amqp/session.rb:959:in `receive_frameset'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/amqp-1.5.0/lib/amqp/session.rb:933:in `receive_frame'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/amqp-1.5.0/lib/amqp/session.rb:671:in `receive_data'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:194:in `run_machine'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:194:in `run'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-0.23.2/lib/sensu/client/process.rb:18:in `run'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-0.23.2/exe/sensu-client:10:in `<top (required)>'\r\n        from /opt/sensu/bin/sensu-client:22:in `load'\r\n        from /opt/sensu/bin/sensu-client:22:in `<main>'\r\n```\r\n\r\nThis happens with Sensu `0.23.2-2` from the Ubuntu repository.\r\n\r\nThis error contradicts the `interval` Check parameter documentation:\r\n\r\n```\r\ninterval:\r\n  description: The frequency in seconds the check is executed.\r\n  required: true (unless publish is false)\r\n  type: Integer\r\n  example: \"interval\": 60\r\n```"},"comment":{"url":"https://api.github.com/repos/sensu/sensu/issues/comments/222059608","html_url":"https://github.com/sensu/sensu/issues/1286#issuecomment-222059608","issue_url":"https://api.github.com/repos/sensu/sensu/issues/1286","id":222059608,"user":{"login":"portertech","id":149630,"avatar_url":"https://avatars.githubusercontent.com/u/149630?v=3","gravatar_id":"","url":"https://api.github.com/users/portertech","html_url":"https://github.com/portertech","followers_url":"https://api.github.com/users/portertech/followers","following_url":"https://api.github.com/users/portertech/following{/other_user}","gists_url":"https://api.github.com/users/portertech/gists{/gist_id}","starred_url":"https://api.github.com/users/portertech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portertech/subscriptions","organizations_url":"https://api.github.com/users/portertech/orgs","repos_url":"https://api.github.com/users/portertech/repos","events_url":"https://api.github.com/users/portertech/events{/privacy}","received_events_url":"https://api.github.com/users/portertech/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T04:49:54Z","updated_at":"2016-05-27T04:49:54Z","body":"TTL monitoring is done via the Sensu server leader, after a result has been received for a client, with a defined TTL. TTL monitoring is NOT done by the Sensu client."}}
{"actor":{"display_login":"portertech"}}