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

chef_omnibus_root is nil on images pre-baked with a chef client #923

Open
aespinosa opened this issue Jan 24, 2016 · 7 comments
Open

chef_omnibus_root is nil on images pre-baked with a chef client #923

aespinosa opened this issue Jan 24, 2016 · 7 comments

Comments

@aespinosa
Copy link

On test-kitchen 1.5.0, the chef_client_path is set to /bin/chef-client if the chef_zero provisioner doesn't have to perform an omnibus install.

Here's my kitchen diagnose : https://gist.github.com/aespinosa/00d81f95d1a9e060c51d

@zl4bv
Copy link
Contributor

zl4bv commented Jan 28, 2016

Experiencing this error too.

Relevant section from the log:

D      Transfer complete
D      [WinRM] plaintext::http://ip-xxx-xxx-xxx-xxx.ap-southeast-2.compute.internal:5985/wsman<{:user=>"administrator", :pass=>"************", :disable_sspi=>true, :basic_auth_only=>true}> ($env:PATH = [System.Environment]::GetEnvironmentVariable("PATH","Machine")

& \bin\chef-solo.bat --config $env:TEMP\kitchen\solo.rb --log_level debug --force-formatter --no-color --json-attributes $env:TEMP\kitchen\dna.json)
$$$$$$ &amp; : The term '\bin\chef-solo.bat' is not recognized as the name of a cmdlet,
$$$$$$ function, script file, or operable program. Check the spelling of the name, or
$$$$$$ if a path was included, verify that the path is correct and try again.
$$$$$$ At line:9 char:3
$$$$$$ + &amp; \bin\chef-solo.bat --config $env:TEMP\kitchen\solo.rb --log_level debug
$$$$$$ --forc ...
$$$$$$ +   ~~~~~~~~~~~~~~~~~~
$$$$$$     + CategoryInfo          : ObjectNotFound: (\bin\chef-solo.bat:String) [],
$$$$$$    CommandNotFoundException
$$$$$$     + FullyQualifiedErrorId : CommandNotFoundException
D      Cleaning up local sandbox in /tmp/default-windows-2012r2-sandbox-20160128-10604-143gxar
-----> Destroying <default-windows-2012r2>...

@zl4bv
Copy link
Contributor

zl4bv commented Jan 28, 2016

Aside from when the user explicitly defines it in their config, chef_omnibus_root is only ever set for the Chef provisioners on this line, which does not get executed unless require_chef_omnibus is truthy.

Given mixlib-install defines sensible defaults, would it make sense to use them by default in the chef provisioners even if chef_omnibus_root is falsey?

@xeron
Copy link

xeron commented Mar 16, 2016

I see the same issue. We use AWS AMIs with pre-baked omnibus chef and test-kitchen > 1.4.2 doesn't work. Error:

       sudo: /bin/chef-solo: command not found
D      Cleaning up local sandbox in <SKIPPED>
>>>>>> Converge failed on instance <SKIPPED>
>>>>>> Please see .kitchen/logs/<SKIPPED>.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sh -c '

sudo -E /bin/chef-solo --config /tmp/kitchen/solo.rb --log_level debug --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json
']

<SKIPPED>

sudo -E /bin/chef-solo --config /tmp/kitchen/solo.rb --log_level debug --force-formatter --no-color --json-attributes /tmp/kitchen/dna.json
']
D      ------Backtrace-------
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/driver/ssh_base.rb:85:in `rescue in converge'
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/driver/ssh_base.rb:88:in `converge'
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/instance.rb:565:in `legacy_ssh_base_converge'
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/instance.rb:371:in `block in converge_action'
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/instance.rb:513:in `synchronize_or_call'
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/instance.rb:478:in `block in action'
D      /Users/ilarionov/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/benchmark.rb:293:in `measure'
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/instance.rb:477:in `action'
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/instance.rb:369:in `converge_action'
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/instance.rb:348:in `block in transition_to'
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/instance.rb:347:in `each'
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/instance.rb:347:in `transition_to'
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/instance.rb:138:in `converge'
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/command.rb:176:in `public_send'
D      /Users/ilarionov/.rvm/gems/ruby-2.3.0/gems/test-kitchen-1.6.0/lib/kitchen/command.rb:176:in `block (2 levels) in run_action'
D      ----------------------

@cheeseplus cheeseplus removed this from the Accepted Minor milestone Mar 23, 2016
@cheeseplus cheeseplus removed the Minor label Mar 23, 2016
@xeron
Copy link

xeron commented Apr 28, 2016

Workaround is to set this under provisioner:

chef_omnibus_root: /opt/chef

@cheeseplus cheeseplus self-assigned this Jul 26, 2017
@donwlewis
Copy link

Is there any update on this? I just ran into this scenario myself, but really seems to only affect RHEL6.

@cheeseplus
Copy link

@donwlewis it's not a great update but one of the reasons this was never fixed was that for a bit folks were working on the "New Provisioner Options" which moved everything to using the common mixlib-install path which is more widely used across Chef software. Unfortunately that effort never quite completed / took over from the older require_omnibus style so we've been left with slightly less than awesome versions of both.

The folks who were all working on this are either not at Chef or no longer part of the community but if someone (at this point not sure Chef has bandwidth or interest) wanted to finish out that work on the new system then this would fix the issue and dramatically clean up the codepaths (though probably requiring a major bump).

tarcinil added a commit to tarcinil/test-kitchen that referenced this issue Jan 30, 2020
This work patches test-kitchen#923 so that the issue will stop bugging people, and we can discuss implementing mixlib-install but that has downstream affects against cinc.
tarcinil added a commit to tarcinil/test-kitchen that referenced this issue Jan 30, 2020
… systems

This work patches test-kitchen#923 so that the issue will stop bugging people, and we can discuss implementing mixlib-install but that has downstream affects against cinc.
tarcinil added a commit to tarcinil/test-kitchen that referenced this issue Jan 30, 2020
… systems

This work patches test-kitchen#923 so that the issue will stop bugging people, and we can discuss implementing mixlib-install but that has downstream affects against cinc.
tarcinil added a commit to tarcinil/test-kitchen that referenced this issue Jan 30, 2020
… systems

This work patches test-kitchen#923 so that the issue will stop bugging people, and we can discuss implementing mixlib-install but that has downstream affects against cinc.
tarcinil added a commit to tarcinil/test-kitchen that referenced this issue Jan 30, 2020
… systems

This work patches test-kitchen#923 so that the issue will stop bugging people, and we can discuss implementing mixlib-install but that has downstream affects against cinc.
@donwlewis
Copy link

Thanks @tarcinil!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants