bgpkit / bgpkit-parser

MRT/BGP data parser written in Rust.
MIT License
95 stars 9 forks source link

called `Option::unwrap()` on a `None` value #192

Open Ji-Shao opened 3 days ago

Ji-Shao commented 3 days ago

./real-time-routeviews-kafka-openbmp

-- omitted --

2024-11-14T04:21:00.324738Z INFO real_time_routeviews_kafka_openbmp: A|1731542744.220952|2001:7f8:f2:e1:0:6:150:2|60150|2a02:ac87:5900::/48|6447 60150 64289 6453 6762 25145|IGP||0|0|lg:60150:102:64289 lg:60150:5100:64289|false||
thread 'main' panicked at examples/real-time-routeviews-kafka-openbmp.rs:62:67: called Option::unwrap() on a None value stack backtrace: 0: 0x556f9513915a - std::backtrace_rs::backtrace::libunwind::trace::h99efb0985cae5d78 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5 1: 0x556f9513915a - std::backtrace_rs::backtrace::trace_unsynchronized::he2c1aa63b3f7fad8 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x556f9513915a - std::sys::backtrace::_print_fmt::h8a221d40f5e0f88b at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/sys/backtrace.rs:66:9 3: 0x556f9513915a - ::fmt::h304520fd6a30aa07 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/sys/backtrace.rs:39:26 4: 0x556f9515cd7b - core::fmt::rt::Argument::fmt::h5da9c218ec984eaf at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/fmt/rt.rs:177:76 5: 0x556f9515cd7b - core::fmt::write::hf5713710ce10ff22 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/fmt/mod.rs:1178:21 6: 0x556f95136633 - std::io::Write::write_fmt::hda708db57927dacf at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/io/mod.rs:1823:15 7: 0x556f9513a302 - std::sys::backtrace::BacktraceLock::print::hbcdbec4d97c91528 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/sys/backtrace.rs:42:9 8: 0x556f9513a302 - std::panicking::default_hook::{{closure}}::he1ad87607d0c11c5 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:266:22 9: 0x556f95139f6e - std::panicking::default_hook::h81c8cd2e7c59ee33 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:293:9 10: 0x556f9513ab8f - std::panicking::rust_panic_with_hook::had2118629c312a4a at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:797:13 11: 0x556f9513a843 - std::panicking::begin_panic_handler::{{closure}}::h7fa5985d111bafa2 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:664:13 12: 0x556f95139639 - std::sys::backtrace::rust_end_short_backtrace::h704d151dbefa09c5 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/sys/backtrace.rs:170:18 13: 0x556f9513a504 - rust_begin_unwind at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:662:5 14: 0x556f94cffcf3 - core::panicking::panic_fmt::h3eea515d05f7a35e at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:74:14 15: 0x556f94cffd7c - core::panicking::panic::h102d65dbfa674afe at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:148:5 16: 0x556f94cffc59 - core::option::unwrap_failed::hfd32652cc6017653 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/option.rs:2015:5 17: 0x556f94d05170 - core::option::Option::unwrap::h72768b55156a7f80 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/option.rs:965:21 18: 0x556f94d05170 - real_time_routeviews_kafka_openbmp::consume_and_print::hb8c75cc1f6dce45d at /home/shaoj/Documents/bgpkit-parser/examples/real-time-routeviews-kafka-openbmp.rs:62:47 19: 0x556f94d05c9e - real_time_routeviews_kafka_openbmp::main::had687fffca7f76cd at /home/shaoj/Documents/bgpkit-parser/examples/real-time-routeviews-kafka-openbmp.rs:95:5 20: 0x556f94d0128b - core::ops::function::FnOnce::call_once::h3e031e66054f8ca4 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ops/function.rs:250:5 21: 0x556f94d0635e - std::sys::backtrace::rust_begin_short_backtrace::h2de874cea1b100b3 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/sys/backtrace.rs:154:18 22: 0x556f94d05e81 - std::rt::lang_start::{{closure}}::hdd3499de46e7debd at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/rt.rs:164:18 23: 0x556f95132dd0 - core::ops::function::impls::<impl core::ops::function::FnOnce for &F>::call_once::h08ecba131ab90ec4 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ops/function.rs:284:13 24: 0x556f95132dd0 - std::panicking::try::do_call::hf33a59fd8ce953f4 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:554:40 25: 0x556f95132dd0 - std::panicking::try::h5005ce80ce949fd8 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:518:19 26: 0x556f95132dd0 - std::panic::catch_unwind::hfbae19e2e2c5b7ed at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panic.rs:345:14 27: 0x556f95132dd0 - std::rt::lang_start_internal::{{closure}}::ha0331c3690741813 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/rt.rs:143:48 28: 0x556f95132dd0 - std::panicking::try::do_call::hcdcbdb616b4d0295 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:554:40 29: 0x556f95132dd0 - std::panicking::try::h3f2f1725a07d2256 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:518:19 30: 0x556f95132dd0 - std::panic::catch_unwind::h51869e04b56b2dc3 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panic.rs:345:14 31: 0x556f95132dd0 - std::rt::lang_start_internal::h4d90db0530245041 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/rt.rs:143:20 32: 0x556f94d05e5a - std::rt::lang_start::h1cb348a1a86ebea8 at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/rt.rs:163:17 33: 0x556f94d05e1e - main at /home/shaoj/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-gcm-avx512.S:108739 34: 0x7f3c86ce0d90 - libc_start_call_main at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16 35: 0x7f3c86ce0e40 - libc_start_main_impl at ./csu/../csu/libc-start.c:392:3 36: 0x556f94d007c5 - _start at /home/shaoj/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-lc-sys-0.22.0/aws-lc/generated-src/linux-x86_64/crypto/fipsmodule/aesni-gcm-avx512.S:104432 37: 0x0 -

digizeph commented 2 days ago

Need more details. I cannot reproduce this issue.

The following command runs fine:

cargo run --example real-time-routeviews-kafka-openbmp

We should probably replace the .unwrap() with some better error handling if it's for more than just example usages.

Ji-Shao commented 2 days ago

It is interesting. AFAIK, nothing has been changed on the computer. both are working now.

cargo run --example real-time-routeviews-kafka-openbmp

cargo build --examples ./real-time-routeviews-kafka-openbmp

🐼 rustc --version rustc 1.82.0 (f6e511eec 2024-10-15)

🐼 uname -a Linux mac 5.15.0-125-generic #135-Ubuntu SMP Fri Sep 27 13:53:58 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

digizeph commented 2 days ago

Thanks for providing the details, and I'm glad that things are working now. I don't see anything that needs to be fixed here and the issues might have been the connectivity problem to remote kafka server. Let me know if you see any additional issues.