​An error occurred when querying namespace 'root/cimv2' with query 'select * from Win32_OperatingSystem'


#1

Hi everybody,

​​
I’m seeing this stacktrace
​ below​
trying to run ChefSpec with Chef 12.3.0
​. This is from a client’s Windows7 machine where chefspec was run.

Any idea what’s going on there?

​Observations from my side so far:​

  1. might it have something to do with
    https://github.com/chef/chef/blob/master/ext/win32-eventlog/Rakefile#L52?
  2. also see some interesting comments there:
    https://github.com/chef/chef/blob/master/lib/chef/platform/query_helpers.rb#L35-41

Cheers,
Torben

rspec -fd --color -I test/chefspec test/chefspec
W:/home/.chefdk/gem/ruby/2.1.0/gems/wmi-lite-1.0.0/lib/wmi-lite/wmi.rb:69:in
rescue in start_query': ​​ ​​ An error occurred when querying namespace 'root/cimv2' with query 'select * from Win32_OperatingSystem'. (WmiLite::WmiException) (in OLE methodExecQuery’: )
OLE error code:80041001 in SWbemServicesEx
Allgemeiner Fehler
HRESULT error code:0x80020009
Exception occurred.
from
W:/home/.chefdk/gem/ruby/2.1.0/gems/wmi-lite-1.0.0/lib/wmi-lite/wmi.rb:65:in
start_query' from W:/home/.chefdk/gem/ruby/2.1.0/gems/wmi-lite-1.0.0/lib/wmi-lite/wmi.rb:39:infirst_of’
from
W:/home/.chefdk/gem/ruby/2.1.0/gems/chef-12.3.0-x86-mingw32/lib/chef/platform/query_helpers.rb:40:in
windows_server_2003?' from W:/home/.chefdk/gem/ruby/2.1.0/gems/chef-12.3.0-x86-mingw32/lib/chef/event_loggers/windows_eventlog.rb:22:in<top (required)>'
from
W:/home/.chefdk/gem/ruby/2.1.0/gems/chef-12.3.0-x86-mingw32/lib/chef/client.rb:41:in
require' from W:/home/.chefdk/gem/ruby/2.1.0/gems/chef-12.3.0-x86-mingw32/lib/chef/client.rb:41:in<top (required)>'
from
W:/home/.chefdk/gem/ruby/2.1.0/bundler/gems/chefspec-5b9b64184f10/lib/chefspec/extensions/chef/client.rb:8:in
require' from W:/home/.chefdk/gem/ruby/2.1.0/bundler/gems/chefspec-5b9b64184f10/lib/chefspec/extensions/chef/client.rb:8:in<top (required)>'
from
W:/home/.chefdk/gem/ruby/2.1.0/bundler/gems/chefspec-5b9b64184f10/lib/chefspec.rb:46:in
require_relative' from W:/home/.chefdk/gem/ruby/2.1.0/bundler/gems/chefspec-5b9b64184f10/lib/chefspec.rb:46:in<top (required)>'
from
W:/repo/vagrant-workflow-tests/playground/sample-toplevel-cookbook/test/chefspec/spec_helper.rb:1:in
require' from W:/repo/vagrant-workflow-tests/playground/sample-toplevel-cookbook/test/chefspec/spec_helper.rb:1:in<top (required)>'
from
W:/repo/vagrant-workflow-tests/playground/sample-toplevel-cookbook/test/chefspec/default_spec.rb:1:in
require' from W:/repo/vagrant-workflow-tests/playground/sample-toplevel-cookbook/test/chefspec/default_spec.rb:1:in<top (required)>‘
from
W:/home/.chefdk/gem/ruby/2.1.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in
load' from W:/home/.chefdk/gem/ruby/2.1.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:inblock in load_spec_files’
from
W:/home/.chefdk/gem/ruby/2.1.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in
each' from W:/home/.chefdk/gem/ruby/2.1.0/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:inload_spec_files’
from
W:/home/.chefdk/gem/ruby/2.1.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:97:in
setup' from W:/home/.chefdk/gem/ruby/2.1.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:85:inrun’
from
W:/home/.chefdk/gem/ruby/2.1.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:70:in
run' from W:/home/.chefdk/gem/ruby/2.1.0/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:38:ininvoke’
from W:/home/.chefdk/gem/ruby/2.1.0/gems/rspec-core-3.2.3/exe/rspec:4:in
<top (required)>' from W:/home/.chefdk/gem/ruby/2.1.0/bin/rspec:23:inload’