Skip to content
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

Serverspec exit code 1 without error message #513

Closed
ctapobep opened this issue Oct 4, 2014 · 2 comments
Closed

Serverspec exit code 1 without error message #513

ctapobep opened this issue Oct 4, 2014 · 2 comments

Comments

@ctapobep
Copy link

ctapobep commented Oct 4, 2014

At some point I started to get this when running kitchen verify

chef-jtalks$ kitchen verify webapps
-----> Starting Kitchen (v1.2.1)
-----> Setting up <webapps-ubuntu-1204>...
Fetching: thor-0.19.0.gem (100%)       
Fetching: busser-0.6.2.gem (100%)       
Successfully installed thor-0.19.0       
Successfully installed busser-0.6.2       
2 gems installed       
-----> Setting up Busser       
       Creating BUSSER_ROOT in /tmp/busser       
       Creating busser binstub       
       Plugin serverspec installed (version 0.2.7)       
-----> Running postinstall for serverspec plugin       
       Finished setting up <webapps-ubuntu-1204> (1m43.83s).
-----> Verifying <webapps-ubuntu-1204>...
       Suite path directory /tmp/busser/suites does not exist, skipping.       
Uploading /tmp/busser/suites/serverspec/webapps_spec.rb (mode=0644)       
-----> Running serverspec test suite       
/opt/chef/embedded/bin/ruby -I/tmp/busser/suites/serverspec -I/tmp/busser/gems/gems/rspec-support-3.0.4/lib:/tmp/busser/gems/gems/rspec-core-3.0.4/lib -S /opt/chef/embedded/bin/rspec /tmp/busser/suites/serverspec/webapps_spec.rb --color --format documentation       
/tmp/busser/suites/serverspec/webapps_spec.rb:2:in `<top (required)>': uninitialized constant Serverspec::Helper::Exec (NameError)       
        from /tmp/busser/gems/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `load'       
        from /tmp/busser/gems/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `block in load_spec_files'       
        from /tmp/busser/gems/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `each'       
        from /tmp/busser/gems/gems/rspec-core-3.0.4/lib/rspec/core/configuration.rb:1058:in `load_spec_files'       
        from /tmp/busser/gems/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:97:in `setup'       
        from /tmp/busser/gems/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:85:in `run'
        from /tmp/busser/gems/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:70:in `run'
        from /tmp/busser/gems/gems/rspec-core-3.0.4/lib/rspec/core/runner.rb:38:in `invoke'
        from /tmp/busser/gems/gems/rspec-core-3.0.4/exe/rspec:4:in `<top (required)>'
        from /opt/chef/embedded/bin/rspec:23:in `load'
        from /opt/chef/embedded/bin/rspec:23:in `<main>'
/opt/chef/embedded/bin/ruby -I/tmp/busser/suites/serverspec -I/tmp/busser/gems/gems/rspec-support-3.0.4/lib:/tmp/busser/gems/gems/rspec-core-3.0.4/lib -S /opt/chef/embedded/bin/rspec /tmp/busser/suites/serverspec/webapps_spec.rb --color --format documentation failed       
Ruby Script [/tmp/busser/gems/gems/busser-serverspec-0.2.7/lib/busser/runner_plugin/../serverspec/runner.rb /tmp/busser/suites/serverspec] exit code was 1       
>>>>>> Verify failed on instance <webapps-ubuntu-1204>.
>>>>>> Please see .kitchen/logs/webapps-ubuntu-1204.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sh -c 'BUSSER_ROOT="/tmp/busser" GEM_HOME="/tmp/busser/gems" GEM_PATH="/tmp/busser/gems" GEM_CACHE="/tmp/busser/gems/cache" ; export BUSSER_ROOT GEM_HOME GEM_PATH GEM_CACHE; sudo -E /tmp/busser/bin/busser test']
>>>>>> ----------------------

The error message doesn't tell me anything useful and I'm not that experienced in ruby to understand what happened from the stack trace, seems like a dependency is missing (include Serverspec::Helper::Exec), but shouldn't test-kitchen depend on versions of gems it's compatible with? Not quite sure what I've done to make this error happen, previously it was working fine. The TestKitchen Guide also includes it.

@ctapobep
Copy link
Author

ctapobep commented Oct 4, 2014

Ran into this thread: http://lists.opscode.com/sympa/arc/chef/2014-10/msg00027.html

It also says that serverspec was updated and TestKitchen along with Busser install its latest version which breaks the test. I didn't quite get yet how to pin the older version of serverspec.

@ctapobep
Copy link
Author

ctapobep commented Oct 4, 2014

Anyway, decided to move to Serverspec v2. To do so, I needed to replace:

require 'serverspec'
include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS

with

require 'serverspec'
set :backend, :exec

Also some matchers were changed like return_exit_status, the info is present in Serverspec Release Notes v2

But it's still very important to be able to lock down the version of any gem that's used in TestKitchen..

@ctapobep ctapobep closed this as completed Oct 4, 2014
ctapobep added a commit to jtalks-org/chef-jtalks that referenced this issue Oct 4, 2014
@test-kitchen test-kitchen locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant