-
Notifications
You must be signed in to change notification settings - Fork 253
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
Feature: Don't display redundant error messages on execute failure #348
Comments
Can you provide a complete output please, I'm not sure what you're comparing to, the first two look very similar apart from |
In my experience the error appears twice, like this:
I agree we should not duplicate the message. But in your case it seems something else is going on. I don't understand why you are seeing the error three times. Let's solve that issue first. The only thing I can think of is that you are nesting
|
I created a minimally reproducible task, but now I get 2 errors rather than 3. namespace :config do
task :false do on roles(:all) do
execute 'false'
end end
end $ cap staging config:false
rvm 1.27.0 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
ruby-2.3.0
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
00:00 config:false
01 false
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host 45.79.164.208: false exit status: 1
false stdout: Nothing written
false stderr: Nothing written
SSHKit::Command::Failed: false exit status: 1
false stdout: Nothing written
false stderr: Nothing written
Tasks: TOP => config:false
(See full trace by running task with --trace) |
Ohh, does that include when namespace :config do
task :false do on roles(:all) do
execute 'false'
end end
task :false_false do on roles(:all) do
invoke 'config:false'
end end
end $ cap staging config:false_false
rvm 1.27.0 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
ruby-2.3.0
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
00:00 config:false
01 false
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host 12.34.56.78: Exception while executing on host 12.34.56.78: false exit status: 1
false stdout: Nothing written
false stderr: Nothing written
SSHKit::Runner::ExecuteError: Exception while executing on host 12.34.56.78: false exit status: 1
false stdout: Nothing written
false stderr: Nothing written
SSHKit::Command::Failed: false exit status: 1
false stdout: Nothing written
false stderr: Nothing written
Tasks: TOP => config:false_false
(See full trace by running task with --trace) YES 😄 |
OK, good, that part is solved. The original issue still stands: SSHKit could do better about not duplicating the error message when a command fails. I'll mark this as a feature request. |
Is there any documentation that |
Also from the UX standpoint, this feature should print something like "command failed with non-zero exit status" rather than the use of word "Exception", as ruby-land error implies it's a bug in SSHKit itself rather than an error in the bash land. |
AFAIK nested
Agreed; the overall error reporting could be much improved from a UX standpoint. If you would like to update this issue with an example of what you think a good error report would look like, we can use that as a spec for building the feature. |
Hi guys, any updates on this issue? |
I can't make any guarantees as to if/when this issue will be addressed. However, as I mentioned above, if someone would like to submit an example of what a good error report should look like, that would at least be a starting point for further discussion. |
Showing the same error in three different ways seems redundant. Is it possible to collapse into one?
The second one looks most relevant.
Background: It occurred when I run
on a single server, where the
postrotate
script for logrotate exits with a failure status.The text was updated successfully, but these errors were encountered: