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

Every command log INFO instead of ERROR when full node is unreachable #2431

Closed
5 tasks
AlianBenabdallah opened this issue Jul 19, 2022 · 2 comments · Fixed by #2464
Closed
5 tasks

Every command log INFO instead of ERROR when full node is unreachable #2431

AlianBenabdallah opened this issue Jul 19, 2022 · 2 comments · Fixed by #2464
Assignees
Labels
A: bug Admin: something isn't working
Milestone

Comments

@AlianBenabdallah
Copy link
Contributor

AlianBenabdallah commented Jul 19, 2022

Summary of Bug

After stopping a node, every command should fail with an ERROR log. The error is currently wrapped within an INFO log :

hermes query channel ends --chain ibc-0 --port transfer --channel channel-0 

INFO ThreadId(01) using default configuration from '~/.hermes/config.toml'
Error: relayer error: RPC error to endpoint http://localhost:27020/: HTTP error: error trying to connect: tcp connect error: Connection refused (os error 111)

I meet the same problem with transfers.

Version

hermes 1.0.0-rc.0
gm 0.1.3

Steps to Reproduce

Using gm and this gm.toml :

[global]
  add_to_hermes = true
  gaiad_binary = "~/go/bin/gaiad"
  ports_start_at = 27050

  [global.hermes]
    binary = "~/.cargo/bin/hermes"

[ibc-0]
  ports_start_at = 27020

[ibc-1]
  ports_start_at = 27030

gm start
gm hermes config
gm hermes keys
gm hermes cc
Copy paste the commands and append --new-client-connection --yes
Once the channels are open
gm stop ibc-0
hermes query channels --chain ibc-0 // Produces the INFO error. Actually, creating the channels is not required to obtain the error.
hermes tx raw ft-transfer --dst-chain ibc-0 --src-chain ibc-1 --src-port transfer --src-channel channel-0 --amount 1000 Produces the INFO error as well.

Acceptance Criteria

Commands that fail because of a stopped node correctly log an ERROR log.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@AlianBenabdallah AlianBenabdallah added the A: bug Admin: something isn't working label Jul 19, 2022
@AlianBenabdallah
Copy link
Contributor Author

I also noticed that using hermes keys add --chain ibc-0 --key-file file_that_does_not_exist.json also outputs an INFO log instead of an error.

@seanchen1991
Copy link
Contributor

seanchen1991 commented Jul 19, 2022

I think this has to do with the fact that there are separating reporting mechanisms being used here. Running hermes keys add --chain ibc-0 --key-file file_that_does_not_exist.json outputs

2022-07-19T18:10:57.561844Z  INFO ThreadId(01) using default configuration from '/Users/seanchen/.hermes/config.toml'
Error: A key with name 'wallet' already exists

It looks like the INFO log pertains to the using default configuration... message, while the Error on the next line seems to be an error related to the command itself.

The INFO and ERROR logs that are color coded are outputted by info!() and error! macro calls in the code. The non-color coded Error is actually using a separate Output::error() method that is defined in relayer-cli/src/conclude.rs. This is a custom module for outputting JSON return messages and is orthogonal to the macros that I mentioned.

It does make the output a bit confusing, especially because the output from the conclude module is less apparent in the logs, but I'm not sure how they could be consolidated.

@adizere adizere added this to the v1.0.0 milestone Jul 27, 2022
hu55a1n1 added a commit that referenced this issue Jul 29, 2022
romac pushed a commit that referenced this issue Jul 29, 2022
* Move relayer specific module events code into relayer crate

* Fix relayer imports

* Remove `_events` suffix from `events::` submodules

* Fix changelog entry for #2431

* Add changelog entry
hu55a1n1 added a commit to hu55a1n1/hermes that referenced this issue Sep 13, 2022
* Move relayer specific module events code into relayer crate

* Fix relayer imports

* Remove `_events` suffix from `events::` submodules

* Fix changelog entry for informalsystems#2431

* Add changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: bug Admin: something isn't working
Projects
None yet
3 participants