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

wasm filter unable to load module #10196

Open
asimbera opened this issue Apr 10, 2025 · 0 comments
Open

wasm filter unable to load module #10196

asimbera opened this issue Apr 10, 2025 · 0 comments

Comments

@asimbera
Copy link

Bug Report

Describe the bug

I've been trying to run filter_rust module from the examples but fluent-bit is not able to load the wasm module.

To Reproduce

  • Example log message:
Apr 10 08:45:17 devbox fluent-bit[1680]: [2025/04/10 08:45:17] [debug] [dummy:dummy.0] created event channels: read=25 write=26  
Apr 10 08:45:17 devbox fluent-bit[1680]: [2025/04/10 08:45:17] [ info] [input:storage_backlog:storage_backlog.1] initializing  
Apr 10 08:45:17 devbox fluent-bit[1680]: [2025/04/10 08:45:17] [ info] [input:storage_backlog:storage_backlog.1] storage_strategy='memory' (memory only)  
Apr 10 08:45:17 devbox fluent-bit[1680]: [2025/04/10 08:45:17] [debug] [storage_backlog:storage_backlog.1] created event channels: read=27 write=28  
Apr 10 08:45:17 devbox fluent-bit[1680]: [2025/04/10 08:45:17] [ info] [input:storage_backlog:storage_backlog.1] queue memory limit: 4.8M  
Apr 10 08:45:17 devbox fluent-bit[1680]: [2025/04/10 08:45:17] [debug] [stdout:stdout.0] created event channels: read=29 write=30  
Apr 10 08:45:17 devbox fluent-bit[1680]: [2025/04/10 08:45:17] [debug] [router] match rule dummy.0:stdout.0  
Apr 10 08:45:17 devbox fluent-bit[1680]: [2025/04/10 08:45:17] [ info] [output:stdout:stdout.0] worker #0 started  
Apr 10 08:45:17 devbox fluent-bit[1680]: [2025/04/10 08:45:17] [ info] [http_server] listen iface=0.0.0.0 tcp_port=2020  
Apr 10 08:45:17 devbox fluent-bit[1680]: [2025/04/10 08:45:17] [ info] [sp] stream processor started  
Apr 10 08:45:27 devbox fluent-bit[1680]: [2025/04/10 08:45:27] [error] Load wasm module failed. error: WASM module load failed: zero byte expected  
Apr 10 08:45:27 devbox fluent-bit[1680]: [2025/04/10 08:45:27] [debug] [filter:wasm:wasm.0] instantiate wasm [/etc/fluent-bit/wasm/flb_filter_rust.wasm] failed  
Apr 10 08:45:28 devbox fluent-bit[1680]: [2025/04/10 08:45:28] [debug] [task] created task=0x79bc8123d960 id=0 OK  
Apr 10 08:45:28 devbox fluent-bit[1680]: [2025/04/10 08:45:28] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0  
Apr 10 08:45:28 devbox fluent-bit[1680]: [0] log.dummy: [[1744274727.544759457, {}], {"message"=>"dummy"}]  
Apr 10 08:45:28 devbox fluent-bit[1680]: [2025/04/10 08:45:28] [debug] [out flush] cb_destroy coro_id=0  
Apr 10 08:45:28 devbox fluent-bit[1680]: [2025/04/10 08:45:28] [debug] [task] destroy task=0x79bc8123d960 (task_id=0)  
Apr 10 08:45:37 devbox fluent-bit[1680]: [2025/04/10 08:45:37] [error] Load wasm module failed. error: WASM module load failed: zero byte expected  
Apr 10 08:45:37 devbox fluent-bit[1680]: [2025/04/10 08:45:37] [debug] [filter:wasm:wasm.0] instantiate wasm [/etc/fluent-bit/wasm/flb_filter_rust.wasm] failed  
Apr 10 08:45:38 devbox fluent-bit[1680]: [2025/04/10 08:45:38] [debug] [task] created task=0x79bc8123d820 id=0 OK  
Apr 10 08:45:38 devbox fluent-bit[1680]: [2025/04/10 08:45:38] [debug] [output:stdout:stdout.0] task_id=0 assigned to thread #0  
Apr 10 08:45:38 devbox fluent-bit[1680]: [0] log.dummy: [[1744274737.544253440, {}], {"message"=>"dummy"}]  
Apr 10 08:45:38 devbox fluent-bit[1680]: [2025/04/10 08:45:38] [debug] [out flush] cb_destroy coro_id=1  
Apr 10 08:45:38 devbox fluent-bit[1680]: [2025/04/10 08:45:38] [debug] [task] destroy task=0x79bc8123d820 (task_id=0)
  • Steps to reproduce the problem:

Expected behavior

This should not be causing an error and output a similar message that is definded in rust source code:

{
      "message": v["message"],
      "time": format!("{}", time),
      "tag": vtag,
      "original": v.to_string(),
      "lang": "Rust",
  }

Screenshots

Your Environment

  • Version used:4.0.0
  • Configuration:
service:  
flush: 1  
daemon: off  
log_level: debug  
http_server: on  
parsers_file: parsers.conf  
  
storage.path: /var/lib/fluent-bit/  
storage.metrics: on  
storage.sync: normal  
storage.checksum: off  
storage.max_chunks_up: 128  
storage.backlog.mem_limit: 5M  
  
pipeline:  
inputs:  
- name: dummy  
interval_sec: 10  
tag: log.dummy  
  
filters:  
- name: wasm  
match: log.dummy  
wasm_path: /etc/fluent-bit/wasm/flb_filter_rust.wasm  
function_name: flb_filter_rust  
accessible_paths: .  
  
outputs:  
- name: stdout  
match: log.dummy
  • Environment name and version (e.g. Kubernetes? What version?): VM
  • Server type and version:
  • Operating System and version: Ubuntu 24.04.2 LTS
  • Filters and plugins: wasm

Additional context

  • rustc 1.84.0 (9fc6b4312 2025-01-07)
  • cargo 1.84.0 (66221abde 2024-11-19)
root@devbox:~# file /etc/fluent-bit/wasm/flb_filter_rust.wasm 
/etc/fluent-bit/wasm/flb_filter_rust.wasm: WebAssembly (wasm) binary module version 0x1 (MVP)

I've renamed the function and library name to flb_filter_rust

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

No branches or pull requests

1 participant