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

Problems with relayer::error display for CLIs #555

Closed
5 tasks
ancazamfir opened this issue Jan 26, 2021 · 0 comments · Fixed by #559
Closed
5 tasks

Problems with relayer::error display for CLIs #555

ancazamfir opened this issue Jan 26, 2021 · 0 comments · Fixed by #559
Assignees
Labels
I: CLI Internal: related to the relayer's CLI O: usability Objective: cause to improve the user experience (UX) and ease using the product
Milestone

Comments

@ancazamfir
Copy link
Collaborator

ancazamfir commented Jan 26, 2021

Crate

relayer

Summary of Bug

Not enough detail when the IBC message Tx fails

Version

9d0a7b8

Steps to Reproduce

current output for rrly -c loop_config.toml tx raw chan-init ibc-0 ibc-1 connection-0 transfer transfer defaultChannel defaultChannel -o ORDERED is:
{"status":"error","result":["tx error: failed"]}

If using {:?} formatter here https://github.com/informalsystems/ibc-rs/blob/9d0a7b8f11a252e68e039a976910edd33107f074/relayer-cli/src/commands/tx/channel.rs#L89

the output of the same command is:

{"status":"error","result":["Error(Context { kind: Tx, source: Some(Failed(\"tx response error: deliver_tx reports error: log=Log(\\\"failed to execute message; message index: 0: channel open init callback failed: expected ORDER_UNORDERED channel, got ORDER_ORDERED : invalid channel ordering\\\")\")), backtrace: Some(   0: backtrace::backtrace::libunwind::trace\n             at /Users/ancaz/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.56/src/backtrace/libunwind.rs:90:5\n      backtrace::backtrace::trace_unsynchronized\n             at /Users/ancaz/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.56/src/backtrace/mod.rs:66:5\n   1: backtrace::backtrace::trace\n             at /Users/ancaz/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.56/src/backtrace/mod.rs:53:14\n   2: backtrace::capture::Backtrace::create\n             at /Users/ancaz/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.56/src/capture.rs:176:9\n   3: backtrace::capture::Backtrace::new\n             at /Users/ancaz/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.56/src/capture.rs:140:22\n   4: anomaly::context::Context<Kind>::new\n             at /Users/ancaz/.cargo/registry/src/github.com-1ecc6299db9ec823/anomaly-0.2.0/src/context.rs:36:29\n   5: relayer_cli::error::Kind::context\n             at relayer-cli/src/error.rs:40:9\n   6: <relayer_cli::commands::tx::channel::TxRawChanInitCmd as abscissa_core::runnable::Runnable>::run::{{closure}}\n             at relayer-cli/src/commands/tx/channel.rs:85:49\n   7: core::result::Result<T,E>::map_err\n             at /Users/ancaz/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/result.rs:595:27\n   8: <relayer_cli::commands::tx::channel::TxRawChanInitCmd as abscissa_core::runnable::Runnable>::run\n             at relayer-cli/src/commands/tx/channel.rs:85:21\n   9: relayer_cli::commands::tx::_DERIVE_Runnable_FOR_TxRawCommands::<impl abscissa_core::runnable::Runnable for relayer_cli::commands::tx::TxRawCommands>::run\n             at relayer-cli/src/commands/tx.rs:24:35\n  10: relayer_cli::commands::tx::_DERIVE_Runnable_FOR_TxCmd::<impl abscissa_core::runnable::Runnable for relayer_cli::commands::tx::TxCmd>::run\n             at relayer-cli/src/commands/tx.rs:13:35\n  11: relayer_cli::commands::_DERIVE_Runnable_FOR_CliCmd::<impl abscissa_core::runnable::Runnable for relayer_cli::commands::CliCmd>::run\n             at relayer-cli/src/commands.rs:35:35\n  12: <abscissa_core::command::entrypoint::EntryPoint<Cmd> as abscissa_core::runnable::Runnable>::run\n             at /Users/ancaz/.cargo/registry/src/github.com-1ecc6299db9ec823/abscissa_core-0.5.2/src/command/entrypoint.rs:52:9\n  13: abscissa_core::application::Application::run\n             at /Users/ancaz/.cargo/registry/src/github.com-1ecc6299db9ec823/abscissa_core-0.5.2/src/application.rs:64:9\n  14: abscissa_core::application::boot\n             at /Users/ancaz/.cargo/registry/src/github.com-1ecc6299db9ec823/abscissa_core-0.5.2/src/application.rs:196:5\n  15: relayer::main\n             at relayer-cli/src/bin/relayer/main.rs:10:5\n  16: core::ops::function::FnOnce::call_once\n             at /Users/ancaz/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5\n  17: std::sys_common::backtrace::__rust_begin_short_backtrace\n             at /Users/ancaz/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125:18\n  18: std::rt::lang_start::{{closure}}\n             at /Users/ancaz/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/rt.rs:66:18\n  19: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once\n             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/core/src/ops/function.rs:259:13\n      std::panicking::try::do_call\n             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:381:40\n      std::panicking::try\n             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panicking.rs:345:19\n      std::panic::catch_unwind\n             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/panic.rs:396:14\n      std::rt::lang_start_internal\n             at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca/library/std/src/rt.rs:51:25\n  20: std::rt::lang_start\n             at /Users/ancaz/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/rt.rs:65:5\n  21: _main\n) })"]}

Ideally we should have the latter minus the backtrace, so the user can figure out the reason for the Tx failure.
Prior to 9d0a7b8 the output is:

{"status":"error","result":["tx error: Failed to build channel open init deliver_tx reports error: log=Log(\"failed to execute message; message index: 0: channel open init callback failed: expected ORDER_UNORDERED channel, got ORDER_ORDERED : invalid channel ordering\")"]}

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@ancazamfir ancazamfir added this to the v0.1.0 milestone Jan 26, 2021
@adizere adizere self-assigned this Jan 26, 2021
@adizere adizere added I: CLI Internal: related to the relayer's CLI O: usability Objective: cause to improve the user experience (UX) and ease using the product labels Jan 26, 2021
adizere added a commit that referenced this issue Jan 28, 2021
* Include cause in Failed errors (#555). Double-checking 'required' tag.

* Finished adding 'required' tag to commands

* Last nits around error messages.

* Changelog

* Change doctests in conclude to ignore

* Remove Option from chain_id parameter in client queries

Co-authored-by: Anca Zamfir <zamfiranca@gmail.com>
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this issue Sep 13, 2022
* Include cause in Failed errors (informalsystems#555). Double-checking 'required' tag.

* Finished adding 'required' tag to commands

* Last nits around error messages.

* Changelog

* Change doctests in conclude to ignore

* Remove Option from chain_id parameter in client queries

Co-authored-by: Anca Zamfir <zamfiranca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: CLI Internal: related to the relayer's CLI O: usability Objective: cause to improve the user experience (UX) and ease using the product
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants