Skip to content

configuration reload fails when using "<<: !include" keyword in yaml configuration #3926

Open
@soukichi

Description

@soukichi

Describe the bug

configuration reload fails when using "<<: !include" keyword in yaml configuration

To Reproduce

use this configuration:

fluentd.yml

system:
  enable_jit: true
config:
  - source:
      $type: sample
      sample: '{"hello":"world"}'
      auto_increment_key: foo_key
      tag: sample
  - match:
      $type: stdout
      <<: !include output.yml

output.yml

$tag: "**"

exec fluentd

$ fluentd -c fluentd.yml
2022-10-24 14:06:40 +0900 [info]: parsing config file is succeeded path="fluentd.yml"
2022-10-24 14:06:40 +0900 [info]: gem 'fluentd' version '1.15.2'
2022-10-24 14:06:40 +0900 [info]: Oj isn't installed, fallback to Yajl as json parser
2022-10-24 14:06:40 +0900 [warn]: both of Plugin @id and path for <storage> are not specified. Using on-memory store.
2022-10-24 14:06:40 +0900 [warn]: both of Plugin @id and path for <storage> are not specified. Using on-memory store.
2022-10-24 14:06:40 +0900 [warn]: define <match fluent.**> to capture fluentd logs in top level is deprecated. Use <label @FLUENT_LOG> instead
2022-10-24 14:06:40 +0900 [info]: using configuration file: <ROOT>
  <system>
    enable_jit true
  </system>
  <source>
    @type sample
    sample {"hello":"world"}
    auto_increment_key "foo_key"
    tag "sample"
  </source>
  <match **>
    @type stdout
  </match>
</ROOT>
<snip>

exec config reload by USR2 signal
$ kill -USR2 -p 970480

fluentd says

2022-10-24 14:06:46 +0900 [info]: Reloading new config
2022-10-24 14:06:46 +0900 [error]: Failed to reload config file: expected '>' at fluentd.yml line 11,30
 10:       $type: stdout
 11:       <<: !include output.yml

     ------------------------------^

Expected behavior

The include keyword should be expanded as at startup

Your Environment

- Fluentd version:1.15.2
- Operating system:Ubuntu 22.04
- Kernel version:5.15.0-40

Your Configuration

system:
  enable_jit: true
config:
  - source:
      $type: sample
      sample: '{"hello":"world"}'
      auto_increment_key: foo_key
      tag: sample
  - match:
      $type: stdout
      <<: !include output.yml

output.yml> 
$tag: "**"

Your Error Log

2022-10-24 14:06:46 +0900 [error]: Failed to reload config file: expected '>' at ff.yml line 11,30
 10:       $type: stdout
 11:       <<: !include output.yml

     ------------------------------^

Additional context

No response

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