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

error message for misconfigured http_proxy is misleading #9327

Open
lecaros opened this issue Sep 2, 2024 · 0 comments · May be fixed by #9328
Open

error message for misconfigured http_proxy is misleading #9327

lecaros opened this issue Sep 2, 2024 · 0 comments · May be fixed by #9328

Comments

@lecaros
Copy link
Contributor

lecaros commented Sep 2, 2024

Bug Report

Describe the bug

Depending on what error (errno) was previously set, the message displayed for a wrongly configured http_proxy will be a non-related error message.

To Reproduce

  • Steps to reproduce the problem:

Use an http output plugin. Sample config below:

pipeline:
  inputs:
    - name: dummy
  outputs:
    - name: stdout
      match: "*"
    - name: http
      match: "*"
      host: ahost.domain.tld
service:
  log_level: debug

Run fluent-bit with the http_proxy environment variable set. Example below:

podman run --rm -it -e HTTP_PROXY=domain.tld -v $(pwd)/fluent-bit.yml:/fluent-bit/etc/fluent-bit.yml  fluent/fluent-bit:3.1.7 -c /fluent-bit/etc/fluent-bit.yml

Output of the run

Fluent Bit v3.1.7
* Copyright (C) 2015-2024 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io

______ _                  _    ______ _ _           _____  __  
|  ___| |                | |   | ___ (_) |         |____ |/  | 
| |_  | |_   _  ___ _ __ | |_  | |_/ /_| |_  __   __   / /`| | 
|  _| | | | | |/ _ \ '_ \| __| | ___ \ | __| \ \ / /   \ \ | | 
| |   | | |_| |  __/ | | | |_  | |_/ / | |_   \ V /.___/ /_| |_
\_|   |_|\__,_|\___|_| |_|\__| \____/|_|\__|   \_/ \____(_)___/

[2024/09/02 17:24:50] [ info] Configuration:
[2024/09/02 17:24:50] [ info]  flush time     | 1.000000 seconds
[2024/09/02 17:24:50] [ info]  grace          | 5 seconds
[2024/09/02 17:24:50] [ info]  daemon         | 0
[2024/09/02 17:24:50] [ info] ___________
[2024/09/02 17:24:50] [ info]  inputs:
[2024/09/02 17:24:50] [ info]      dummy
[2024/09/02 17:24:50] [ info] ___________
[2024/09/02 17:24:50] [ info]  filters:
[2024/09/02 17:24:50] [ info] ___________
[2024/09/02 17:24:50] [ info]  outputs:
[2024/09/02 17:24:50] [ info]      stdout.0
[2024/09/02 17:24:50] [ info]      http.1
[2024/09/02 17:24:50] [ info] ___________
[2024/09/02 17:24:50] [ info]  collectors:
[2024/09/02 17:24:50] [ info] [fluent bit] version=3.1.7, commit=c6e902a43a, pid=1
[2024/09/02 17:24:50] [debug] [engine] coroutine stack size: 196608 bytes (192.0K)
[2024/09/02 17:24:50] [ info] [storage] ver=1.5.2, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2024/09/02 17:24:50] [ info] [cmetrics] version=0.9.5
[2024/09/02 17:24:50] [ info] [ctraces ] version=0.5.5
[2024/09/02 17:24:50] [ info] [input:dummy:dummy.0] initializing
[2024/09/02 17:24:50] [ info] [input:dummy:dummy.0] storage_strategy='memory' (memory only)
[2024/09/02 17:24:50] [debug] [dummy:dummy.0] created event channels: read=21 write=22
[2024/09/02 17:24:50] [debug] [stdout:stdout.0] created event channels: read=23 write=24
[2024/09/02 17:24:50] [debug] [http:http.1] created event channels: read=30 write=31
[2024/09/02 17:24:50] [debug] [upstream] config->http_proxy: domain.tld
[2024/09/02 17:24:50] [error] [/src/fluent-bit/src/flb_upstream.c:293 errno=0] Success
[2024/09/02 17:24:50] [error] [output] failed to initialize 'http' plugin
[2024/09/02 17:24:50] [error] [engine] output initialization failed
[2024/09/02 17:24:50] [ info] [output:stdout:stdout.0] worker #0 started
[2024/09/02 17:24:51] [ info] [input] pausing dummy.0
[2024/09/02 17:24:51] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2024/09/02 17:24:51] [ info] [output:stdout:stdout.0] thread worker #0 stopped

Relevant lines from the log above:

[2024/09/02 17:24:50] [debug] [upstream] config->http_proxy: domain.tld
[2024/09/02 17:24:50] [error] [/src/fluent-bit/src/flb_upstream.c:293 errno=0] Success
[2024/09/02 17:24:50] [error] [output] failed to initialize 'http' plugin

In this case, the variable http_proxy doesn't contain the protocol but the error message says Success. If another value was previously set to errno, it will display the corresponding error message.

Expected behavior

It should display an error message that corresponds to the actual error.

Your Environment

  • Version used: 3.1.7 and master
  • Configuration: Provided above
  • Filters and plugins: http output

Additional context

Given the error is misleading, the user won't be able to solve the issue without checking the code or equivalent further troubleshooting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant