Windows Template error


#1

Greetings Professionals

I am trying to install Signalfx agent on my windows machines for both 2012R2 and 2008 Datacenter servers and below is the recipe i have

windows_package ‘PerfCounterReporterInstaller-1.5.2.msi’ do
source 'file:///C:/chef/cache/cookbooks/signalfx/files/default/PerfCounterReporterInstaller-1.5.2.msi’
options '-ms’
installer_type :custom
action :install
end

template “C:\Program Files (x86)\SignalFx\PerfCounterReporter\PerfCounterReporter.exe.config” do
cookbook "signalfx"
source "PerfCounterReporter.exe.config.erb"
mode '0744’
end
#C:\Program Files (x86)\SignalFx\PerfCounterReporter\PerfCounterReporter.exe

windows_service ‘PerfCounterReporterService’ do
supports [:start, :stop, :restart]
startup_type :automatic
action :restart
end

windows_service ‘PerfHost’ do
action :restart #configure_startup
startup_type :manual
end

I could not able to replace the template file with the original ones to config the agent , below is the error i get
10.0.108.104
10.0.108.104
10.0.108.104 ================================================================================
10.0.108.104 Error executing action create on resource 'template[C:\Program Files (x86)\SignalFx\PerfCounterReporter\PerfCounterReporter.exe.config]'
10.0.108.104 ================================================================================
10.0.108.104
10.0.108.104 Chef::Exceptions::Win32APIError
10.0.108.104 -------------------------------
10.0.108.104 No mapping between account names and security IDs was done.
10.0.108.104 ---- Begin Win32 API output ----
10.0.108.104 System Error Code: 1332
10.0.108.104 System Error Message: No mapping between account names and security IDs was done.
10.0.108.104 ---- End Win32 API output ----
10.0.108.104
10.0.108.104 Resource Declaration:
10.0.108.104 ---------------------
10.0.108.104 # In c:/chef/cache/cookbooks/signalfx/recipes/default.rb
10.0.108.104
10.0.108.104 22: template “C:\Program Files (x86)\SignalFx\PerfCounterReporter\PerfCounterReporter.exe.config” do
10.0.108.104 23: cookbook “signalfx"
10.0.108.104 24: source “PerfCounterReporter.exe.config.erb"
10.0.108.104 25: mode '0744’
10.0.108.104 26: owner 'root’
10.0.108.104 27: end
10.0.108.104 28: #C:\Program Files (x86)\SignalFx\PerfCounterReporter\PerfCounterReporter.exe
10.0.108.104
10.0.108.104 Compiled Resource:
10.0.108.104 ------------------
10.0.108.104 # Declared in c:/chef/cache/cookbooks/signalfx/recipes/default.rb:22:in `from_file’
10.0.108.104
10.0.108.104 template(“C:\Program Files (x86)\SignalFx\PerfCounterReporter\PerfCounterReporter.exe.config”) do
10.0.108.104 action [:create]
10.0.108.104 retries 0
10.0.108.104 retry_delay 2
10.0.108.104 default_guard_interpreter :default
10.0.108.104 source “PerfCounterReporter.exe.config.erb"
10.0.108.104 cookbook “signalfx"
10.0.108.104 declared_type :template
10.0.108.104 cookbook_name “signalfx"
10.0.108.104 recipe_name “default"
10.0.108.104 mode “0744"
10.0.108.104 owner “root"
10.0.108.104 path “C:\Program Files (x86)\SignalFx\PerfCounterReporter\PerfCounterReporter.exe.config"
10.0.108.104 verifications []
10.0.108.104 diff “— C:\Program Files (x86)\SignalFx\PerfCounterReporter\PerfCounterReporter.exe.config\t2016-12-19 12:17:24.000000000 -0500\n+++ C:\Program Files (x86)\SignalFx\PerfCounterReporter/chef-PerfCounterReporter20170714-3672-rb98kf.exe.config\t2017-07-14 17:16:35.000000000 -0400\n@@ -4,7 +4,7 @@\n <section name=“signalFxReporter” type=” Metrics.SignalFx.Configuration.SignalFxReporterConfiguration, Metrics.NET.SignalFx”/>\n <section name=“counterSampling” type=“PerfCounterReporter.Configuration.CounterSamplingConfiguration, PerfCounterReporter”/>\n \n- <signalFxReporter sourceDimension=“host” apiToken=”” awsIntegration=“false” sourceType=“netbios” sourceValue=”” sampleInterval=“00:00:05”>\n+ <signalFxReporter sourceDimension=“host” apiToken=“ER2MLu2OwrZkHsMDZvrhMw” awsIntegration=“true” sourceType=“netbios” sourceValue=”” sampleInterval=“00:00:10”>\n \n <defaultDimension name=”” value=""/>\n "
10.0.108.104 final_checksum "97eb78e0308192976d193755cc8ea1386fda6f018adc51ecbdbf79c7282d9170"
10.0.108.104 rights nil
10.0.108.104 deny_rights nil
10.0.108.104 end
10.0.108.104
10.0.108.104 System Info:
10.0.108.104 ------------
10.0.108.104 chef_version=12.21.3
10.0.108.104 platform=windows
10.0.108.104 platform_version=6.3.9600
10.0.108.104 ruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]
10.0.108.104 program_name=C:/opscode/chef/bin/chef-client
10.0.108.104 executable=C:/opscode/chef/bin/chef-client
10.0.108.104
10.0.108.104
10.0.108.104 [2017-07-14T17:16:35-04:00] INFO: Running queued delayed notifications before re-raising exception
10.0.108.104 [2017-07-14T17:16:35-04:00] ERROR: Running exception handlers
10.0.108.104 [2017-07-14T17:16:35-04:00] ERROR: Exception handlers complete
10.0.108.104 [2017-07-14T17:16:35-04:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
10.0.108.104 [2017-07-14T17:16:35-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
10.0.108.104 [2017-07-14T17:16:35-04:00] FATAL: Chef::Exceptions::Win32APIError: template[C:\Program Files (x86)\SignalFx\PerfCounterReporter\PerfCounterReporter.exe.config] (signalfx::default line 22) had an error: Chef::Exceptions::Win32APIError: No mapping between account names and security IDs was done.
10.0.108.104 ---- Begin Win32 API output ----
10.0.108.104 System Error Code: 1332
10.0.108.104 System Error Message: No mapping between account names and security IDs was done.
10.0.108.104 ---- End Win32 API output ----
10.0.108.104
ERROR: Failed to execute command on 10.0.108.104 return code 1
ERROR: Bootstrap command returned 1

Please help ,

Thanks
Prash


#2

This is a windows error that it can’t find the user to modify the file.

No mapping between account names and security IDs was done

Try removing the ‘mode 0744’ from the template since that doesn’t make sense on windows.

template "C:\Program Files (x86)\SignalFx\PerfCounterReporter\PerfCounterReporter.exe.config" do
  cookbook "signalfx"
  source "PerfCounterReporter.exe.config.erb"
  mode '0744'
end

#3

Hi Spuder thank you very much for you help it worked fine now i have another problem with windows servers im trying to install signalfx below is the recipe i am using for windows

windows_package ‘PerfCounterReporterInstaller-1.5.2.msi’ do
source 'file:///C:/chef/cache/cookbooks/signalfx/files/default/PerfCounterReporterInstaller-1.5.2.msi’
options '/quiet’
installer_type :custom
action :install
end

template “C:\Program Files (x86)\SignalFx\PerfCounterReporter\PerfCounterReporter.exe.config” do
cookbook "signalfx"
source "PerfCounterReporter.exe.config.erb"
end
#C:\Program Files (x86)\SignalFx\PerfCounterReporter\PerfCounterReporter.exe

windows_service ‘PerfCounterReporterService’ do
supports [:start => true, :restart => true]
startup_type :automatic
#action :configure_startup
#action :restart
action :enable
action :start
end

but im getting this below error

10.0.109.164
10.0.109.164 ================================================================================
10.0.109.164 Error executing action start on resource 'windows_service[PerfCounterReporterService]'
10.0.109.164 ================================================================================
10.0.109.164
10.0.109.164 Timeout::Error
10.0.109.164 --------------
10.0.109.164 Timeout::Error
10.0.109.164
10.0.109.164 Resource Declaration:
10.0.109.164 ---------------------
10.0.109.164 # In c:/chef/cache/cookbooks/signalfx/recipes/default.rb
10.0.109.164
10.0.109.164 28: windows_service ‘PerfCounterReporterService’ do
10.0.109.164 29: supports [:start => true, :restart => true]
10.0.109.164 30: startup_type :automatic
10.0.109.164 31: #action :configure_startup
10.0.109.164 32: #action :restart
10.0.109.164 33: action :enable
10.0.109.164 34: action :start
10.0.109.164 35: end
10.0.109.164 36:
10.0.109.164
10.0.109.164 Compiled Resource:
10.0.109.164 ------------------
10.0.109.164 # Declared in c:/chef/cache/cookbooks/signalfx/recipes/default.rb:28:in `from_file’
10.0.109.164
10.0.109.164 windows_service(“PerfCounterReporterService”) do
10.0.109.164 action [:start]
10.0.109.164 supports {:restart=>nil, :reload=>nil, :status=>nil, {:start=>true, :restart=>true}=>true}
10.0.109.164 retries 0
10.0.109.164 retry_delay 2
10.0.109.164 default_guard_interpreter :default
10.0.109.164 service_name "PerfCounterReporterService"
10.0.109.164 enabled nil
10.0.109.164 running nil
10.0.109.164 masked nil
10.0.109.164 pattern "PerfCounterReporterService"
10.0.109.164 startup_type :automatic
10.0.109.164 declared_type :windows_service
10.0.109.164 cookbook_name "signalfx"
10.0.109.164 recipe_name "default"
10.0.109.164 end
10.0.109.164
10.0.109.164 System Info:
10.0.109.164 ------------
10.0.109.164 chef_version=12.21.3
10.0.109.164 platform=windows
10.0.109.164 platform_version=6.3.9600
10.0.109.164 ruby=ruby 2.3.1p112 (2016-04-26 revision 54768) [x64-mingw32]
10.0.109.164 program_name=C:/opscode/chef/bin/chef-client
10.0.109.164 executable=C:/opscode/chef/bin/chef-client
10.0.109.164
10.0.109.164
10.0.109.164 [2017-07-18T12:30:29-04:00] INFO: Running queued delayed notifications before re-raising exception
10.0.109.164 [2017-07-18T12:30:29-04:00] ERROR: Running exception handlers
10.0.109.164 [2017-07-18T12:30:29-04:00] ERROR: Exception handlers complete
10.0.109.164 [2017-07-18T12:30:30-04:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
10.0.109.164 [2017-07-18T12:30:30-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
10.0.109.164 [2017-07-18T12:30:30-04:00] FATAL: Timeout::Error: Timeout::Error
ERROR: Failed to execute command on 10.0.109.164 return code 1

Note: the above same recipie works fine with my test server but cannot able to start the process on DEV/TEST servers .

Please help me

Thanks
Prashanth


#4

Do you mind opening a new discussion on this second question?

Two additional changes

  1. Don’t use the ‘chef automate’ tag, just use the normal chef tag in discourse.
  2. Format the error so that it is easier to read. See here for how to do that

#5

sure will do that…

thank you
Prash