Bug 296082 - sysutils/fluent-bit: tail input with inotify gets EINVAL registering file
Summary: sysutils/fluent-bit: tail input with inotify gets EINVAL registering file
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Palle Girgensohn
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-06-16 05:49 UTC by Doug White
Modified: 2026-08-05 13:13 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (girgen)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Doug White 2026-06-16 05:49:26 UTC
fluent-bit with a tail input processor on FreeBSD 15 gets EINVAL when trying to register the file to watch. Tried on 15.1-RELEASE. Not sure if this is a bug in fluent-bit or in FreeBSD. inotify support in the base system is new in 15. Originally installed from package, also tried building fluent-bit from ports, same error.

Workaround is to disable inotify for the particular input stage via the "inotify_watcher false" configuration directive.

A quick browse of the fluent-bit source didn't identify any obvious issues. There are lots of sources of EINVAL.

Jun 15 22:31:28 xxx fluent[14664]: [2026/06/15 22:31:28.216] [error] [/usr/ports/sysutils/fluent-bit/work/fluent-bit-5.0.7/plugins/in_tail/tail_fs_inotify.c:148 errno=22] Invalid argument
Jun 15 22:31:28 xxx fluent[14664]: [2026/06/15 22:31:28.216] [error] [input:tail:tail.1] inode=116789954 cannot register file /var/log/anubis.log
Comment 1 Doug White 2026-06-16 06:13:56 UTC
Also, libinotify is also installed on this system (for py-pyinotify, it hasn't been updated to use libc inotify on FreeBSD 15 yet). 

ldd doesn't show libinotify being linked against fluent-bit, so I'm pretty sure its using the libc version, but if fluent-bit works on a clean system then it might be due to a conflict of some kind.
Comment 2 Doug White 2026-08-04 22:00:29 UTC
I was able to remove the last thing using the libinotify port on the machine  that is returning this error, but the error still persists. It seems fluent-bit's usage of inotify is not compatible with the FreeBSD libc implementation, or its putting something in the structs the implementation doesn't like. (Maybe a C vs C++ struct alignment thing?)
Comment 3 Palle Girgensohn freebsd_committer freebsd_triage 2026-08-05 08:38:20 UTC
Hi Doug,

Can you supply a simple test case, so I can see if I can reproduce the problem?

IIRC, FreeBSD's notify is not identical to Linux's, so it might be that it is not properly implemented. This is just guessworks from me though...

If I can reproduce it with a simple configuration, I might be able to help.

Cheers,
Palle
Comment 4 Doug White 2026-08-05 13:13:06 UTC
This command will generate the error (pick any file you like that exists):

fluent-bit -i tail -p path=/var/log/messages -o stdout