[chef] Platform_version issue when chef is in path vs not in path on Windows


Chronological Thread 
  • From: Madhurranjan Mohaan < >
  • To:
  • Subject: [chef] Platform_version issue when chef is in path vs not in path on Windows
  • Date: Thu, 2 Aug 2012 14:32:32 +0530

Hi,

We are running Windows 2003 32bit / 64bit and Win 2008 64bit. We are currently running Chef 0.10.6 with ohai 0.6.10. When chef gets installed , the following is added to path : C:\opscode\chef\bin;C:\opscode\chef\\embedded\bin; . However, when you run chef-client on the command line it isn't reflected , instead you need to run using the complete path : C:\opscode\chef\bin\chef-install . If you go to the Path variable and open it and close it , it reflects on the command line.

Now on the 32 bit Win2003 machine, when you run chef-client using the entire path, everything runs fine but fails on 64bit Win 2003 server with the message:
ArgumentError: Cannot find a version for node[<>]
c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.6/lib/chef/platform.rb:312:in `find_platform_and_version'
c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.6/lib/chef/node.rb:384:in `consume_external_attrs'
c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.6/lib/chef/client.rb:247:in `build_node'
c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.6/lib/chef/client.rb:151:in `run'
c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.6/lib/chef/application/client.rb:239:in `block in run_application'
c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.6/lib/chef/application/client.rb:229:in `loop'
c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.6/lib/chef/application/client.rb:229:in `run_application'
c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.6/lib/chef/application.rb:67:in `run'
c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-0.10.6/bin/chef-client:26:in `<top (required)>'
c:/opscode/chef/bin/chef-client:19:in `load'
c:/opscode/chef/bin/chef-client:19:in `<main>'

Further, on the IRC I was asked to update ohai and that it should fix it but it didn't. Then we found ohai's behavior to be as follows:

Win2003 64 bit .
1.  If chef and ohai are in path , when I run ohai , I get the right values:
 "platform": "windows",
  "platform_version": "5.2.3790",
  "platform_family": "windows",
 
2. If chef and ohai are not in path,  I get the following and chef-client run fails at platform_version
"platform": "windows",
  "platform_version": null,
  "platform_family": "windows",
 
On Win2003 32 bit, the behavior is different and hence, the chefclient runs never fail
Win 2003 32 bit
1.   Without_chef_in_path
    "platform_version": "1.0.12(0.46/3/2)", - Wrong value but some value
2. with _chef_in_path
     "platform_version": "5.2.3790",

On the 64 bit, I updated the ohai to 6.14.0 without updating chef client but the behavior seems to be determined by the path of chef and ohai .

Have you faced this issue ? What do you recommend ?

Ranjan


  • [chef] Platform_version issue when chef is in path vs not in path on Windows, Madhurranjan Mohaan, 08/02/2012

Archive powered by MHonArc 2.6.16.

§