Skip to content

Error: undefined local variable or method 'log' for module OS #13

@tmysik

Description

@tmysik

Just tried to use fluent-plugin-oci-logging plugin (with instance principal) with the latest Fluentd v6. If the plugin is not configured/used, Fluentd works. Whenever one wants to use/configure the plugin, this error occurs:

2025-11-13 13:11:21 +0000 [error]: fluent/log.rb:414:: unexpected error error_class=NameError error="undefined local variable or method 'log' for module OS"
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluent-plugin-oci-logging-1.0.12/lib/fluent/plugin/os.rb:48:in 'OS.os_name_ubuntu?'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluent-plugin-oci-logging-1.0.12/lib/fluent/plugin/os.rb:27:in 'OS.ubuntu?'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluent-plugin-oci-logging-1.0.12/lib/fluent/plugin/logging_setup.rb:226:in 'Fluent::Plugin::PublicLoggingSetup#set_default_ca_file'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluent-plugin-oci-logging-1.0.12/lib/fluent/plugin/logging_setup.rb:172:in 'Fluent::Plugin::PublicLoggingSetup#get_signer'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluent-plugin-oci-logging-1.0.12/lib/fluent/plugin/out_oci_logging.rb:52:in 'Fluent::Plugin::OCILoggingOutput#configure'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluentd-1.19.0/lib/fluent/plugin.rb:187:in 'Fluent::Plugin::FeatureAvailabilityChecker#configure'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluentd-1.19.0/lib/fluent/agent.rb:132:in 'Fluent::Agent#add_match'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluentd-1.19.0/lib/fluent/agent.rb:74:in 'block in Fluent::Agent#configure'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluentd-1.19.0/lib/fluent/agent.rb:64:in 'Array#each'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluentd-1.19.0/lib/fluent/agent.rb:64:in 'Fluent::Agent#configure'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluentd-1.19.0/lib/fluent/root_agent.rb:184:in 'Fluent::RootAgent#configure'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluentd-1.19.0/lib/fluent/engine.rb:107:in 'Fluent::EngineClass#configure'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluentd-1.19.0/lib/fluent/engine.rb:82:in 'Fluent::EngineClass#run_configure'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluentd-1.19.0/lib/fluent/supervisor.rb:720:in 'Fluent::Supervisor#run_supervisor'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluentd-1.19.0/lib/fluent/command/fluentd.rb:362:in '<top (required)>'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: <internal:/opt/fluent/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: <internal:/opt/fluent/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/lib/ruby/gems/3.4.0/gems/fluentd-1.19.0/bin/fluentd:15:in '<top (required)>'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/bin/fluentd:25:in 'Kernel#load'
  2025-11-13 13:11:21 +0000 [debug]: command/fluentd.rb:362:: /opt/fluent/bin/fluentd:25:in '<main>'

My environment:

  • Oracle Linux 10 (an OCI instance in the Frankfurt region)
  • Fluentd: fluent-package 6.0.0 fluentd 1.19.0 (ed15edc4b7c86c1fcea3fbf326b7c42325e6fc71) (installed manually from an RPM package, following the official guide)
  • fluent-plugin-oci-logging: 1.0.12

My Fluentd configuration:

<source>
        @type tail
        path ...
        pos_file ...
        tag log
        read_from_head true

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

<match log>
        @type oci_logging
        log_object_id ocid1.log.oc1.eu-frankfurt-1....
</match>

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