Skip to content

Conversation

DoumanAsh
Copy link

@DoumanAsh DoumanAsh commented Oct 10, 2025

For my local build I used following configuration to build:

cmake .. -D FLB_OUT_KAFKA_REST=off -D FLB_OUT_KAFKA=off -D FLB_EXAMPLES=off -D FLB_SHARED_LIB=off -D FLB_SIGNV4=off -DFLB_SIGNV4=Off -DFLB_AWS=Off -DFLB_FILTER_AWS=Off -DFLB_OUT_S3=Off -DFLB_OUT_KINESIS_FIREHOSE=Off -DFLB_OUT_KINESIS_STREAMS=Off -DFLB_OUT_CLOUDWATCH_LOGS=Off -DFLB_OUT_BIGQUERY=Off -DFLB_KAFKA=off -DCMAKE_BUILD_TYPE=Release -DFLB_DEBUG=off -DFLB_RELEASE=on -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DFLB_WITHOUT_flb-it-pack=Yes -DFLB_WITHOUT_flb-it-utils=Yes -DFLB_WITHOUT_flb-it-aws_util=Yes -DFLB_WITHOUT_flb-it-aws_credentials_process=Yes -DFLB_TLS=Yes -DFLB_HTTP_SERVER=Yes  -G Ninja -DFLB_CORO_STACK_SIZE=24576 -DFLB_LUAJIT=off -DFLB_OUT_DATADOG=off -DFLB_OUT_AZURE=off -DFLB_OUT_AZURE_KUSTO=off -DFLB_OUT_PGSQL=off -DFLB_OUT_SLACK=off -DFLB_OUT_STACKDRIVER=off -DFLB_OUT_SPLUNK=off -DFLB_OUT_TD=off

It seems these headers are added transiently via other headers
I didn't look deeper into it but I found someone reporting similar problems
#9664

I was building version 4.1.0 on Alpine Linux (due to fluent-bit package still being in edge)

Summary by CodeRabbit

  • Chores
    • Performed minor internal maintenance to align include dependencies with current modules, improving code consistency and future compatibility.
    • Updated internal module references to maintain build reliability across environments.
    • No user-facing impact: functionality, performance, and behavior remain unchanged.

Copy link

coderabbitai bot commented Oct 10, 2025

Walkthrough

Two headers were added to src/flb_http_client.c: flb_config_map.h and flb_upstream_ha.h. No other code, logic, or control-flow modifications were made.

Changes

Cohort / File(s) Summary
HTTP client header additions
src/flb_http_client.c
Included flb_config_map.h and flb_upstream_ha.h; no logic changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I thump my paws—two headers hop inside,
flb_config_map and HA at my side.
No branches moved, no logic left to chase,
Just cleaner hops in an old familiar place.
🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title clearly and concisely summarizes the primary change—adding necessary headers to the http_client module to prevent build issues—without extraneous detail. It directly reflects the change set described in the diff and explains the context of missing headers based on build configuration. It is specific, readable, and no unnecessary terms are included.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@patrick-stephens
Copy link
Collaborator

Do you have a Dockerfile we can use to test it with?

@patrick-stephens
Copy link
Collaborator

Please follow the contribution guide and PR template - your commits and PR title need updating to follow the standard.

…build

Adds missing headers when building without AWS features

Signed-off-by: DoumanAsh <[email protected]>
@DoumanAsh DoumanAsh force-pushed the flb_http_client_headers branch from 63e526c to b458c76 Compare October 10, 2025 11:23
@DoumanAsh DoumanAsh changed the title Add required headers that might be missing depending on build http_client: Add required headers that might be missing depending on build Oct 10, 2025
@DoumanAsh
Copy link
Author

DoumanAsh commented Oct 10, 2025

Do you have a Dockerfile we can use to test it with?

No, I was testing it on my alpine server
I will prepare docker file and share it later

Please follow the contribution guide and PR template - your commits and PR title need updating to follow the standard.

Will update, sorry about that

@DoumanAsh
Copy link
Author

I created docker image with the same environment as my server (Alpine 3.22)
https://github.com/DoumanAsh/configs/blob/master/fluent-bit/docker/builder.Dockerfile

I'm using this patch https://github.com/DoumanAsh/configs/blob/master/fluent-bit/patch.txt to fix build

But if you use current v4.1.1 tag then build shall fail as following:

