Skip to content

Tail plugin permission error handling for extracrting paths(glob error handling) #10656

@kyo-ke

Description

@kyo-ke

Is your feature request related to a problem? Please describe.
This is about how tail polugin handle permission error generated by glob.
In currrent implementation if regex(Path option) matches directory which do not have enough permission, entire tail plugin will fail.
Ideal behaviour is showing warning for directory with permission issue and keep running.

Describe the solution you'd like
Create skip_permission_errors option and change path extraction(glob) logic like below
(https://github.com/fluent/fluent-bit/blob/master/plugins/in_tail/tail_scan_glob.c#L207)

/* Scan the given path */
ret = do_glob(path, GLOB_TILDE | GLOB_ERR, NULL, &globbuf);
/*Scan if aborted && skip_permission_errors is true*/
if (ret == GLOB_ABORTED && ctx->skip_permission_errors) {
    globfree(&globbuf);
    flb_plg_warn(ctx->ins, "read error, check permissions: %s", path);
    ret = do_glob(path, GLOB_TILDE, NULL, &globbuf);
}

Describe alternatives you've considered

Additional context
Stopping entire input plugin is not ideal behaviour.
Planning to set default for skip_permission_errors false so that no behaviour change for existing configuration.

We have local version with this change and happy to contribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions