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

Filecount: directory permission denied blocks input regardless of recurse parameter #5449

Closed
jnguiot opened this issue Feb 19, 2019 · 2 comments
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@jnguiot
Copy link

jnguiot commented Feb 19, 2019

Relevant telegraf.conf:

[[inputs.filecount]]
directory = "/tmp/foo/"
name = "aaa"
recursive = false

System info:

Telegraf 1.9.4 (git: HEAD 4da8d0a)
Ubuntu 16.04

Steps to reproduce:

  1. create this architecture in /tmp:

foo
|-- [-rw-rw-r--] aaa
`-- [d---------] bar

foo and bar are directories
aaa is a regular file
bar cannot be read by telegraf user (here, it is simulated by a 000 chmod)
2. Create the file /tmp/aaa.conf with this content:

[[inputs.filecount]]
directory = "/tmp/foo/"
name = "aaa"
recursive = false

  1. execute config file: telegraf --config /tmp/aaa.conf --test

Expected behavior:

Telegraf process should return:
> filecount,directory=/tmp/foo/,host=computer count=1i 1550582182000000000

Actual behavior:

Telegraf process returns:
2019-02-19T13:17:01Z E! [inputs.filecount]: Error in plugin: open /tmp/foo/bar: permission denied

Additional info:

Since recurse is set to false, telegraf should not care about subdirectories, especially, it should not go into error.
I am still looking for a workaround.

@danielnelson danielnelson added this to the 1.9.5 milestone Feb 20, 2019
@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Feb 20, 2019
@glinton
Copy link
Contributor

glinton commented Feb 25, 2019

A workaround is to use the nightly as this has been resolved for 1.10

@jnguiot
Copy link
Author

jnguiot commented Feb 26, 2019

Ok. Thank you for the quick bugfix!

@danielnelson danielnelson modified the milestones: 1.9.5, 1.10.0 Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants