fluent-bit icon indicating copy to clipboard operation
fluent-bit copied to clipboard

Tail plugin not noticing changes on remote filesystems

Open Deaddy opened this issue 7 years ago • 7 comments

Bug Report

This is probably an extension of #1042 and most likely due to inotify being unable to detect changes on remote filesystems.

Describe the bug Changes to files on a remote filesystem, which are not made on the same machine as the one where fluent-bit is running on, are not read by fluent-bit, at least until fluent-bit is restarted or writes are made by the local system.

To Reproduce Have two machines A and B, A running fluent-bit.

  1. Mount a remote filesystem (tested with sshfs, cephfs, gpfs) on A from machine B
  2. use tail-plugin to follow a log on this mount
  3. write to log on machine B

Changes from machine A are read as expected and fluent-bit then also catches up with the written log. Just touching the file on machine A does not have the desired effect.

Expected behavior fluent-bit should tail all changes, regardless of the system it is running on.

Your Environment

  • Version used: latest git, fluent-bit 1.3.0
  • Operating System and version: Fedora 30, CentOS7, Funtoo 1.4, Funtoo 1.3
  • Filters and plugins: tail-plugin

Additional context It seems to be related to the use of inotify instead of stat. Forcing tail_fs_stat.c to be included instead of tail_fs_inotify.c in plugins/in_tail/tail_fs.c, e.g. by invoking cmake with -DFLB_INOTIFY=Off, seems to produce the expected behaviour (tested on Fedora 30 with sshfs mount, CentOS with GPFS).

Deaddy avatar Oct 08 '19 07:10 Deaddy

Any updates ?

ilanssari avatar Mar 11 '20 08:03 ilanssari

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

github-actions[bot] avatar Feb 03 '22 01:02 github-actions[bot]

Whatever stale means, eff off autoclose bot

Deaddy avatar Feb 03 '22 11:02 Deaddy

I wonder if Inotify_Watcher false helps here. This setting is per [INPUT] not global.

gavenkoa avatar Feb 16 '22 22:02 gavenkoa

Thanks!

Just for completeness: The version mentioned in my initial report did not have this keyword.

Current version (1.9.3, build from git) does indeed support the Inotify_Watcher directive for the tail-Input section, and setting it to false does lead to fluent-bit picking up changes on the remote filesystem.

Possibly a short note in the corresponding section in https://docs.fluentbit.io/manual/pipeline/inputs/tail might be useful, I am not sure how well known the workings of inotify and stat are.

Deaddy avatar Apr 25 '22 07:04 Deaddy

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

github-actions[bot] avatar Jul 25 '22 02:07 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jul 31 '22 02:07 github-actions[bot]