wash
wash copied to clipboard
[BUG] 'wash ctl start provider' reports error if provider is already running
If a capability provider is running on a host and you issue wash ctl start provider ...
with the same parameters,
it prints "Provider is already running on this host" and exits with a 1 status.
The problem is the 1 exit status, which shell scripts and Makefiles interpret as an error.
If you have set -e
in your shell script, it quits.
The sense of this command should be idempotent, as are most things wasmcloud-related, so if the provider is already running, it can print an informational message, but it should return status 0. This is what scripts like run.sh
expects.
The simple work-around, using wash ctl start provider ... || true
is not a good work-around because it can proceed when there are real errors, such as an invalid OCI reference. It would have to be modified to parse the stdout/stderr and change the exit status depending on the text of the message.
I wonder if this problem was introduced with the recent change to make wash ctl commands wait for completion. if so, all of the ctl commands that changed should be reviewed to see if they are exiting with an error when (for an idempotent-style usage) it should return with a 0 success status.
This was in wash 0.10.0 on m1 mac with macos 12.3.1
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this has been closed too eagerly, please feel free to tag a maintainer so we can keep working on the issue. Thank you for contributing to wasmCloud!