<built-in>: note: this is the location of the previous definition
/fluent-bit/src/flb_http_client.c: In function 'flb_http_client_session_begin':
/fluent-bit/src/flb_http_client.c:1942:25: error: implicit declaration of function 'flb_upstream_ha_node_get'; did you mean 'flb_upstream_queue_get'? [-Wimplicit-function-declaration]
 1942 |         upstream_node = flb_upstream_ha_node_get(client->upstream_ha);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
      |                         flb_upstream_queue_get
/fluent-bit/src/flb_http_client.c:1942:23: error: assignment to 'struct flb_upstream_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
 1942 |         upstream_node = flb_upstream_ha_node_get(client->upstream_ha);
      |                       ^
/fluent-bit/src/flb_http_client.c:1948:33: error: invalid use of undefined type 'struct flb_upstream_node'
 1948 |         upstream = upstream_node->u;
      |                                 ^~
/fluent-bit/src/flb_http_client.c:1950:57: error: invalid use of undefined type 'struct flb_upstream_node'
 1950 |         connection = flb_upstream_conn_get(upstream_node->u);
      |                                                         ^~
/fluent-bit/src/flb_http_client.c: In function 'flb_http_request_set_parameters_internal':
/fluent-bit/src/flb_http_client.c:2588:17: error: implicit declaration of function 'flb_config_map_foreach' [-Wimplicit-function-declaration]
 2588 |                 flb_config_map_foreach(iterator, config_map_list_entry, header_list) {
      |                 ^~~~~~~~~~~~~~~~~~~~~~
/fluent-bit/src/flb_http_client.c:2588:85: error: expected ';' before '{' token
 2588 |                 flb_config_map_foreach(iterator, config_map_list_entry, header_list) {
      |                                                                                     ^~
      |                                                                                     ;
/fluent-bit/src/flb_http_client.c:2488:37: warning: unused variable 'header_name' [-Wunused-variable]
 2488 |     struct flb_slist_entry         *header_name;
      |                                     ^~~~~~~~~~~
/fluent-bit/src/flb_http_client.c:2484:37: warning: unused variable 'header_value' [-Wunused-variable]
 2484 |     struct flb_slist_entry         *header_value;
      |                                     ^~~~~~~~~~~~
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<built-in>: note: this is the location of the previous definition
/fluent-bit/src/flb_http_common.c: In function 'flb_http_request_perform_signv4_signature':
/fluent-bit/src/flb_http_common.c:790:15: warning: unused variable 'signature' [-Wunused-variable]
  790 |     flb_sds_t signature;

If you use my patch it successfully builds

Note that it includes direct link to fts library, but I'm actually not sure whether it is alpine specific thing or not so I kept it out of this PR
But missing headers are quite obvious problem in source code itself

Build command:

podman build -t fluent-bit-build -f builder.Dockerfile ../

@DoumanAsh
Copy link
Author

DoumanAsh commented Oct 10, 2025

Please note that I didn't create this PR to enable support of Alpine, only to let you know that missing includes can be adjusted to enable build without above mentioned features enabled
If you prefer regular linux build, let me know

@DoumanAsh
Copy link
Author

DoumanAsh commented Oct 10, 2025

Debian based build:

/fluent-bit/src/flb_http_client.c: In function 'flb_http_client_session_begin':
/fluent-bit/src/flb_http_client.c:1942:25: error: implicit declaration of function 'flb_upstream_ha_node_get'; did you mean 'flb_upstream_queue_get'? [-Wimplicit-function-declaration]
 1942 |         upstream_node = flb_upstream_ha_node_get(client->upstream_ha);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~
      |                         flb_upstream_queue_get
/fluent-bit/src/flb_http_client.c:1942:23: error: assignment to 'struct flb_upstream_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
 1942 |         upstream_node = flb_upstream_ha_node_get(client->upstream_ha);
      |                       ^
/fluent-bit/src/flb_http_client.c:1948:33: error: invalid use of undefined type 'struct flb_upstream_node'
 1948 |         upstream = upstream_node->u;
      |                                 ^~
/fluent-bit/src/flb_http_client.c:1950:57: error: invalid use of undefined type 'struct flb_upstream_node'
 1950 |         connection = flb_upstream_conn_get(upstream_node->u);
      |                                                         ^~
/fluent-bit/src/flb_http_client.c: In function 'flb_http_request_set_parameters_internal':
/fluent-bit/src/flb_http_client.c:2588:17: error: implicit declaration of function 'flb_config_map_foreach' [-Wimplicit-function-declaration]
 2588 |                 flb_config_map_foreach(iterator, config_map_list_entry, header_list) {
      |                 ^~~~~~~~~~~~~~~~~~~~~~
/fluent-bit/src/flb_http_client.c:2588:85: error: expected ';' before '{' token
 2588 |                 flb_config_map_foreach(iterator, config_map_list_entry, header_list) {
      |                                                                                     ^~
      |                                                                                     ;
/fluent-bit/src/flb_http_client.c:2488:37: warning: unused variable 'header_name' [-Wunused-variable]
 2488 |     struct flb_slist_entry         *header_name;
      |                                     ^~~~~~~~~~~
/fluent-bit/src/flb_http_client.c:2484:37: warning: unused variable 'header_value' [-Wunused-variable]
 2484 |     struct flb_slist_entry         *header_value;
      |                                     ^~~~~~~~~~~~
[568/991] Building C object src/CMakeFiles/fluent-bit-static.dir/flb_http_client_http2.c.o
[569/991] Building C object src/CMakeFiles/fluent-bit-static.dir/flb_http_client_http1.c.o
[570/991] Building C object src/CMakeFiles/fluent-bit-static.dir/flb_callback.c.o
[571/991] Building C object src/CMakeFiles/fluent-bit-static.dir/flb_http_common.c.o
/fluent-bit/src/flb_http_common.c: In function 'flb_http_request_perform_signv4_signature':
/fluent-bit/src/flb_http_common.c:790:15: warning: unused variable 'signature' [-Wunused-variable]
  790 |     flb_sds_t signature;

Docker file:

FROM debian:stable-slim as builder

RUN set -eux && apt-get update && apt-get install -y --no-install-recommends libssl-dev flex bison libyaml-dev ninja-build git cmake ca-certificates gcc g++ make && apt-get clean && rm -rf /var/lib/apt/lists/*

RUN git clone --depth 1 --branch v4.1.1 https://github.com/fluent/fluent-bit.git

RUN cd fluent-bit/build && cmake .. -D FLB_OUT_KAFKA_REST=off -D FLB_OUT_KAFKA=off -D FLB_EXAMPLES=off -D FLB_SHARED_LIB=off -D FLB_SIGNV4=off -DFLB_SIGNV4=Off -DFLB_AWS=Off -DFLB_FILTER_AWS=Off -DFLB_OUT_S3=Off -DFLB_OUT_KINESIS_FIREHOSE=Off -DFLB_OUT_KINESIS_STREAMS=Off -DFLB_OUT_CLOUDWATCH_LOGS=Off -DFLB_OUT_BIGQUERY=Off -DFLB_KAFKA=off -DCMAKE_BUILD_TYPE=Release -DFLB_DEBUG=off -DFLB_RELEASE=on -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DFLB_WITHOUT_flb-it-pack=Yes -DFLB_WITHOUT_flb-it-utils=Yes -DFLB_WITHOUT_flb-it-aws_util=Yes -DFLB_WITHOUT_flb-it-aws_credentials_process=Yes -DFLB_TLS=Yes -DFLB_HTTP_SERVER=Yes  -G Ninja -DFLB_CORO_STACK_SIZE=24576 -DFLB_LUAJIT=off -DFLB_OUT_DATADOG=off -DFLB_OUT_AZURE=off -DFLB_OUT_AZURE_KUSTO=off -DFLB_OUT_PGSQL=off -DFLB_OUT_SLACK=off -DFLB_OUT_STACKDRIVER=off -DFLB_OUT_SPLUNK=off -DFLB_OUT_TD=off && cmake --build .

Using this PR, build will be successful too

@patrick-stephens
Copy link
Collaborator

Please note that I didn't create this PR to enable support of Alpine, only to let you know that missing includes can be adjusted to enable build without above mentioned features enabled If you prefer regular linux build, let me know

Yeah I think musl is the problem on Alpine: https://docs.fluentbit.io/manual/installation/downloads/docker#why-there-is-no-fluent-bit-docker-image-based-on-alpine-linux

Thanks for the updates.

@DoumanAsh
Copy link
Author

DoumanAsh commented Oct 10, 2025

Yeah I think musl is the problem on Alpine: https://docs.fluentbit.io/manual/installation/downloads/docker#why-there-is-no-fluent-bit-docker-image-based-on-alpine-linux

Ah, but I'm successfully running my build of fluent-bit to collect logs and metrics, so far there have been no issues to it (I do not really use docker, but rather just run Alpine on my server)

Nevertheless, as I mentioned, the same issue (missing headers) is observed with debian based image so feel free to merge this PR if you'd like it fixed (I imagine it is not really issue for most)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants