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

thread 'main' panicked at 'called Result::unwrap() on an Err value: NotPresent' #1

Closed
pfr-dev opened this issue Dec 14, 2020 · 3 comments

Comments

@pfr-dev
Copy link

pfr-dev commented Dec 14, 2020

Not really sure what's happening here tbh. I've installed using both cargo install bunnyfetch and the Git release version using cargo build --release. Both give the eact same output:

λ ~/Downloads/Programs/Bunnyfetch/target/release RUST_BACKTRACE=full ./bunnyfetch 101 ↵ ✹ master
thread 'main' panicked at 'called Result::unwrap() on an Err value: NotPresent', src/lib.rs:20:24
stack backtrace:
0: 0x56011c9dd7f5 - std::backtrace_rs::backtrace::libunwind::trace::h577ea05e9ca4629a
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/../../backtrace/src/backtrace/libunwind.rs:96
1: 0x56011c9dd7f5 - std::backtrace_rs::backtrace::trace_unsynchronized::h50b9b72b84c7dd56
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/../../backtrace/src/backtrace/mod.rs:66
2: 0x56011c9dd7f5 - std::sys_common::backtrace::_print_fmt::h6541cf9823837fac
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:79
3: 0x56011c9dd7f5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf64fbff071026df5
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:58
4: 0x56011c9d024c - core::fmt::write::h9ddafa4860d8adff
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/fmt/mod.rs:1082
5: 0x56011c9dce56 - std::io::Write::write_fmt::h1d2ee292d2b65481
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/io/mod.rs:1514
6: 0x56011c9dc7e0 - std::sys_common::backtrace::_print::ha25f9ff5080d886d
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:61
7: 0x56011c9dc7e0 - std::sys_common::backtrace::print::h213e8aa8dc5405c0
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:48
8: 0x56011c9dc7e0 - std::panicking::default_hook::{{closure}}::h6482fae49ef9d963
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:200
9: 0x56011c9dbf08 - std::panicking::default_hook::he30ad7589e0970f9
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:219
10: 0x56011c9dbf08 - std::panicking::rust_panic_with_hook::haa1ed36ada4ffb03
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:569
11: 0x56011c9dbba8 - std::panicking::begin_panic_handler::{{closure}}::h7001af1bb21aeaeb
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:476
12: 0x56011c9dbb74 - std::sys_common::backtrace::__rust_end_short_backtrace::h39910f557f5f2367
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/sys_common/backtrace.rs:153
13: 0x56011c9dbb2d - rust_begin_unwind
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:475
14: 0x56011c9cecd0 - core::panicking::panic_fmt::h4e2659771ebc78eb
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/panicking.rs:85
15: 0x56011c9d09c2 - core::option::expect_none_failed::h448b58a024c2c33a
at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/option.rs:1221
16: 0x56011c9cc997 - bunnyfetch::main::h7e832512d7dab61b
17: 0x56011c9cea6e - std::sys_common::backtrace::__rust_begin_short_backtrace::hb0ce4edf21983405
18: 0x56011c9ccf11 - main
19: 0x7fe4f2af2cb2 - __libc_start_main
20: 0x56011c9cc08e - _start
21: 0x0 -

@TorchedSammy
Copy link
Member

Oh.
I see you are on unix which is what the line number to the panic is saying. Bunnyfetch doesn't use low level libs and relies purely on command output and environment variables and always assumes they are present.
HOSTNAME isn't set in your environment, resulting in an error.

How do you get the hostname on what you are using?

@pfr-dev
Copy link
Author

pfr-dev commented Dec 15, 2020

 λ ~ hostname
pop-os
 λ ~ lsb_release -ds
Pop!_OS 20.10

@TorchedSammy
Copy link
Member

fixed on master

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

No branches or pull requests

2 participants