[Bug]: cosmovisor version
command errors under certain conditions
#19439
Labels
cosmovisor version
command errors under certain conditions
#19439
Is there an existing issue for this?
What happened?
The
cosmovisor version
command errors in a few scenarios and outputs a non-zero exit status$DAEMON_NAME
environment variable is not set$DAEMON_HOME
environment variable is not set$DAEMON_NAME
binary is not found in$PATH
This is because cosmovisor also returns the version of the binary as well as the version of
cosmovisor
.Cosmos SDK Version
main
How to reproduce?
Replication details
Expected behaviour
cosmovisor version
should print the cosmovisor version and return an exit status of 0.Rationale
Generally a piece of software should return a version number without erroring. Returning a non-zero exit code is good behaviour and plays nice with CI tools, provisioners and shell scripts.
Specifically as an Ansible user I want to install cosmovisor before I install a node binary. I want to be able to check the version of cosmovisor matches the version specified in my scripts.
Potential resolution
The issue is due to the version command calling
run
on$DAEMON_NAME
within the version commandThis is also the case in
printVersionJSON
I suggest that the app_version is not relevant to the
version
command and should be removed or moved to another command. There should be no dependency on$DAEMON_NAME
forcosmovisor version
to run without a non-zero exit code.If you agree with the issue I would be happy to submit a PR to remove the app version or move it to a separate command.
If you don't agree it is bearable but the non-zero exit code is not pleasant for playing nice with Unix/Linux standards, leading to issues with build tools, CI, and provisioning.
The text was updated successfully, but these errors were encountered: