-
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
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: undefined method `colorize' for :deploy:Symbol #214
Comments
Hey @KurtRMueller the problem is It turns out (in fairness to the Colorize author) that we were using a kind-of internal API of theirs, which finally went away, our bad. We have a general policy of not strictly policing our version dependencies, there'd be hardly anything more annoying than Capistrano (via SSHKit, for example) forcing you to use … for deployment, and only for deployment some arcane combination of Gems which you might very legitimately need at other versions for your actual application, so we need to find a solution that works for a broad range of |
For anyone still having the same issue, the really short story is this:
and then run IE, just lock |
As written before, we explicitly choose not to force a specific coloroze Sent from my Nexus 5.
|
I know. My comment was advice to users of capistrano, not to you as the maintainer. Thanks for all the hard work you do on capistrano. |
:-) Sent from my Nexus 5.
|
any updates on this one? just run into it, and only solution for me was to patch the gem as said above tried around with locking different versions, but did not helped. |
We don't explicitly lock versions of Colorize (otherwise your deployment tool would be dictating your runtime dependencies)… you don't have to patch anything, make sure (even via distant deps) that you don't rely on colorize. I guess eventually we'll have to remove it completely as a dependency. |
i had to fix this by rolling back to sshkit 1.4. 1.5 & 1.6 had the same issue gem 'sshkit', '~> 1.4.0' |
@brewster1134 If possible could you send through the full stack trace, plus the version of capistrano you are using. Thanks! |
@robd here you go...
|
@brewster1134 Thank you very much. As @mattbrictson mentioned, I hope to fix this soon, but I want to get to the bottom of why it's happening and add a test if necessary. Unfortunately, it appears that netssh is swallowing the original exception stack. Would you be able to delete the begin / rescue block in ie here: threads << Thread.new(host) do |h|
begin
backend(h, &block).run
rescue Exception => e
e2 = ExecuteError.new e
raise e2, "Exception while executing #{host.user ? "as #{host.user}@" : "on host "}#{host}: #{e.message}"
end
end Comment out / delete the begin rescue: threads << Thread.new(host) do |h|
#begin
backend(h, &block).run
#rescue Exception => e
# e2 = ExecuteError.new e
# raise e2, "Exception while executing #{host.user ? "as #{host.user}@" : "on host "}#{host}: #{e.message}"
#end
end |
😄
|
@brewster1134 I think this is because you are defining your user as the symbol server 'some_ip', port: some_port, user: :deploy, roles: %w{web app db} If this is the case, could you try changing to a string: server 'some_ip', port: some_port, user: 'deploy', roles: %w{web app db} |
i think you're right! i never noticed that was a symbol. sorry for the false alarm. the deployment was successful with 1.7! thanks @robd |
so looking at the OP's title for this issue, is it possible @KurtRMueller has the same issue? Strange if we both have a user named |
No probs, as it happens some other work I'm doing over in #246 would have fixed this, but I think we should take a call on whether we want to allow users to be specified as symbols and either a) add tests to ensure we support them I will follow up with @leehambley but b seems like least work. Anyway, thanks for following up on @KurtRMueller's original bug report and for helping to diagnose. |
Colorize dependency was removed in db7de6d |
First, thank you for all the hard work you guys have done on this project and capistrano. Capistrano is a critical a tool in the development, maintenance, and deployment of my rails apps. I don't know if you guys hear that enough, but you should know that almost every rails dev I talk to uses capistrano to deploy. So thank you again.
Now, on to it:
Gem versions:
Whenever I attempt to attempt to deploy via the
cap deploy
task, I get the following error:After running a stack trace, the error pointed to
/lib/sshkit/color.rb:7
.The quick fix for me was simply calling
to_s
onstring
I don't know if this is the right solution (probably not), but it solved my problem. If you like, I can submit a pull request.
The text was updated successfully, but these errors were encountered: