-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Filter nest/lift is broken on Windows in 2.1.10 and 2.2.0 =>logs corrupted #8137
Comments
anyone? :-) |
Confirmed also broken on version 2.2.0. Last working version is 2.1.9 |
@cosmo0920 @nokute78 Let me know if I can provider more information to help out |
@cosmo0920 I don't have build environment on windows, but I tested it.
It will fail cause of decoder error and v2.1.10:
v2.1.9
|
@nokute78 Thanks for looking into this and providing a repro Any idea on how we can get it fixed? |
+1 facing this issue as well. Could you please fix? Thank you! |
+1 Thank you! |
Could someone pick this up, please? 🙏 |
Note: Removing
|
I tested out_file to get raw msgpack output.
Output in hex is
v2.1.10:
|
@leonardo-albertovich Could you check this issue ? We modified log_event_encoder issue for Windows. I think it relates this issue. The issue is that static void helper_pack_string_add_prefix(struct flb_log_event_encoder *log_encoder,
struct filter_nest_ctx *ctx,
const char *str,
int len)
{
flb_log_event_encoder_append_body_values(
log_encoder,
FLB_LOG_EVENT_STRING_LENGTH_VALUE(ctx->prefix_len + len),
FLB_LOG_EVENT_STRING_BODY_VALUE(ctx->prefix, ctx->prefix_len),
FLB_LOG_EVENT_STRING_BODY_VALUE(str, len));
} The flb_log_event_encoder patch is to fix following |
assigned to @leonardo-albertovich |
+1 |
+1 Thank you |
@leonardo-albertovich @edsiper |
Anyone that can pick up this one? |
@leonardo-albertovich I think this issue is caused by a type of Following function adds static void helper_pack_string_add_prefix(struct flb_log_event_encoder *log_encoder,
struct filter_nest_ctx *ctx,
const char *str,
int len)
{
flb_log_event_encoder_append_body_values(
log_encoder,
FLB_LOG_EVENT_STRING_LENGTH_VALUE(ctx->prefix_len + len),
FLB_LOG_EVENT_STRING_BODY_VALUE(ctx->prefix, ctx->prefix_len),
FLB_LOG_EVENT_STRING_BODY_VALUE(str, len));
}
This is caused by 10 + sizeof(size_t) * 3 since |
@leonardo-albertovich #include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <stdint.h>
typedef size_t* flb_log_event_encoder_size_t;
#define FLB_LOG_EVENT_STRING_LENGTH_VALUE_TYPE 1
#define FLB_LOG_EVENT_STRING_BODY_VALUE_TYPE 2
#define FLB_LOG_EVENT_STRING_LENGTH_VALUE(length) \
(int) FLB_LOG_EVENT_STRING_LENGTH_VALUE_TYPE, \
(flb_log_event_encoder_size_t) length
#define FLB_LOG_EVENT_STRING_BODY_VALUE(buffer, length) \
(int) FLB_LOG_EVENT_STRING_BODY_VALUE_TYPE, \
(char *) buffer, \
(flb_log_event_encoder_size_t) length
void Test(int loop_cnt, ...)
{
va_list arg;
int type1;
flb_log_event_encoder_size_t size;
char* str;
int i;
va_start(arg, loop_cnt);
for (i = 0; i < loop_cnt; i++) {
printf("i=%d\n", i);
type1 = va_arg(arg, int);
if (type1 != FLB_LOG_EVENT_STRING_LENGTH_VALUE_TYPE && type1 != FLB_LOG_EVENT_STRING_BODY_VALUE_TYPE) {
printf("%d:type is not length or body\n", i);
}
if (type1 == FLB_LOG_EVENT_STRING_LENGTH_VALUE_TYPE) {
size = va_arg(arg, flb_log_event_encoder_size_t);
printf("Len: size=%ld\n", size);
}
else if (type1 == FLB_LOG_EVENT_STRING_BODY_VALUE_TYPE) {
str = va_arg(arg, char*);
printf("Body: str=%s\n", str);
size = va_arg(arg, flb_log_event_encoder_size_t);
printf("Body: size=%ld\n", size);
}
}
va_end(arg);
}
int main(void) {
int cnt = 3;
size_t prefix_len = 10;
size_t len = 3;
Test(cnt,
FLB_LOG_EVENT_STRING_LENGTH_VALUE(prefix_len+len),
FLB_LOG_EVENT_STRING_BODY_VALUE("_map_data.", prefix_len),
FLB_LOG_EVENT_STRING_BODY_VALUE("key", len)
);
return 0;
} |
I don't have build environment for Windows but I sent a patch #8454 |
@nokute78 Is there a GitHub build for that so that I can pull a container image with the patch for testing? |
@janlonsetteig Sorry I don't know. @patrick-stephens Any ideas to get a following patched container image for windows ? |
We do not currently build Windows images for PRs (they take an absolute age and Windows runners cost more as well). Potentially you may be able to tweak the PR to include a CI update to build them though. I'll check if I can trigger a build manually as well, there are some additional workflows for that but not used them for a Windows container before... |
@nokute78 if we have a branch on this repo (the main OSS one) then we can trigger a build of all images via: https://github.com/fluent/fluent-bit/actions/workflows/build-branch-containers.yaml These will then be build and uploaded with a custom tag for people to pull from. |
Or you can trigger the same workflow on your side @nokute78? It'll be a public image under ghcr.io//... but that should not matter. |
@patrick-stephens Thank you for information. |
@patrick-stephens Action was failed because of OpenSSL. Could you check it ? |
@cosmo0920 Thank you for information. I rebased and run the action. |
@nokute78 I'm running ghcr.io/nokute78/fluent-bit/test/fix_8137:windows-2019-fix_8137 in one of our clusters now. It seems to fix the issue. I see logs working again now with nest/lift |
@nokute78 Any progress in verifying and releasing the fix? |
It is in the review queue, once merged it will go into the next release. |
Confirmed fixed in latest version |
Bug Report
Describe the bug
After upgrading from Fluent Bit 2.1.9 to 2.1.10 the nest/lift filter is no longer working and corrupts the logs
My case are Windows pods in k8s
Fluent Bit reads the log files and adds Kubernetes information. Then it nest/lift the Kubernetes fields
The result in cr.fluentbit.io/fluent/fluent-bit:windows-2019-2.1.10 would look something like this:
As you can see there are some weird characters in the log after doing nest/lift. And also some weird
117=>98, 101=>114, 110=>101, 116=>101, 115=>46, 108=>97
.All this works fine when I revert the container image to cr.fluentbit.io/fluent/fluent-bit:windows-2019-2.1.9
This is how the output looks in 2.1.9
For Linux containers nest/lift works as before after the upgrade. But I need it working for for Windows pods also
Let me know if you need more information to reproduce the issue
The text was updated successfully, but these errors were encountered: