Skip to content

undefined method `have_capability?' for nil" #5152

@Watson1978

Description

@Watson1978

Discussed in #5151

Originally posted by krish0596 November 13, 2025

What is a problem?

I am getting this error
2025-11-13 09:34:22 +0000 [error]: fluent/log.rb:414:error: unexpected error error_class=NoMethodError error="undefined method have_capability?' for nil"`
when trying to load a containerized fluentd image with added capablities through daemon set, not able to resolve this issue

Environment

  • Linux / macOS
  • Fluentd 1.19.0 / 1.19.1

How to reproduce

  • configuration
<source>
  @type tail
  tag test

  # 1. Use file glob (*) to reproduce the error.
  # 2. Specify the path owned by other user.
  path /var/log/*.log

  <parse>
    @type none
  </parse>
</source>

<match **>
  @type stdout
</match>
  • result
$ ruby bin/fluentd -c ~/prj/sandbox/fluentd/capability.conf
2025-11-21 14:05:32 +0900 [info]: init supervisor logger path=nil rotate_age=nil rotate_size=nil
2025-11-21 14:05:32 +0900 [info]: parsing config file is succeeded path="/home/watson/prj/sandbox/fluentd/capability.conf"
2025-11-21 14:05:32 +0900 [info]: inaccessible include directory was specified path="/etc/fluent/conf.d"
2025-11-21 14:05:32 +0900 [info]: gem 'fluent-plugin-parser-winevt_xml' version '0.2.8'
2025-11-21 14:05:32 +0900 [info]: gem 'fluent-plugin-splunk-enterprise' version '0.10.2'
2025-11-21 14:05:32 +0900 [info]: gem 'fluent-plugin-splunk-hec' version '1.3.3'
2025-11-21 14:05:32 +0900 [info]: gem 'fluentd' version '1.19.1'
2025-11-21 14:05:32 +0900 [error]: unexpected error error_class=NoMethodError error="undefined method 'have_capability?' for nil"

My machine has following files in /var/log

$ ls -l /var/log/*.log
-rw-r--r-- 1 root root  43997 11月 21 10:52 /var/log/Xorg.0.log
-rw-r--r-- 1 root root  47791  1月 22  2025 /var/log/Xorg.1.log
-rw-r--r-- 1 root root  49470 11月 17 18:39 /var/log/Xorg.2.log
-rw------- 1 root root  14867 11月 21 10:52 /var/log/boot.log
-rw-r--r-- 1 root root 886824 11月 21 10:32 /var/log/pacman.log

When permissions are set in a way that makes them inaccessible to other users, such as /var/log/boot.log, then, specifying to read a file using glob, it causes an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions