Azure Blob output plugin fails to upload data into blob storage
Bug Report
Describe the bug
The plugin fails to create an upstream connection for a container check and therefore fails to upload data into Azure blob storage.
To Reproduce
This issue can be reproduced by using any version newer than 1.6.10 and using azure_blob as an output. There is a similar unfixed, but closed, issue about log analytics and a mention of all HTTPS resources being affected. Links to similar issues are listed later.
Here is a full log output, with sensitive values redacted, where this issue can be seen.
Fluent Bit v1.8.8
* Copyright (C) 2019-2021 The Fluent Bit Authors
* Copyright (C) 2015-2018 Treasure Data
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2021/10/13 08:32:17] [ info] Configuration:
[2021/10/13 08:32:17] [ info] flush time | 5.000000 seconds
[2021/10/13 08:32:17] [ info] grace | 5 seconds
[2021/10/13 08:32:17] [ info] daemon | 0
[2021/10/13 08:32:17] [ info] ___________
[2021/10/13 08:32:17] [ info] inputs:
[2021/10/13 08:32:17] [ info] tail
[2021/10/13 08:32:17] [ info] ___________
[2021/10/13 08:32:17] [ info] filters:
[2021/10/13 08:32:17] [ info] ___________
[2021/10/13 08:32:17] [ info] outputs:
[2021/10/13 08:32:17] [ info] azure_blob.0
[2021/10/13 08:32:17] [ info] ___________
[2021/10/13 08:32:17] [ info] collectors:
[2021/10/13 08:32:17] [ info] [engine] started (pid=1112)
[2021/10/13 08:32:17] [debug] [engine] coroutine stack size: 98302 bytes (96.0K)
[2021/10/13 08:32:17] [debug] [storage] [cio stream] new stream registered: tail.0
[2021/10/13 08:32:17] [ info] [storage] version=1.1.4, initializing...
[2021/10/13 08:32:17] [ info] [storage] in-memory
[2021/10/13 08:32:17] [ info] [storage] normal synchronization mode, checksum disabled, max_chunks_up=128
[2021/10/13 08:32:17] [ info] [cmetrics] version=0.2.2
[2021/10/13 08:32:17] [debug] [input:tail:tail.0] flb_tail_fs_stat_init() initializing stat tail input
[2021/10/13 08:32:17] [debug] [input:tail:tail.0] inode=281474976710698 with offset=0 appended as D:\app\restart.log
[2021/10/13 08:32:17] [debug] [input:tail:tail.0] inode=281474976710697 with offset=10356018 appended as D:\app\service.log
[2021/10/13 08:32:17] [debug] [input:tail:tail.0] 2 new files found on path 'D:\app\*.log'
[2021/10/13 08:32:17] [debug] [azure_blob:azure_blob.0] created event channels: read=716 write=720
[2021/10/13 08:32:17] [ info] [output:azure_blob:azure_blob.0] account_name=redacted, container_name=fluent-bit-logs, blob_type=appendblob, emulator_mode=no, endpoint=redacted.blob.core.windows.net
[2021/10/13 08:32:17] [debug] [router] match rule tail.0:azure_blob.0
[2021/10/13 08:32:17] [ info] [sp] stream processor started
[2021/10/13 08:32:17] [debug] [input:tail:tail.0] inode=281474976710698 file=D:\app\restart.log promote to TAIL_EVENT
[2021/10/13 08:32:17] [debug] [input:tail:tail.0] inode=281474976710697 file=D:\app\service.log promote to TAIL_EVENT
[2021/10/13 08:32:22] [debug] [task] created task=00000212320A6840 id=0 OK
[2021/10/13 08:32:22] [debug] [upstream] connection #836 failed to redacted.blob.core.windows.net:443
[2021/10/13 08:32:22] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/10/13 08:32:22] [debug] [out coro] cb_destroy coro_id=0
[2021/10/13 08:32:22] [debug] [retry] new retry created for task_id=0 attempts=1
[2021/10/13 08:32:22] [ warn] [engine] failed to flush chunk '1112-1634113937.488105700.flb', retry in 10 seconds: task_id=0, input=tail.0 > output=azure_blob.0 (out_id=0)
[2021/10/13 08:32:27] [debug] [task] created task=00000212320A5180 id=1 OK
[2021/10/13 08:32:27] [debug] [upstream] connection #868 failed to redacted.blob.core.windows.net:443
[2021/10/13 08:32:27] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/10/13 08:32:27] [debug] [out coro] cb_destroy coro_id=1
[2021/10/13 08:32:27] [debug] [retry] new retry created for task_id=1 attempts=1
[2021/10/13 08:32:27] [ warn] [engine] failed to flush chunk '1112-1634113943.231139400.flb', retry in 6 seconds: task_id=1, input=tail.0 > output=azure_blob.0 (out_id=0)
[2021/10/13 08:32:32] [debug] [task] created task=00000212320A5CE0 id=2 OK
[2021/10/13 08:32:32] [debug] [upstream] connection #872 failed to redacted.blob.core.windows.net:443
[2021/10/13 08:32:32] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/10/13 08:32:32] [debug] [out coro] cb_destroy coro_id=2
[2021/10/13 08:32:32] [debug] [retry] new retry created for task_id=2 attempts=1
[2021/10/13 08:32:32] [ warn] [engine] failed to flush chunk '1112-1634113947.726953400.flb', retry in 9 seconds: task_id=2, input=tail.0 > output=azure_blob.0 (out_id=0)
[2021/10/13 08:32:32] [debug] [upstream] connection #896 failed to redacted.blob.core.windows.net:443
[2021/10/13 08:32:32] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/10/13 08:32:32] [debug] [out coro] cb_destroy coro_id=3
[2021/10/13 08:32:32] [debug] [task] task_id=0 reached retry-attempts limit 1/1
[2021/10/13 08:32:32] [ warn] [engine] chunk '1112-1634113937.488105700.flb' cannot be retried: task_id=0, input=tail.0 > output=azure_blob.0
[2021/10/13 08:32:32] [debug] [task] destroy task=00000212320A6840 (task_id=0)
[2021/10/13 08:32:33] [debug] [upstream] connection #912 failed to redacted.blob.core.windows.net:443
[2021/10/13 08:32:33] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/10/13 08:32:33] [debug] [out coro] cb_destroy coro_id=4
[2021/10/13 08:32:33] [debug] [task] task_id=1 reached retry-attempts limit 1/1
[2021/10/13 08:32:33] [ warn] [engine] chunk '1112-1634113943.231139400.flb' cannot be retried: task_id=1, input=tail.0 > output=azure_blob.0
[2021/10/13 08:32:33] [debug] [task] destroy task=00000212320A5180 (task_id=1)
[2021/10/13 08:32:34] [engine] caught signal (SIGINT)
[2021/10/13 08:32:34] [ info] [input] pausing tail.0
[2021/10/13 08:32:34] [ info] [input:tail:tail.0] flushing pending multiline data...
[2021/10/13 08:32:34] [debug] [task] created task=00000212320A6020 id=0 OK
[2021/10/13 08:32:34] [ warn] [engine] service will stop in 5 seconds
Expected behavior
Data is uploaded into Azure blob storage like it was with version 1.6.10.
Your Environment
- Version used: Any version between 1.7.0 and 1.8.8
- Operating System and version: Windows Server 2019
- Filters and plugins: tail, azure_blob
Additional context
Similar issues:
- https://github.com/fluent/fluent-bit/issues/3625
- https://github.com/fluent/fluent-bit/issues/3594
Couple of quotes from the linked issues:
This issue seems to be affecting all resources relying on HTTPS, I tried to Azure blob storage account and it fails with similar issue as well
[2021/06/26 01:32:45] [ warn] [engine] chunk '4516-1624671151.718337000.flb' cannot be retried: task_id=1, input=tail.0 > output=azure_blob.2 [2021/06/26 01:32:45] [debug] [task] destroy task=000001BF7B00AE90 (task_id=1) [2021/06/26 01:32:45] [debug] [upstream] connection #1296 failed to d5ebf0b9-636b-41e9-b99a-d6f5f0f513f7.ods.opinsights.azure.com:443 [2021/06/26 01:32:45] [debug] [out coro] cb_destroy coro_id=87 [2021/06/26 01:32:45] [debug] [task] task_id=7 reached retry-attempts limit 1/1 [2021/06/26 01:32:45] [ warn] [engine] chunk '4516-1624671154.828053800.flb' cannot be retried: task_id=7, input=tail.0 > output=azure.1 [2021/06/26 01:32:45] [debug] [task] destroy task=000001BF7B00B0D0 (task_id=7) [2021/06/26 01:32:45] [debug] [upstream] connection #1048 failed to fluentbdump.blob.core.windows.net:443 [2021/06/26 01:32:45] [error] [output:azure_blob:azure_blob.2] cannot create upstream connection for container check [2021/06/26 01:32:45] [debug] [out coro] cb_destroy coro_id=87
Originally posted by @artisticcheese in https://github.com/fluent/fluent-bit/issues/3625#issuecomment-868918147
Log Analytics is broken for all 1.7 windows versions
Originally posted by @artisticcheese in https://github.com/fluent/fluent-bit/issues/3594#issuecomment-868839967
When the storage account allows connections without TLS and azure_bolb plugin is configured with tls off, the version 1.8.9 is able to connect to the server and append content to the blobs.
Fluent Bit v1.8.9
* Copyright (C) 2019-2021 The Fluent Bit Authors
* Copyright (C) 2015-2018 Treasure Data
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2021/11/04 07:31:57] [ info] [engine] started (pid=1496)
[2021/11/04 07:31:57] [ info] [storage] version=1.1.5, initializing...
[2021/11/04 07:31:57] [ info] [storage] in-memory
[2021/11/04 07:31:57] [ info] [storage] normal synchronization mode, checksum disabled, max_chunks_up=128
[2021/11/04 07:31:57] [ info] [cmetrics] version=0.2.2
[2021/11/04 07:31:57] [ info] [output:azure_blob:azure_blob.0] account_name=akaf72w65bst7f11lcsc, container_name=dummy, blob_type=appendblob, emulator_mode=no, endpoint=akaf72w65bst7f11lcsc.blob.core.windows.net
[2021/11/04 07:31:57] [ info] [sp] stream processor started
[2021/11/04 07:32:02] [ info] [output:azure_blob:azure_blob.0] container 'dummy' not found, trying to create it
[2021/11/04 07:32:02] [ info] [output:azure_blob:azure_blob.0] container 'dummy' created sucessfully
[2021/11/04 07:32:02] [ info] [output:azure_blob:azure_blob.0] blob not found: /dummy/test?comp=appendblock
[2021/11/04 07:32:02] [ info] [output:azure_blob:azure_blob.0] blob created successfully: /dummy/test
[2021/11/04 07:32:02] [ info] [output:azure_blob:azure_blob.0] content appended to blob successfully
[2021/11/04 07:32:07] [ info] [output:azure_blob:azure_blob.0] content appended to blob successfully
[2021/11/04 07:32:12] [ info] [output:azure_blob:azure_blob.0] content appended to blob successfully
[2021/11/04 07:32:15] [engine] caught signal (SIGINT)
[2021/11/04 07:32:15] [ warn] [engine] service will stop in 5 seconds
[2021/11/04 07:32:15] [ info] [output:azure_blob:azure_blob.0] content appended to blob successfully
[2021/11/04 07:32:20] [ info] [engine] service stopped
When the storage account doesn't allow connections without TLS, minimum TLS version set to 1.0, and azure_bolb plugin is configured with tls on, the version 1.8.9 is not able to connect to the server and thus appends fail.
Fluent Bit v1.8.9
* Copyright (C) 2019-2021 The Fluent Bit Authors
* Copyright (C) 2015-2018 Treasure Data
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2021/11/04 07:33:35] [ info] [engine] started (pid=7524)
[2021/11/04 07:33:35] [ info] [storage] version=1.1.5, initializing...
[2021/11/04 07:33:35] [ info] [storage] in-memory
[2021/11/04 07:33:35] [ info] [storage] normal synchronization mode, checksum disabled, max_chunks_up=128
[2021/11/04 07:33:35] [ info] [cmetrics] version=0.2.2
[2021/11/04 07:33:35] [ info] [output:azure_blob:azure_blob.0] account_name=akaf72w65bst7f11lcsc, container_name=dummy, blob_type=appendblob, emulator_mode=no, endpoint=akaf72w65bst7f11lcsc.blob.core.windows.net
[2021/11/04 07:33:35] [ info] [sp] stream processor started
[2021/11/04 07:33:40] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/11/04 07:33:40] [ warn] [engine] failed to flush chunk '7524-1636011216.143775400.flb', retry in 6 seconds: task_id=0, input=dummy.0 > output=azure_blob.0 (out_id=0)
[2021/11/04 07:33:45] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/11/04 07:33:45] [ warn] [engine] failed to flush chunk '7524-1636011221.148311100.flb', retry in 7 seconds: task_id=1, input=dummy.0 > output=azure_blob.0 (out_id=0)
[2021/11/04 07:33:46] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/11/04 07:33:46] [ warn] [engine] failed to flush chunk '7524-1636011216.143775400.flb', retry in 19 seconds: task_id=0, input=dummy.0 > output=azure_blob.0 (out_id=0)
[2021/11/04 07:33:50] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/11/04 07:33:50] [ warn] [engine] failed to flush chunk '7524-1636011225.155619900.flb', retry in 7 seconds: task_id=2, input=dummy.0 > output=azure_blob.0 (out_id=0)
[2021/11/04 07:33:52] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/11/04 07:33:52] [ warn] [engine] failed to flush chunk '7524-1636011221.148311100.flb', retry in 7 seconds: task_id=1, input=dummy.0 > output=azure_blob.0 (out_id=0)
[2021/11/04 07:33:55] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/11/04 07:33:55] [ warn] [engine] failed to flush chunk '7524-1636011231.150526000.flb', retry in 7 seconds: task_id=3, input=dummy.0 > output=azure_blob.0 (out_id=0)
[2021/11/04 07:33:57] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/11/04 07:33:57] [ warn] [engine] failed to flush chunk '7524-1636011225.155619900.flb', retry in 14 seconds: task_id=2, input=dummy.0 > output=azure_blob.0 (out_id=0)
[2021/11/04 07:33:59] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/11/04 07:33:59] [ warn] [engine] failed to flush chunk '7524-1636011221.148311100.flb', retry in 37 seconds: task_id=1, input=dummy.0 > output=azure_blob.0 (out_id=0)
[2021/11/04 07:34:00] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/11/04 07:34:00] [ warn] [engine] failed to flush chunk '7524-1636011236.149824400.flb', retry in 11 seconds: task_id=4, input=dummy.0 > output=azure_blob.0 (out_id=0)
[2021/11/04 07:34:02] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/11/04 07:34:02] [ warn] [engine] failed to flush chunk '7524-1636011231.150526000.flb', retry in 19 seconds: task_id=3, input=dummy.0 > output=azure_blob.0 (out_id=0)
[2021/11/04 07:34:02] [engine] caught signal (SIGINT)
[2021/11/04 07:34:02] [ warn] [engine] service will stop in 5 seconds
[2021/11/04 07:34:02] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/11/04 07:34:02] [ warn] [engine] failed to flush chunk '7524-1636011241.156034800.flb', retry in 7 seconds: task_id=5, input=dummy.0 > output=azure_blob.0 (out_id=0)
[2021/11/04 07:34:05] [error] [output:azure_blob:azure_blob.0] cannot create upstream connection for container check
[2021/11/04 07:34:05] [ warn] [engine] failed to flush chunk '7524-1636011216.143775400.flb', retry in 34 seconds: task_id=0, input=dummy.0 > output=azure_blob.0 (out_id=0)
[2021/11/04 07:34:07] [ info] [engine] service stopped
My suspicion is that there is something wrong with the TLS library change introduced in version 1.7.0 (https://fluentbit.io/announcements/v1.7.0/).
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.