-
Notifications
You must be signed in to change notification settings - Fork 632
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
Missing, malformed or inaccessible config file(s) cause code panics #5485
Comments
didn't realize that #5695 existed, but these two issues seem to be talking about pretty much the same thing? I'll just close this one in favor of tht one since there's more discussion over there. |
Your call. I think this issue is reasonably actionable whereas #5695 is pretty broad and its hard to tell if anybody fixing that issue will get around to fixing this one. |
@nagisa hm yah that's true. I'll reopen then, since in any case I dont think there's that much left to do to resolve just this one. will send some PRs soon |
This cleans up a few more panics in favor of presenting a more user-friendly error when things go wrong. Issue: #5485
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
@marcelo-gonzalez is this fixed in #6053 ? If so please close the issue |
no not quite. That PR cleans up a lot of it, but it actually still panics, since there's still an unwrap(). It's just that the unwrap() is higher up the stack now. Still needs another PR or two to call this closed |
Describe the bug
Running
neard
commands with an absent configuration file will causeneard
invocations to panic, rather than to print out an error message and terminate regularly.For example:
1. ./target/release/neard view_state peers
Nov 26 17:56:58.036 INFO neard: Version: trunk, Build: crates-0.10.0-64-gdcab6f416-modified, Latest Protocol: 49
thread 'main' panicked at 'Could not open config file:
~/.near/config.json
', nearcore/src/config.rs:469:33stack backtrace:
0: rust_begin_unwind
at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa/library/std/src/panicking.rs:517:5
1: core::panicking::panic_fmt
at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa/library/core/src/panicking.rs:101:14
2: nearcore::config::Config::from_file::(file::)
closure
3: nearcore::config::Config::from_file
4: nearcore::config::load_config_without_genesis_records
5: nearcore::config::load_config
6: state_viewer::cli::StateViewerSubCommand::run
7: neard::cli::NeardCmd::parse_and_run
note: Some details are omitted, run with
RUST_BACKTRACE=full
for a verbose backtrace.The text was updated successfully, but these errors were encountered: