Hi,
i am trying to automate chef using jenkins.
when i run chef-client from jenkins (execute windows batch command or powershell ) instead of running it from node, i am getting below Missing Windows Admin Privileges issue, kindly help
F:\Build\jenkins_slave_workspace\workspace\chef-build>chef-client --once --force-formatter -o "recipe[Hybris-Backoffice::predeploy]"
Starting Chef Client, version 12.16.42e[0m
resolving cookbooks for run list: ["Hybris-Backoffice::predeploy"]e[0m
Synchronizing Cookbooks:e[0m
- Hybris-Backoffice (0.1.0)e[0m
- windows (1.44.1)e[0m
- chef_handler (1.4.0)e[0m
- Windows_Service (0.1.0)e[0m
- Java1.8 (0.1.0)e[0m
- push-jobs (3.2.2)e[0m
- runit (3.0.3)e[0m
- packagecloud (0.2.5)e[0m
- yum-epel (2.0.0)e[0m
- compat_resource (12.16.3)e[0m
- chef-ingredient (0.21.2)e[0m
Installing Cookbook Gems:e[0m
Compiling Cookbooks...e[0m
Converging 14 resourcese[0m
Recipe: Hybris-Backoffice::predeploye[0m
* env[ANT_HOME] action delete
e[0m
================================================================================e[0m
e[31mError executing action `delete` on resource 'env[ANT_HOME]'e[0m
================================================================================e[0m
e[0m WIN32OLERuntimeErrore[0m
--------------------e[0m
(in OLE method `delete_': )
e[0m OLE error code:80041003 in SWbemObjectEx
e[0m Access denied
e[0m HRESULT error code:0x80020009
e[0m Exception occurred.e[0m
e[0m Resource Declaration:e[0m
---------------------e[0m
# In C:/chef/cache/cookbooks/Hybris-Backoffice/recipes/predeploy.rb
e[0m
e[0m 11: env 'ANT_HOME' do
e[0m 12: value "#{node['Hybris-Backoffice']['path']}\\hybris\\bin\\platform\\apache-ant-1.9.1"
e[0m 13: action :delete
e[0m 14: end
e[0m 15:
e[0m
e[0m Compiled Resource:e[0m
------------------e[0m
# Declared in C:/chef/cache/cookbooks/Hybris-Backoffice/recipes/predeploy.rb:11:in `from_file'
e[0m
e[0m env("ANT_HOME") do
e[0m action [:delete]
e[0m retries 0
e[0m retry_delay 2
e[0m default_guard_interpreter :default
e[0m key_name "ANT_HOME"
e[0m value "F:\\Hybris-Back-Office\\hybris\\bin\\platform\\apache-ant-1.9.1"
e[0m declared_type :env
e[0m cookbook_name "Hybris-Backoffice"
e[0m recipe_name "predeploy"
e[0m end
e[0m
e[0m Missing Windows Admin Privilegese[0m
--------------------------------e[0m
**chef-client doesn't have administrator privileges. This can be a possible reason for the resource failure.**e[0m
e[0m Platform:e[0m
---------e[0m
x64-mingw32e[0m
Regards,
Umesha