fluent-bit: Docker multiline parser errors
Bug Report
Describe the bug When using the docker multiline parser we get a lot of errors in the following format.
[2021/07/29 08:27:45] [error] [multiline] invalid stream_id 1817450727403209240, could not append content to multiline context
To Reproduce Our fluent-bit config which is running via the official Helm chart on an EKS cluster.
[SERVICE]
Daemon Off
Flush 1
Log_Level info
HTTP_Server On
HTTP_Listen 0.0.0.0
HTTP_Port 2020
storage.path /var/log/flb-storage/
storage.sync normal
storage.checksum off
storage.max_chunks_up 128
storage.backlog.mem_limit 16M
storage.metrics on
Parsers_File parsers.conf
Parsers_File custom_parsers.conf
[INPUT]
Name tail
Path /var/log/containers/*.log
multiline.parser docker, cri
Tag kube.*
Skip_Long_Lines On
Buffer_Chunk_Size 32k
Buffer_Max_Size 256k
DB /var/log/flb-storage/tail.db
DB.Sync normal
storage.type filesystem
[FILTER]
Name kubernetes
Match kube.*
Merge_Log On
Merge_Log_Key log_processed
Merge_Log_Trim On
Keep_Log Off
K8S-Logging.Parser On
K8S-Logging.Exclude On
[OUTPUT]
Name forward
Match *
Host fluentd.logging.svc
Port 24224
Expected behavior
Screenshots
Your Environment
- Version used: v1.8.2
- Configuration: See above
- Environment name and version (e.g. Kubernetes? What version?): EKS v1.21
- Server type and version: n/a
- Operating System and version: n/a
- Filters and plugins: See above
Additional context
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 29
- Comments: 52 (11 by maintainers)
FYI: we are taking a look at this
Fixed by #4197, it has been merged on v1.8 branch for the next release.
We’re experiencing the same issue with same conditions. Just after error firstly occurs, logs are dropped from output. None of our config changes made it work as expected.
Just encountered the same issue as well when running a performance test (app container generating a burst of logs; Fluent Bit tailing that container log file).
Specifically, here is what we observed:
[2021/09/03 18:47:40] [error] [multiline] invalid stream_id 4395029823782301522, could not append content to multiline contextmultiline.parser cri, dockermultiline.parser cri1.8.51.8.4We are encountering the same issue on
1.8.3, I can gladly attach more details if needed.I’ve pinned image version to 1.8.3 manually and can unfortunately say the error is still happening. Reboot seems to help temporarily. I managed to spot a moment when this error starts for the first time before the buffer gets flooded with error lines:
Seeing the error starts happening just after log rotation is detected by the
tailinput, I think they must be related?EDIT 1: Could be linked to https://github.com/fluent/fluent-bit/issues/3883?
EDIT 2: Also, I’ve just seen another log rotation happening but it didn’t trigger the issue so the problem might not be that easy to reproduce.
EDIT 3: Another error started happening just after log rotation:
I have had 1.8.9 deployed for a few days now. Didn’t occur again, would happen multiple times per day before. Looks like it’s fixed. Thanks @nokute78
My test rig where I was using td-agent-bit from the command line (without Kubernetes or Docker), and pushing large files through it interspersed with manual rotations while using the tail input … well, on 1.8.5 this would fail very fast, very consistently. As in within 2-3 rotations of large files. On 1.8.9, I have yet to encounter the “invalid streamid” error after twenty rotations. That may seem like a little, but actually it was more than enough to see multiple failures before.
I just deployed 1.8.9 in our cluster, now monitoring over the day if it’s fixed.
https://fluentbit.io/announcements/v1.8.9/
Do we have an ETA for this one?
We’re having the same issue with FluentBit v1.8.3.
Kubernetes versions
The error come up gradually and no logs are collected by FluentBit eventually. We had to restart the FluentBit Pods.
Pod spec
Fluent-bit config
Tail plugin works fine until the log-rotation. Once log rotates then we see
could not append content to multiline contextTo reproduce the issue, apply a pod spec that writes bunch of chars to the stdout, kubelet will rotate the log files once the limit is reached (10MB). I was able to reproduce the issue consistently under 2mins.