{"action":"created","issue":{"url":"https://api.github.com/repos/sensu/sensu/issues/1871","repository_url":"https://api.github.com/repos/sensu/sensu","labels_url":"https://api.github.com/repos/sensu/sensu/issues/1871/labels{/name}","comments_url":"https://api.github.com/repos/sensu/sensu/issues/1871/comments","events_url":"https://api.github.com/repos/sensu/sensu/issues/1871/events","html_url":"https://github.com/sensu/sensu/issues/1871","id":328297940,"node_id":"MDU6SXNzdWUzMjgyOTc5NDA=","number":1871,"title":"Specifying a metric TTL as a large number as a string causes crash","user":{"login":"kbuchsicf","id":34281089,"node_id":"MDQ6VXNlcjM0MjgxMDg5","avatar_url":"https://avatars1.githubusercontent.com/u/34281089?v=4","gravatar_id":"","url":"https://api.github.com/users/kbuchsicf","html_url":"https://github.com/kbuchsicf","followers_url":"https://api.github.com/users/kbuchsicf/followers","following_url":"https://api.github.com/users/kbuchsicf/following{/other_user}","gists_url":"https://api.github.com/users/kbuchsicf/gists{/gist_id}","starred_url":"https://api.github.com/users/kbuchsicf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbuchsicf/subscriptions","organizations_url":"https://api.github.com/users/kbuchsicf/orgs","repos_url":"https://api.github.com/users/kbuchsicf/repos","events_url":"https://api.github.com/users/kbuchsicf/events{/privacy}","received_events_url":"https://api.github.com/users/kbuchsicf/received_events","type":"User","site_admin":false},"labels":[{"id":33371770,"node_id":"MDU6TGFiZWwzMzM3MTc3MA==","url":"https://api.github.com/repos/sensu/sensu/labels/Bug","name":"Bug","color":"e11d21","default":false},{"id":460342808,"node_id":"MDU6TGFiZWw0NjAzNDI4MDg=","url":"https://api.github.com/repos/sensu/sensu/labels/ready","name":"ready","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/sensu/sensu/milestones/21","html_url":"https://github.com/sensu/sensu/milestone/21","labels_url":"https://api.github.com/repos/sensu/sensu/milestones/21/labels","id":3426338,"node_id":"MDk6TWlsZXN0b25lMzQyNjMzOA==","number":21,"title":"1.4.3","description":"","creator":{"login":"portertech","id":149630,"node_id":"MDQ6VXNlcjE0OTYzMA==","avatar_url":"https://avatars2.githubusercontent.com/u/149630?v=4","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},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2018-06-14T20:54:20Z","updated_at":"2018-06-14T20:54:49Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-05-31T21:08:33Z","updated_at":"2018-06-25T18:27:59Z","closed_at":null,"author_association":"NONE","body":"<!--- Provide a general summary of the issue in the Title above -->\r\nWe have been, in ignorance, submitting POST requests to Sensu server with metric data and TTL given as a string. When the TTL was given a larger number, as a string, it caused a crash in sensu-server and redis. \r\n\r\n## Expected Behavior\r\nSensu server & redis should not crash. \r\n\r\n## Current Behavior\r\nCrashing, requiring restart of sensu server and redis\r\n\r\n## Possible Solution\r\nCorrect interpretation of TTL as a string or reject the metric all together. If the magnitude of the TTL is really the issue, then generate an appropriate response. No matter what, don't accept a metric which will then cause a crash.\r\n\r\n## Steps to Reproduce (for bugs)\r\n1. Submit a metric with \"ttl\": \"3672000\"    ; that is 42 days\r\n\r\nContrast this with \"ttl\": \"648000\"   ; that is 7 days\r\nwhich was not causing a crash\r\n\r\n## Context\r\nCrash halted operation of sensu server and loss of data.\r\n\r\n## Your Environment\r\nWe are running with Docker containers; with these images:\r\n```# docker images\r\nREPOSITORY                      TAG                 IMAGE ID            CREATED             SIZE\r\nsensudockerstack_sensu-server   latest              9e1c63af99c5        7 months ago        640MB\r\n<none>                          <none>              45fd29784c15        7 months ago        638MB\r\nsensudockerstack_sensu-client   latest              75eff35c5b9a        7 months ago        1.02GB\r\n<none>                          <none>              343393fd0739        7 months ago        638MB\r\nsensudockerstack_sensu-api      latest              b9ad91385d6c        7 months ago        616MB\r\n<none>                          <none>              69835694ca7e        7 months ago        1.02GB\r\n<none>                          <none>              0271e5941137        7 months ago        638MB\r\n<none>                          <none>              b7dafb8bd204        7 months ago        616MB\r\nrabbitmq                        3-management        046c07b70859        7 months ago        124MB\r\nuchiwa/uchiwa                   latest              68d89653a1dc        8 months ago        346MB\r\nhopsoft/graphite-statsd         latest              6a63c117b7c9        8 months ago        870MB\r\ngrafana/grafana                 latest              1d2e2705fd26        8 months ago        303MB\r\nredis                           alpine              5c7823413ff7        8 months ago        27.5MB\r\nuberamd/sensu-ubuntu            1.0.2               2b2ce5e88a45        9 months ago        207MB\r\n\r\n# docker ps\r\nCONTAINER ID        IMAGE                           COMMAND                  CREATED             STATUS              PORTS                                                                                                                                    NAMES\r\n382fca81ae92        sensudockerstack_sensu-server   \"/tmp/run.sh\"            7 months ago        Up 6 hours                                                                                                                                                   sensu-server\r\n765152976f99        sensudockerstack_sensu-client   \"/tmp/run.sh\"            7 months ago        Up 7 months         3030/tcp                                                                                                                                 sesnu-client\r\n0285c633bcf3        uchiwa/uchiwa                   \"/go/bin/uchiwa -c...\"   7 months ago        Up 7 months         0.0.0.0:3000->3000/tcp                                                                                                                   sensu-uchiwa\r\na206f93d6354        sensudockerstack_sensu-api      \"/tmp/run.sh\"            7 months ago        Up 5 months         0.0.0.0:4567->4567/tcp                                                                                                                   sensu-api\r\nb457d9aeffb1        grafana/grafana                 \"/run.sh\"                7 months ago        Up 4 months         0.0.0.0:3333->3000/tcp                                                                                                                   sensudockerstack_grafana_1\r\n65496fb38d30        rabbitmq:3-management           \"docker-entrypoint...\"   7 months ago        Up 7 months         4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, 15671/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp                                               sensu-rabbitmq\r\n3eb2296886ec        hopsoft/graphite-statsd         \"/sbin/my_init\"          7 months ago        Up 7 months         0.0.0.0:80->80/tcp, 0.0.0.0:2003-2004->2003-2004/tcp, 0.0.0.0:2023-2024->2023-2024/tcp, 0.0.0.0:8126->8126/tcp, 0.0.0.0:8125->8125/udp   sensudockerstack_graphite_1\r\n60d63ab91821        redis:alpine                    \"docker-entrypoint...\"   7 months ago        Up 6 hours          6379/tcp                                                                                                                                 sensu-redis\r\n```\r\n* Sensu version used: 1.1.0\r\n[version-manifest.txt](https://github.com/sensu/sensu/files/2060071/version-manifest.txt)\r\n\r\n* Active Sensu extensions: N/A\r\n* Operating System and version: CentOS Linux release 7.4.1708 (Core)\r\n* Transport and runtime versions (e.g. RabbitMQ 3.6.2 on Erlang 18.2): See container image versions above.\r\n\r\n### Traceback\r\n\r\n```{\"timestamp\":\"2018-05-31T14:31:45.452786+0000\",\"level\":\"warn\",\"message\":\"reconnecting to redis\"}\r\n/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-1.0.2/lib/sensu/server/process.rb:1083:in `>=': comparison of Integer with String failed (ArgumentError)\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-1.0.2/lib/sensu/server/process.rb:1083:in `block (3 levels) in determine_stale_check_results'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-redis-2.2.0/lib/sensu/redis/client.rb:337:in `dispatch_response'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-redis-2.2.0/lib/sensu/redis/client.rb:359:in `parse_response_line'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-redis-2.2.0/lib/sensu/redis/client.rb:387:in `receive_data'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.2/lib/eventmachine.rb:194:in `run_machine'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.2/lib/eventmachine.rb:194:in `run'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-1.0.2/lib/sensu/server/process.rb:33:in `run'\r\n        from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-1.0.2/exe/sensu-server:10:in `<top (required)>'\r\n        from /opt/sensu/bin/sensu-server:22:in `load'\r\n        from /opt/sensu/bin/sensu-server:22:in `<main>'\r\nSetting plugin permissions\r\nRunning sensu config:\r\n{\r\n  \"redis\": {\r\n    \"port\": 6379,\r\n    \"host\": \"sensu-redis\",\r\n    \"password\": \"password\",\r\n    \"reconnect_on_error\": true\r\n  },\r\n  \"rabbitmq\": {\r\n    \"host\": \"sensu-rabbitmq\",\r\n    \"port\": 5672,\r\n    \"vhost\": \"sensu\",\r\n    \"user\": \"sensu\",\r\n    \"password\": \"password\"\r\n  },\r\n  \"api\": {\r\n    \"port\": 4567,\r\n    \"host\": \"sensu-api\",\r\n    \"user\": \"sensu\",\r\n    \"password\": \"password\"\r\n  }\r\n}\r\n```\r\nAfter traceback\r\n"},"comment":{"url":"https://api.github.com/repos/sensu/sensu/issues/comments/400049874","html_url":"https://github.com/sensu/sensu/issues/1871#issuecomment-400049874","issue_url":"https://api.github.com/repos/sensu/sensu/issues/1871","id":400049874,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMDA0OTg3NA==","user":{"login":"kbuchsicf","id":34281089,"node_id":"MDQ6VXNlcjM0MjgxMDg5","avatar_url":"https://avatars1.githubusercontent.com/u/34281089?v=4","gravatar_id":"","url":"https://api.github.com/users/kbuchsicf","html_url":"https://github.com/kbuchsicf","followers_url":"https://api.github.com/users/kbuchsicf/followers","following_url":"https://api.github.com/users/kbuchsicf/following{/other_user}","gists_url":"https://api.github.com/users/kbuchsicf/gists{/gist_id}","starred_url":"https://api.github.com/users/kbuchsicf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbuchsicf/subscriptions","organizations_url":"https://api.github.com/users/kbuchsicf/orgs","repos_url":"https://api.github.com/users/kbuchsicf/repos","events_url":"https://api.github.com/users/kbuchsicf/events{/privacy}","received_events_url":"https://api.github.com/users/kbuchsicf/received_events","type":"User","site_admin":false},"created_at":"2018-06-25T18:27:59Z","updated_at":"2018-06-25T18:27:59Z","author_association":"NONE","body":"I am submitting a metric outside of the client, and yes, I had that code misconfigured. So, my bad - full disclosure. But... The behavior I observed is that smaller TTLs up to 1 week + 12 hours, submitted as a string were properly accepted and processed with no ill effects. When I tried a TTL of 42 days as a string, it started crashing the Sensu server. Of course, changing an integer instead of a string resolved the issue. However, the crashing Sensu was my concern. I see the code you reference, but I think somehow that must not have been relevant in the case I had, because smaller numbers as strings were working properly. "}}
{"actor":{"display_login":"kbuchsicf"}}