Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

chef verify doesn't work after installing chefdk 0.7.0 on Windows7 #482

Closed
cshowers opened this issue Aug 25, 2015 · 7 comments · Fixed by chef/mixlib-shellout#107
Closed

Comments

@cshowers
Copy link

I just updated to latest chefdk and cant get it to work. Version 0.6.2 worked fine. Below are settings

All the paths looks good and chef is using correct embedded ver of Ruby. but I cant' figure out why I'm getting this CreateProcessW error in core_ext.rb


PS C:\> chef verify
Running verification for component 'berkshelf'
Running verification for component 'test-kitchen'
Running verification for component 'chef-client'
Running verification for component 'chef-dk'
Running verification for component 'chef-provisioning'
Running verification for component 'chefspec'
Running verification for component 'rubocop'
Running verification for component 'fauxhai'
Running verification for component 'knife-spork'
Running verification for component 'kitchen-vagrant'
Running verification for component 'package installation'
Running verification for component 'openssl'
...C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.1.0-universal-mingw32/lib/mixlib/shellout/windows/core_ext.rb:346:in `create':
 Input/output error - CreateProcessW (Errno::EIO)
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.1.0-universal-mingw32/lib/mixlib/shellout/windows.rb:86:in `run_command'
        from C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.1.0-universal-mingw32/lib/mixlib/shellout.rb:259:in `run_command'
        from C:/opscode/chefdk/embedded/apps/chef-dk/lib/chef-dk/helpers.rb:30:in `system_command'
        from C:/opscode/chefdk/embedded/apps/chef-dk/lib/chef-dk/component_test.rb:88:in `sh'
        from C:/opscode/chefdk/embedded/apps/chef-dk/lib/chef-dk/component_test.rb:105:in `block in run_in_tmpdir'
        from C:/opscode/chefdk/embedded/apps/chef-dk/lib/chef-dk/component_test.rb:111:in `block in tmpdir'
        from C:/opscode/chefdk/embedded/lib/ruby/2.1.0/tmpdir.rb:88:in `mktmpdir'
        from C:/opscode/chefdk/embedded/apps/chef-dk/lib/chef-dk/component_test.rb:110:in `tmpdir'
        from C:/opscode/chefdk/embedded/apps/chef-dk/lib/chef-dk/component_test.rb:103:in `run_in_tmpdir'
        from C:/opscode/chefdk/embedded/apps/chef-dk/lib/chef-dk/command/verify.rb:121:in `block (2 levels) in <class:Verify>'
        from C:/opscode/chefdk/embedded/apps/chef-dk/lib/chef-dk/component_test.rb:78:in `instance_eval'
        from C:/opscode/chefdk/embedded/apps/chef-dk/lib/chef-dk/component_test.rb:78:in `run_smoke_test'
        from C:/opscode/chefdk/embedded/apps/chef-dk/lib/chef-dk/command/verify.rb:350:in `block (2 levels) in invoke_tests'

I installed all the components in the new chefdk windows installer
I then ran chef-shell init command:

if(Test-Path $PROFILE){ chef shell-init powershell | Add-Content $PROFILE } else { New-Item -Force -ItemType File $PROFILE; chef shell-init powershell | Add-Content $PROFILE }

this created powershelll profile in Microsoft.PowerShell_profile.ps1:


$env:PATH="C:/opscode/chefdk/bin;C:/Users/cshowers/AppData/Local/chefdk/gem/ruby/2.1.0/bin;C:/opscode/chefdk/embedded/bin;C:/opscode/chefdk/bin;C:/Users/cshowers/AppData/Local/chefdk/gem/ruby/2.1.0/bin;C:/opscode/chefdk/embedded/bin;%SystemRoot%\system32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_60\bin;C:\Program Files (x86)\LANSA\Open;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\blp\API;C:\blp\API\dde;C:\Program Files (x86)\IBM\Client Access\Emulator;C:\Program Files (x86)\IBM\Client Access\Shared;C:\Program Files (x86)\IBM\Client Access\;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;C:\apache-maven-3.2.1\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Mercurial\;C:\gradle-1.12\bin;C:\zmq\lib\shared_lib;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\MySQL\MySQL Utilities\;C:\Program Files (x86)\MySQL\MySQL Utilities\Doctrine extensions for PHP\;C:\HashiCorp\Vagrant\bin;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin;C:\Program Files\Oracle\VirtualBox;C:\Program Files (x86)\nodejs\;C:\opscode\chefdk\bin\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\cshowers\AppData\Roaming\npm;C:\Program Files\Docker Toolbox;.;;.;;.;"
$env:GEM_ROOT="C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0"
$env:GEM_HOME="C:/Users/cshowers/AppData/Local/chefdk/gem/ruby/2.1.0"
$env:GEM_PATH="C:/Users/cshowers/AppData/Local/chefdk/gem/ruby/2.1.0;C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0"

I'm using Windows 7 SP1

PS C:\> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.17929
BuildVersion                   6.3.9600.16406
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2

PS C:\> chef -v
Chef Development Kit Version: 0.7.0
chef-client version: 12.4.1
berks version: 3.2.4
kitchen version: 1.4.2

PS C:\> chef env

