# Platform\_version issue when chef is in path vs not in path on Windows

**URL:** <https://discourse.chef.io/t/platform-version-issue-when-chef-is-in-path-vs-not-in-path-on-windows/3090>\
**Category:** Chef Infra (archive)\
**Created:** [August 2, 2012, 9:02am UTC](https://discourse.chef.io/t/platform-version-issue-when-chef-is-in-path-vs-not-in-path-on-windows/3090 "2012-08-02T09:02:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Madhurranjan\_Mohaan](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@Madhurranjan\_Mohaan](https://discourse.chef.io/u/Madhurranjan_Mohaan)\
**Post date:** [August 2, 2012, 9:02am UTC](https://discourse.chef.io/t/platform-version-issue-when-chef-is-in-path-vs-not-in-path-on-windows/3090/1 "2012-08-02T09:02:32Z")

</div>

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 `’

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
