capistrano deploy error - newbie - ruby

I'm new to ruby and currently having issues deploying with capistrano. below the errors I am getting.
cap aborted!
Operation timed out - connect(2)
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/transport/session.rb:67:in `initialize'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/transport/session.rb:67:in `open'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/transport/session.rb:67:in `block in initialize'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh/transport/session.rb:67:in `initialize'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh.rb:200:in `new'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.7.0/lib/net/ssh.rb:200:in `start'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:156:in `ssh'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:109:in `block in _execute'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:106:in `tap'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:106:in `_execute'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:54:in `execute'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/backends/abstract.rb:75:in `within'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0/lib/capistrano/tasks/git.rake:44:in `block (3 levels) in <top (required)>'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:42:in `instance_exec'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:42:in `run'
/Users/stefydu/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.0.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => git:create_release => git:update
(See full trace by running task with --trace)

Not a solution, but an explanation with workaround:
Capistrano 3, and with it sshkit, doesn't reuse existing SSH connections, but start a new one for every task (see https://github.com/capistrano/sshkit/issues/34).
Some servers, respectively their firewalls, seem to block new connection requests if they come to fast or if there are too many open connections.
Solutions:
Fix SSHKit/Capistrano to reuse connections
Configure your server/firewall to allow tons of parallel ssh sessions (for a simple rails app about 15)
use my hack below (Disclaimer: no, don't use it):
We're going to extend (monkeypatch) the execute method in gems/sshkit-1.1.0/lib/sshkit/backends/netssh.rb. That can be done via the Capfile:
# Overwrite execute method to avoid timeouts
class SSHKit::Backend::Netssh
def execute(*args)
_execute(*args).success?
rescue Errno::ETIMEDOUT
#tries ||= 0
raise "Nope, no way" if #tries > 5
puts "Timeout. yeah. Try it again (#{#tries})"
sleep 5
#tries += 1
execute(*args)
end
end
This gives the server a chance to breathe...

Capistrano uses a connection pool for SSH now:
https://github.com/capistrano/sshkit/pull/70

Related

connection closed by server error when getting accounts using coinbase-exchange websocket

I'm using the ruby coinbase-exchange gem, and I'm executing the code by copying and pasting it into irb.
This only happens when I'm running it as a websocket – when I just execute the code on its own, without the socket, it works fine.
When the following code executes,
accounts = Array.new(2, Array.new)
rest_api.accounts do |resp|
accounts = resp
end
this error is produced:
Coinbase::Exchange::APIError: GET https://api.exchange.coinbase.com/accounts?: connection closed by server
from /usr/local/lib/ruby/gems/2.3.0/gems/coinbase-exchange-0.1.2/lib/coinbase/exchange/adapters/em_http.rb:59:in `block in http_verb'
from /usr/local/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/em/deferrable.rb:158:in `set_deferred_status'
from /usr/local/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/em/deferrable.rb:198:in `fail'
from /usr/local/lib/ruby/gems/2.3.0/gems/em-http-request-1.1.5/lib/em-http/client.rb:123:in `on_error'
from /usr/local/lib/ruby/gems/2.3.0/gems/em-http-request-1.1.5/lib/em-http/client.rb:117:in `unbind'
from /usr/local/lib/ruby/gems/2.3.0/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:205:in `block in unbind'
from /usr/local/lib/ruby/gems/2.3.0/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:205:in `map'
from /usr/local/lib/ruby/gems/2.3.0/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:205:in `unbind'
from /usr/local/lib/ruby/gems/2.3.0/gems/em-http-request-1.1.5/lib/em-http/http_connection.rb:31:in `unbind'
from /usr/local/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:1481:in `event_callback'
from /usr/local/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:202:in `release_machine'
from /usr/local/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:202:in `ensure in run'
from /usr/local/lib/ruby/gems/2.3.0/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:205:in `run'
from (irb):79
from /usr/local/bin/irb:11:in `<main>'
What's the problem here? How do I get around it?

Openshift rhc port forward exception

I am trying to open ports so i access my database remotely from my pc
I am running on Ruby200-x64 and when i try to access port forward
rhc port-forward -a appname
i get the following response/error:
Checking available ports ... C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb:176:in `malloc': bignum too big to convert into `long' (RangeError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb:176:in `malloc_ptr'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb:240:in `get_token_information'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb:213:in `get_current_user'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb:189:in `get_security_attributes_for_user'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb:332:in `send_query'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/pageant.rb:309:in `send'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/agent/socket.rb:148:in `send_packet'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/agent/socket.rb:165:in `send_and_wait'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/agent/socket.rb:76:in `negotiate!'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/agent/socket.rb:48:in `connect'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/key_manager.rb:179:in `agent'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/key_manager.rb:103:in `each_identity'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/methods/publickey.rb:19:in `authenticate'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/session.rb:79:in `block in authenticate'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/session.rb:66:in `each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/authentication/session.rb:66:in `authenticate'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh.rb:211:in `start'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.38.4/lib/rhc/commands/port_forward.rb:86:in `run'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.38.4/lib/rhc/commands.rb:294:in `execute'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.38.4/lib/rhc/commands.rb:285:in `block (3 levels) in to_commander'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.2.1/lib/commander/command.rb:180:in `call'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.2.1/lib/commander/command.rb:180:in `call'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.2.1/lib/commander/command.rb:155:in `run'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.2.1/lib/commander/runner.rb:421:in `run_active_command'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.38.4/lib/rhc/command_runner.rb:72:in `run!'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/commander-4.2.1/lib/commander/delegates.rb:8:in `run!'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.38.4/lib/rhc/cli.rb:37:in `start'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rhc-1.38.4/bin/rhc:20:in `<top (required)>'
from C:/Ruby200-x64/bin/rhc:23:in `load'
from C:/Ruby200-x64/bin/rhc:23:in `<main>'
It's a bit late but maybe it can help to newcomer.
The solution is, or better say- workaround, to exit the pageant while you port-forward the app. And when done turn it on again if you need to ssh to it.
I found a sort of workaround too, whenever i recieve this error i do the oldest trick in the books, a restart and it works all the times(for now)

Failures running rspec tests for the WebSphere Liberty Profile Buildpack

I am using the open source repo for the OSS Cloud Foundry Liberty Profile Buildpack and running into the following failures when executing bundle exec rspec
681 examples, 3 failures
Failed examples:
rspec ./spec/bin/compile_spec.rb:49 # compile script should work with the liberty WEB-INF case
rspec ./spec/bin/compile_spec.rb:65 # compile script should also work with the zipped up server case
rspec ./spec/bin/compile_spec.rb:82 # compile script pass environment variable directory
The 3 failures have a common stack ...
1) compile script should work with the liberty WEB-INF case
Failure/Error: expect(result).to be_success
expected `#<Process::Status: pid 84398 exit 1>.success?` to return true, got false
# ./vendor/bundle/ruby/1.9.1/gems/rspec-expectations-3.0.4/lib/rspec/expectations/fail_with.rb:30:in `fail_with'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-expectations-3.0.4/lib/rspec/expectations/handler.rb:37:in `handle_failure'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-expectations-3.0.4/lib/rspec/expectations/handler.rb:48:in `handle_matcher'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-expectations-3.0.4/lib/rspec/expectations/expectation_target.rb:54:in `to'
# ./spec/bin/compile_spec.rb:59:in `block (5 levels) in <top (required)>'
# /Users/kelapr/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/open3.rb:208:in `popen_run'
# /Users/kelapr/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/open3.rb:90:in `popen3'
# ./spec/bin/compile_spec.rb:53:in `block (4 levels) in <top (required)>'
# ./spec/bin/compile_spec.rb:124:in `with_memory_limit'
# ./spec/bin/compile_spec.rb:52:in `block (3 levels) in <top (required)>'
# /Users/kelapr/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
# ./spec/bin/compile_spec.rb:50:in `block (2 levels) in <top (required)>'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:148:in `instance_exec'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:148:in `block in run'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:301:in `with_around_example_hooks'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/example.rb:145:in `run'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/example_group.rb:494:in `block in run_examples'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/example_group.rb:490:in `map'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/example_group.rb:490:in `run_examples'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/example_group.rb:457:in `run'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:112:in `block (2 levels) in run_specs'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:112:in `map'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:112:in `block in run_specs'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/reporter.rb:54:in `report'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:108:in `run_specs'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:86:in `run'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:70:in `run'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:38:in `invoke'
# ./vendor/bundle/ruby/1.9.1/gems/rspec-core-3.0.4/exe/rspec:4:in `<top (required)>'
# ./vendor/bundle/ruby/1.9.1/bin/rspec:23:in `load'
# ./vendor/bundle/ruby/1.9.1/bin/rspec:23:in `<main>'
Cans someone guide us on how to resolve these failures that seem to stem from an Open3.popen3 call from within a Dir.mktmpdir block. These results from the master branch of https://github.com/cloudfoundry/ibm-websphere-liberty-buildpack/
-Thanks.
I don't see such failures in the Travis CI system. Also, testing on a local machine didn't result in any failures. Do you see any other errors in the test output? In case of a failure, there should be messages starting with stdout: and stderr: in the output.
The issues with the long running tests with these failure is that stack traces are very poor at figuring out what actually happened. We determined the root cause of these failures as lack of network connectivty.

Ruby/Cucumber - 'puts' causing trouble

We have recently installed a copy of our framework on another machine, and for some reason we get an error when using 'puts' instead of 'Kernel.puts' (we use Ruby)
This isn't a huge issue, but we occasionally use 'puts' to write to the cucumber results file.
This onlyhappens on 1 machine, not the other. Both are mac minis, same specs.
Both machines have the same gemlist, the same version of Ruby etc (they were both installed almost simultaneously).
Anyone else seen this?
Log:
2015-06-30 14:44:59 +0100 OUT: Error: undefined method <<' for nil:NilClass 2015-06-30 14:44:59 +0100 OUT: /Library/Ruby/Gems/2.0.0/gems/gherkin-2.12.2/lib/gherkin/formatter/json_formatter.rb:89:inwrite'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/formatter/gherkin_formatter_adapter.rb:166:in puts' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:181:inblock in send_to_all'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:179:in each' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:179:insend_to_all'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:173:in broadcast' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:154:inputs'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/user_interface.rb:14:in puts' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/rb_support/rb_world.rb:107:inputs'
/Users/jenkins/workspace/TEST-regression-test_trial_mini/automation/ios/features/support/hooks.rb:104:in block in <top (required)>' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/core_ext/instance_exec.rb:48:ininstance_exec'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/core_ext/instance_exec.rb:48:in block in cucumber_instance_exec' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/core_ext/instance_exec.rb:69:incucumber_run_with_backtrace_filtering'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/core_ext/instance_exec.rb:36:in cucumber_instance_exec' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/rb_support/rb_hook.rb:14:ininvoke'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:114:in invoke' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:102:inblock in execute_before'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:101:in each' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:101:inexecute_before'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:15:in before' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:112:inblock in fire_hook'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:111:in each' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:111:infire_hook'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:107:in before' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:98:inbefore_and_after'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:82:in block in with_hooks' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:120:incall'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:120:in block (3 levels) in around' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:9:inblock in around'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:97:in call' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:97:inexecute_around'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/language_support/language_methods.rb:8:in around' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:119:inblock (2 levels) in around'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:123:in call' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime/support_code.rb:123:inaround'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:94:in around' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:81:inwith_hooks'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:13:in execute' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/scenario.rb:32:inblock in accept'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/scenario.rb:79:in with_visitor' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/scenario.rb:31:inaccept'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:58:in block in visit_feature_element' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:170:inbroadcast'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:57:in visit_feature_element' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/feature.rb:38:inblock in accept'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/feature.rb:37:in each' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/feature.rb:37:inaccept'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:27:in block in visit_feature' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:170:inbroadcast'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:26:in visit_feature' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/features.rb:28:inblock in accept'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/features.rb:17:in each' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/features.rb:17:ineach'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/features.rb:27:in accept' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:21:inblock in visit_features'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:170:in broadcast' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/ast/tree_walker.rb:20:invisit_features'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/runtime.rb:49:in run!' /Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/lib/cucumber/cli/main.rb:47:inexecute!'
/Library/Ruby/Gems/2.0.0/gems/cucumber-1.3.18/bin/cucumber:13:in <top (required)>' /usr/bin/cucumber:23:inload'
/usr/bin/cucumber:23:in
Something somewhere is overriding your puts. You'll just have to find it. As an alternative, use warn. From Avdi Grimm's Exceptional Ruby:
puts leaves something to be desired as a failure reporting method, however. Because its output goes to $stdout, which is buffered by default, output may not be printed immediately, or it may come out in a surprising order
warn is more succinct, while still using $stderr as its output stream. Note also that the output of warn can be temporarily silenced by passing the -W0 flag to Ruby.

chef-shell --solo Chef::Exceptions::PrivateKeyMissing

I am building a recipe where I'm trying to debug how the attributes are being set, but when I execute chef-shell it gives me errors about missing /etc/chef/client.pem, from what I can tell those are generated by chef server, as I'm running in --solo mode shouldn't it skip the requirement for such things? Or am I using chef-shell improperly?
chef-shell --solo -c debug/solo.rb -j debug/nodes.json
loading configuration: debug/solo.rb
Session type: solo
Loading...done.
This is the chef-shell.
Chef Version: 11.14.6
http://www.opscode.com/chef
http://docs.opscode.com/
run `help' for help, `exit' or ^D to quit.
Ohai2u bob#MSIGS70stealth.thalhalla.net!
chef > roles.all
[2014-11-10T13:15:08-06:00] WARN: Failed to read the private key /etc/chef/client.pem: #<Errno::ENOENT: No such file or directory # rb_sysopen - /etc/chef/client.pem>
Chef::Exceptions::PrivateKeyMissing: I cannot read /etc/chef/client.pem, which you told me to use to sign requests!
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/http/authenticator.rb:78:in `rescue in load_signing_key'
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/http/authenticator.rb:68:in `load_signing_key'
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/http/authenticator.rb:38:in `initialize'
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/rest.rb:66:in `new'
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/rest.rb:66:in `initialize'
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/search/query.rb:34:in `new'
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/search/query.rb:34:in `initialize'
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/role.rb:184:in `new'
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/role.rb:184:in `list'
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/shell/model_wrapper.rb:82:in `list_objects'
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/shell/model_wrapper.rb:50:in `all'
from (irb):1
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/shell.rb:75:in `block in start'
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/shell.rb:74:in `catch'
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/lib/chef/shell.rb:74:in `start'
from /home/bob/.rvm/gems/ruby-2.1.0/gems/chef-11.14.6/bin/chef-shell:37:in `<top (required)>'
from /home/bob/.rvm/gems/ruby-2.1.0/bin/chef-shell:23:in `load'
from /home/bob/.rvm/gems/ruby-2.1.0/bin/chef-shell:23:in `<main>'
from /home/bob/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks2.1:15:in `eval'
from /home/bob/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks2.1:15:in `<main>'chef >
That method just isn't supported in solo mode. You can see in the code that is just calls either search or chef_server_rest directly.

Resources