---
Chef Development Kit:
  ChefDK:
    ChefDK Version: 0.7.0
    ChefDK Home: C:/Users/cshowers/AppData/Local/chefdk
    ChefDK Install Directory: C:/opscode/chefdk
    Policyfile Config:
      Cache Path: C:/Users/cshowers/AppData/Local/chefdk/cache
      Storage Path: C:/Users/cshowers/AppData/Local/chefdk/cache/cookbooks
  Ruby:
    Ruby Executable: C:/opscode/chefdk/embedded/bin/ruby.exe
    Ruby Version: 2.1.6
    RubyGems:
      RubyGems Version: 2.4.4
      RubyGems Platforms:
      - ruby
      - x86-mingw32
      Gem Environment:
        GEM ROOT: C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0
        GEM HOME: C:/Users/cshowers/AppData/Local/chefdk/gem/ruby/2.1.0
        GEM PATHS:
        - C:/Users/cshowers/AppData/Local/chefdk/gem/ruby/2.1.0
        - C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0
  Path:
  - C:/opscode/chefdk/bin
  - C:/Users/cshowers/AppData/Local/chefdk/gem/ruby/2.1.0/bin
  - C:/opscode/chefdk/embedded/bin
  - C:/opscode/chefdk/bin
  - C:/Users/cshowers/AppData/Local/chefdk/gem/ruby/2.1.0/bin
  - C:/opscode/chefdk/embedded/bin
  - C:/opscode/chefdk/bin
  - C:/Users/cshowers/AppData/Local/chefdk/gem/ruby/2.1.0/bin
  - C:/opscode/chefdk/embedded/bin
  - "%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\"
  - C:\Program Files\Java\jdk1.8.0_60\bin
  - C:\Program Files (x86)\LANSA\Open
  - C:\Program Files (x86)\Intel\iCLS Client\
  - C:\Program Files\Intel\iCLS Client\
  - C:\Windows\system32
  - C:\Windows
  - C:\Windows\System32\Wbem
  - C:\Windows\System32\WindowsPowerShell\v1.0\
  - C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
  - C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
  - C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
  - C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
  - C:\blp\API
  - C:\blp\API\dde
  - C:\Program Files (x86)\IBM\Client Access\Emulator
  - C:\Program Files (x86)\IBM\Client Access\Shared
  - C:\Program Files (x86)\IBM\Client Access\
  - C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86
  - C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64
  - C:\apache-maven-3.2.1\bin
  - C:\Program Files\TortoiseSVN\bin
  - C:\Program Files\Mercurial\
  - C:\gradle-1.12\bin
  - C:\zmq\lib\shared_lib
  - C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
  - C:\Program Files (x86)\Git\bin
  - C:\Program Files (x86)\MySQL\MySQL Utilities\
  - C:\Program Files (x86)\MySQL\MySQL Utilities\Doctrine extensions for PHP\
  - C:\HashiCorp\Vagrant\bin
  - C:\Program Files (x86)\Git\cmd
  - C:\Program Files (x86)\Git\bin
  - C:\Program Files\Oracle\VirtualBox
  - C:\Program Files (x86)\nodejs\
  - C:\opscode\chefdk\bin\
  - C:\Windows\System32\WindowsPowerShell\v1.0\
  - C:\Users\cshowers\AppData\Roaming\npm
  - C:\Program Files\Docker Toolbox
@danielsdeleo
Copy link
Contributor

Thanks for the detailed bug report. I'm not very familiar with windows but I will ask my colleagues who are.

@cshowers
Copy link
Author

After doing some google searching it seems this issue was raised before at #102

the problem seem to occur when running chef verify at the root c:\ directory

when switching to any sub-dir chef verify worked. This might be due to some funky PATH setup. The error of course doesn't suggest path is a problem

@ksubrama
Copy link

@cshowers I am unable to repro this on a Windows 2012r2 box as an unprivileged user. I'm going to try it out on a Windows 7 box to see if that makes a difference. I currently suspect that there's some weirdness in how we launch the various sub commands.

@smurawski
Copy link

@ksubrama I can repro on Win 10 - if chef verify is run from c:\ for 0.6.2 it'll error as described above. Works from from a non root directory.

@fractile81
Copy link

Wanted to chime in and say that I noticed this today (after I updated), and the chef verify also failed within a Vagrant base folder, but moving to a different directory removed the error. My error was the same. Windows 10 x64.

@ksubrama
Copy link

@smurawski Just managed to narrow this down. Turns out we currently execute "chef verify" - so if you are in a directory that contains a folder called chef, windows will execute the directory (which opens explorer.exe on it) instead. I guess we should have said chef.bat instead. We'll our exec calls as part of a future release.

@mwrock
Copy link
Contributor

mwrock commented Sep 11, 2015

just submitted chef/mixlib-shellout#107 to address this

mwrock added a commit that referenced this issue Sep 11, 2015
mwrock added a commit that referenced this issue Sep 13, 2015
@ksubrama ksubrama added this to the 0.9.0 milestone Sep 22, 2015
ksubrama pushed a commit that referenced this issue Jan 11, 2016
Downgrade chef/chefdk RubyGems from 2.4.8 to 2.4.4.
@chef-boneyard chef-boneyard locked and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

6 participants