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

indicate config file error when applicable #1021

Closed
5 tasks
colin-axner opened this issue May 31, 2021 · 3 comments · Fixed by #1240
Closed
5 tasks

indicate config file error when applicable #1021

colin-axner opened this issue May 31, 2021 · 3 comments · Fixed by #1240
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

@colin-axner
Copy link
Contributor

Crate

relayer-cli

Summary of Bug

hermes help start
    Finished release [optimized] target(s) in 0.10s
     Running `target/release/hermes help start`
error: hermes fatal error: parse error: unknown variant `naive`, expected `packets` or `all` for key `global.strategy` at line 31 column 1

Version

master

Steps to Reproduce

build master, run:

hermes -c config_example.toml start cosmoshub-4 akashnet-2 -p transfer -c channel-95
    Finished release [optimized] target(s) in 0.11s
     Running `target/release/hermes -c config_example.toml start cosmoshub-4 akashnet-2 -p transfer -c channel-95`
error: unexpected free argument `cosmoshub-4`

hermes 0.3.2
Informal Systems <hello@informal.systems>
For help, run `hermes [<FLAGS>] help <COMMAND>`, for example: `hermes help create client`

FLAGS:
    -c, --config CONFIG       path to configuration file
    -j, --json                enable JSON output

follow the provided hint For help, run `hermes [<FLAGS>] help <COMMAND>

Acceptance Criteria

The help command displays the help page for hermes start


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate milestone (priority) applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@colin-axner
Copy link
Contributor Author

Ah! The issue was in parsing my configuration file! Is there any way to indicate this in the error message?

@adizere
Copy link
Member

adizere commented Jun 1, 2021

Ah! The issue was in parsing my configuration file! Is there any way to indicate this in the error message?

Indeed. There was a breaking change which we didn't signal very well (#924), specifically the global.strategy field.

https://github.com/informalsystems/ibc-rs/blob/cdecd3674af564bb069681c2335185853e878a70/config.toml#L1-L5

Unfortunately, the message which Hermes prints upon doing

hermes help start
    Finished release [optimized] target(s) in 0.10s
     Running `target/release/hermes help start`
error: hermes fatal error: parse error: unknown variant `naive`, expected `packets` or `all` for key `global.strategy` at line 31 column 1

is not at all a help message. The config.toml could not be parsed, which prevents executing the help command. Hermes should be more explicit about this..

@colin-axner
Copy link
Contributor Author

Thanks for the reply @adizere. I eventually managed to deduce the issue based on the error message, but it would be great if the error message could be prefixed with "configuration file error" or something like that? Would this be possible?

@colin-axner colin-axner changed the title hermes help <command> not working indicate config file error when applicable Jun 1, 2021
@romac romac added this to the Backlog milestone Jun 7, 2021
@romac romac added O: usability Objective: cause to improve the user experience (UX) and ease using the product I: CLI Internal: related to the relayer's CLI labels Jun 7, 2021
@adizere adizere modified the milestones: Backlog, 07.2021 Jun 28, 2021
@hu55a1n1 hu55a1n1 self-assigned this Jul 27, 2021
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.

4 participants