{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/logstash/issues/6824","repository_url":"https://api.github.com/repos/elastic/logstash","labels_url":"https://api.github.com/repos/elastic/logstash/issues/6824/labels{/name}","comments_url":"https://api.github.com/repos/elastic/logstash/issues/6824/comments","events_url":"https://api.github.com/repos/elastic/logstash/issues/6824/events","html_url":"https://github.com/elastic/logstash/issues/6824","id":215775760,"node_id":"MDU6SXNzdWUyMTU3NzU3NjA=","number":6824,"title":"cgroups not existing on all linux versions","user":{"login":"ruflin","id":244900,"node_id":"MDQ6VXNlcjI0NDkwMA==","avatar_url":"https://avatars3.githubusercontent.com/u/244900?v=4","gravatar_id":"","url":"https://api.github.com/users/ruflin","html_url":"https://github.com/ruflin","followers_url":"https://api.github.com/users/ruflin/followers","following_url":"https://api.github.com/users/ruflin/following{/other_user}","gists_url":"https://api.github.com/users/ruflin/gists{/gist_id}","starred_url":"https://api.github.com/users/ruflin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ruflin/subscriptions","organizations_url":"https://api.github.com/users/ruflin/orgs","repos_url":"https://api.github.com/users/ruflin/repos","events_url":"https://api.github.com/users/ruflin/events{/privacy}","received_events_url":"https://api.github.com/users/ruflin/received_events","type":"User","site_admin":false},"labels":[{"id":258254839,"node_id":"MDU6TGFiZWwyNTgyNTQ4Mzk=","url":"https://api.github.com/repos/elastic/logstash/labels/monitoring","name":"monitoring","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":{"login":"guyboertje","id":84912,"node_id":"MDQ6VXNlcjg0OTEy","avatar_url":"https://avatars2.githubusercontent.com/u/84912?v=4","gravatar_id":"","url":"https://api.github.com/users/guyboertje","html_url":"https://github.com/guyboertje","followers_url":"https://api.github.com/users/guyboertje/followers","following_url":"https://api.github.com/users/guyboertje/following{/other_user}","gists_url":"https://api.github.com/users/guyboertje/gists{/gist_id}","starred_url":"https://api.github.com/users/guyboertje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyboertje/subscriptions","organizations_url":"https://api.github.com/users/guyboertje/orgs","repos_url":"https://api.github.com/users/guyboertje/repos","events_url":"https://api.github.com/users/guyboertje/events{/privacy}","received_events_url":"https://api.github.com/users/guyboertje/received_events","type":"User","site_admin":false},"assignees":[{"login":"guyboertje","id":84912,"node_id":"MDQ6VXNlcjg0OTEy","avatar_url":"https://avatars2.githubusercontent.com/u/84912?v=4","gravatar_id":"","url":"https://api.github.com/users/guyboertje","html_url":"https://github.com/guyboertje","followers_url":"https://api.github.com/users/guyboertje/followers","following_url":"https://api.github.com/users/guyboertje/following{/other_user}","gists_url":"https://api.github.com/users/guyboertje/gists{/gist_id}","starred_url":"https://api.github.com/users/guyboertje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyboertje/subscriptions","organizations_url":"https://api.github.com/users/guyboertje/orgs","repos_url":"https://api.github.com/users/guyboertje/repos","events_url":"https://api.github.com/users/guyboertje/events{/privacy}","received_events_url":"https://api.github.com/users/guyboertje/received_events","type":"User","site_admin":false}],"milestone":null,"comments":20,"created_at":"2017-03-21T15:18:44Z","updated_at":"2018-09-07T18:03:52Z","closed_at":null,"author_association":"NONE","body":"* version: master\r\n\r\nRunning Logstash in a Docker container I get the following log message very few seconds:\r\n\r\n```\r\nlogstash_1       | [2017-03-21T15:14:58,454][DEBUG][logstash.instrument.periodicpoller.cgroup] Error, cannot retrieve cgroups information {:exception=>\"Errno::ENOENT\", :message=>\"No such file or directory - /sys/fs/cgroup/cpuacct/docker/17b6470608493e662e1d4e0dabcf937b0de9a9ce06197b4fe7afa6acf8f19837/cpuacct.usage\"}\r\n```\r\n\r\nThe problem is that cgroups are not available on all linux system or can also be disabled. We had a similar issue in beats: https://github.com/elastic/beats/pull/3692 I'm aware that the above is only a debug log message but I would suggest that the check if cgroup is available should happen only once on startup.\r\n"},"comment":{"url":"https://api.github.com/repos/elastic/logstash/issues/comments/419520216","html_url":"https://github.com/elastic/logstash/issues/6824#issuecomment-419520216","issue_url":"https://api.github.com/repos/elastic/logstash/issues/6824","id":419520216,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTUyMDIxNg==","user":{"login":"guyboertje","id":84912,"node_id":"MDQ6VXNlcjg0OTEy","avatar_url":"https://avatars2.githubusercontent.com/u/84912?v=4","gravatar_id":"","url":"https://api.github.com/users/guyboertje","html_url":"https://github.com/guyboertje","followers_url":"https://api.github.com/users/guyboertje/followers","following_url":"https://api.github.com/users/guyboertje/following{/other_user}","gists_url":"https://api.github.com/users/guyboertje/gists{/gist_id}","starred_url":"https://api.github.com/users/guyboertje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guyboertje/subscriptions","organizations_url":"https://api.github.com/users/guyboertje/orgs","repos_url":"https://api.github.com/users/guyboertje/repos","events_url":"https://api.github.com/users/guyboertje/events{/privacy}","received_events_url":"https://api.github.com/users/guyboertje/received_events","type":"User","site_admin":false},"created_at":"2018-09-07T18:03:52Z","updated_at":"2018-09-07T18:03:52Z","author_association":"CONTRIBUTOR","body":"@terebentina, @sp1thas and others\r\n\r\nPlease note: there are two errors that can occur here.\r\n1. the first one posted by the original author where the cgroup files/directories are not where we think they should be. In one report above the sought file is `/sys/fs/cgroup/cpuacct/docker/fe2c373bfa536a36fdc3f60d1885c76d58a1c7a5bd99dc54cd3df000190d1a29/cpu.cfs_period_us`, this means that in `/proc/self/cgroup` an entry like `5:cpuacct,cpu:/docker/fe2c373bfa536a36fdc3f60d1885c76d58a1c7a5bd99dc54cd3df000190d1a29` is seen. But when we append this \"offset\" to `sys/fs/cgroup` to build a path to `cpuacct/cpuacct.usage`, the path does not work.\r\n2. the other is identified by this in the log message `{:exception=>\"NoMethodError\", :message=>\"undefined method []' for nil:NilClass\"}`, meaning that the files/directories are found but  one or more files do not have the expected format. Most likely that `/proc/self/cgroup` exists but is empty.\r\n\r\nIt will be super super helpful if, when you get these errors, you did the following:\r\n**For the missing files error**:\r\n1. Confirm whether is cgroups is or is not disabled or does or does not exist on the system.\r\n2. If exists, find the paths to the `cpu/cpu.stat`, `cpuacct/cpuacct.usage`, `cpuacct/cpu.cfs_period_us` and `cpuacct/cpu.cfs_quota_us` files. Logstash is expecting them to be at:\r\n```\r\n/proc/self/cgroup\r\n/sys/fs/cgroup/cpu/cpu.stat\r\n/sys/fs/cgroup/cpuacct/cpuacct.usage\r\n/sys/fs/cgroup/cpuacct/cpu.cfs_period_us # contains an integer\r\n/sys/fs/cgroup/cpuacct/cpu.cfs_quota_us # contains an integer\r\n\r\nOn a Google Compute RHEL7 instance this is what I get:\r\n\r\ncat /proc/self/cgroup\r\n11:pids:/\r\n10:hugetlb:/\r\n9:devices:/\r\n8:freezer:/\r\n7:perf_event:/\r\n6:cpuset:/\r\n5:cpuacct,cpu:/\r\n4:blkio:/\r\n3:memory:/\r\n2:net_prio,net_cls:/\r\n1:name=systemd:/user.slice/user-1002.slice/session-1.scope\r\n\r\ncat /sys/fs/cgroup/cpu,cpuacct/cpu.stat\r\nnr_periods 0\r\nnr_throttled 0\r\nthrottled_time 0\r\n\r\ncat /sys/fs/cgroup/cpuacct/cpuacct.usage\r\n52976393023\r\ncat /sys/fs/cgroup/cpuacct/cpu.cfs_period_us\r\n100000\r\n\r\ncat /sys/fs/cgroup/cpuacct/cpu.cfs_quota_us\r\n-1\r\n```\r\n3. Add a comment here with the paths and their contents, the Docker version, the Host OS version and any other info that you think may be relevant.\r\n\r\n**For the unexpected format error**:\r\n1. Confirm that the files have content similar to the listing above.\r\n2. If `proc/self/cgroup` is empty, try to find where your Host OS has these files.\r\n2. Add a comment here with the paths and their contents, the Docker version, the Host OS version and any other info that you think may be relevant.\r\n\r\n\r\n"}}
{"actor":{"display_login":"guyboertje"}}