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

panic when using the debug header #26

Open
hishamhm opened this issue Nov 4, 2024 · 0 comments
Open

panic when using the debug header #26

hishamhm opened this issue Nov 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@hishamhm
Copy link
Collaborator

hishamhm commented Nov 4, 2024

Originally reported by @teb510

when i add the debug header i get an output that looks like:

kong-db-less  | 2024/11/04 08:14:18 [crit] 2529#0: *6469 [proxy-wasm]["datakit" #5] panicked at src/data.rs:78:22:
kong-db-less  | index out of bounds: the len is 0 but the index is 0, client: 192.168.65.1, server: kong, request: "GET /anything HTTP/1.1", host: "localhost:8000", request_id: "00fcdc00a125be7316f1025768d4ba3a"
kong-db-less  | 2024/11/04 08:14:18 [error] 2529#0: *6469 [wasm] error while executing at wasm backtrace:
kong-db-less  |     0: 0x39ec0e - datakit.wasm!__rust_start_panic
kong-db-less  |     1: 0x39ead3 - datakit.wasm!rust_panic
kong-db-less  |     2: 0x39e889 - datakit.wasm!std::panicking::rust_panic_with_hook::h50e657195af0239c
kong-db-less  |     3: 0x39db4b - datakit.wasm!std::panicking::begin_panic_handler::{{closure}}::h0187e6969a85aab0
kong-db-less  |     4: 0x39dab2 - datakit.wasm!std::sys_common::backtrace::__rust_end_short_backtrace::h575fb82445d56667
kong-db-less  |     5: 0x39e421 - datakit.wasm!rust_begin_unwind
kong-db-less  |     6: 0x3a48d6 - datakit.wasm!core::panicking::panic_fmt::ha6764f2272b7fb95
kong-db-less  |     7: 0x3a4d83 - datakit.wasm!core::panicking::panic_bounds_check::h219d719f2d55cbcd
kong-db-less  |     8: 0x7f142 - datakit.wasm!datakit::data::Data::fill_port::hc0d5bbc5bf21e8af
kong-db-less  |     9: 0x7b520 - datakit.wasm!datakit::DataKitFilter::set_body_data::hdfb6aaa919cfd0a5
kong-db-less  |    10: 0x7cca2 - datakit.wasm!<datakit::DataKitFilter as proxy_wasm::traits::HttpContext>::on_http_response_body::h7120713bce3ee576
kong-db-less  |    11: 0x38f2a6 - datakit.wasm!proxy_wasm::dispatcher::Dispatcher::on_http_response_body::h81f271d8280e7bac
kong-db-less  |    12: 0x39594e - datakit.wasm!proxy_on_response_body
kong-db-less  | 
kong-db-less  | Caused by:
kong-db-less  |     wasm trap: wasm `unreachable` instruction executed <module: "datakit", vm: "main", runtime: "wasmtime">
kong-db-less  | 192.168.65.1 - - [04/Nov/2024:08:14:18 +0000] "GET /anything HTTP/1.1" 200 459 "-" "curl/8.7.1" kong_request_id: "00fcdc00a125be7316f1025768d4ba3a"
kong-db-less  | 2024/11/04 08:14:18 [info] 2529#0: *6469 [proxy-wasm] filter chain failed resuming: previous error (instance trapped) while logging request, client: 192.168.65.1, server: kong, request: "GET /anything HTTP/1.1", host: "localhost:8000", request_id: "00fcdc00a125be7316f1025768d4ba3a"
kong-db-less  | 2024/11/04 08:14:18 [info] 2529#0: *6469 client 192.168.65.1 closed keepalive connection
kong-db-less  | 2024/11/04 08:14:28 [info] 2533#0: *837 [lua] init.lua:155: poll_worker_data(): [counters] 11 of 10 workers reported., context: ngx.timer

interestingly when i set the header to nothing: curl -H "X-DataKit-Debug-Trace:" localhost:8000/anything the error didn't occur but i didn't get any debug output (saw the index err message)

@hishamhm hishamhm added the bug Something isn't working label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant