Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in_random does not work on Fluent Bit v2.1.3 master on Windows #7294

Closed
cosmo0920 opened this issue May 1, 2023 · 4 comments
Closed

in_random does not work on Fluent Bit v2.1.3 master on Windows #7294

cosmo0920 opened this issue May 1, 2023 · 4 comments
Assignees
Labels
bug status: waiting-for-triage Windows Bugs and requests about Windows platforms

Comments

@cosmo0920
Copy link
Contributor

cosmo0920 commented May 1, 2023

Bug Report

Describe the bug
With the commit 43682ad, in_random plugin is not working as expected. Instead, it always complains -5 errors.

To Reproduce

  • Rubular link if applicable:
  • Example log message if applicable:
$ .\bin\fluent-bit.exe -c .\lua.yaml
Fluent Bit v2.1.3
* Copyright (C) 2015-2022 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

[2023/05/01 18:00:18] [ info] [fluent bit] version=2.1.3, commit=43682ad1f8, pid=17740
[2023/05/01 18:00:18] [ info] [storage] ver=1.4.0, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2023/05/01 18:00:18] [ info] [cmetrics] version=0.6.1
[2023/05/01 18:00:18] [ info] [ctraces ] version=0.3.0
[2023/05/01 18:00:18] [ info] [input:random:random.0] initializing
[2023/05/01 18:00:18] [ info] [input:random:random.0] storage_strategy='memory' (memory only)
[2023/05/01 18:00:18] [ info] [sp] stream processor started
[2023/05/01 18:00:18] [ info] [output:stdout:stdout.0] worker #0 started
[2023/05/01 18:00:19] [error] [input:random:random.0] log event encoding error : -5
[2023/05/01 18:00:20] [error] [input:random:random.0] log event encoding error : -5
[2023/05/01 18:00:21] [error] [input:random:random.0] log event encoding error : -5
[2023/05/01 18:00:22] [error] [input:random:random.0] log event encoding error : -5
  • Steps to reproduce the problem:

Using with the following configuration:

lua.yaml

service:
    flush:           1
    daemon:          off
    log_level:       info

pipeline:
    inputs:
        - name:    random
          tag:     test
          samples: 10

    filters:
        - name:  lua
          match: "*"
          call:  append_tag
          code:  |
              function append_tag(tag, timestamp, record)
                 new_record = record
                 new_record["tag"] = tag
                 return 1, timestamp, new_record
              end

    outputs:
        - name:  stdout
          match: "*"

Expected behavior

When using in_random, the latter data pipeline should receive generate logs from there and without -5 errors.

Screenshots

Your Environment

  • Version used: Fluent Bit v2.1.3 master (43682ad)
  • Configuration: Described as above (lua.yaml)
  • Environment name and version (e.g. Kubernetes? What version?): On premise. Windows laptop
  • Server type and version:
  • Operating System and version: Windows 11 Pro 22H2
  • Filters and plugins:
    • input: random
    • filter: lua
    • output: stdout

Additional context

@cosmo0920 cosmo0920 added Windows Bugs and requests about Windows platforms status: waiting-for-triage labels May 1, 2023
@cosmo0920 cosmo0920 changed the title in_random does not work on Fluent Bit v2.1.2 on Windows in_random does not work on Fluent Bit v2.1.3 master on Windows May 2, 2023
@cosmo0920
Copy link
Contributor Author

cosmo0920 commented May 8, 2023

This issue is raised by the line: https://github.com/fluent/fluent-bit/blob/master/plugins/in_random/random.c#L80
The phenomenon will be suppressed with using FLB_LOG_EVENT_STRING_VALUE("rand_value", strlen("rand_value")) or stop using immediate value for the argument of that macro.

This behavior is weird and we have to digging for the root cause of this issue. Building fluent-bit with ASAN would be helpful.

@leonardo-albertovich
Copy link
Collaborator

According to https://github.com/fluent/fluent-bit/blob/master/include/fluent-bit/flb_log_event_encoder.h#L194 that's exactly how the macro FLB_LOG_EVENT_CSTRING_VALUE is expanded so I agree with you, we need to use ASAN and practical debugging to properly understand it.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

@cosmo0920
Copy link
Contributor Author

I confirmed that #7971 fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status: waiting-for-triage Windows Bugs and requests about Windows platforms
Projects
None yet
Development

No branches or pull requests

2 participants