Pergunta

On a Windows Server 2008 R2 - Datacentre core (downloaded from vagrantbox.es)) VM provisioned by Vagrant, I run chef-solo to test my cookbook. I cannot run a windows_package without getting an Win32APIError.

Running the following recipe step:

windows_package ".NET 4.0" do
  package_name "Microsoft .NET Framework 4 Extended"
  source "http://download.microsoft.com/download/3/6/1/361DAE4E-E5B9-4824-B47F-6421A6C59227/dotNetFx40_Full_x86_x64_SC.exe"
  options "/q"
  installer_type :inno
  action :install
end

Yields the following error:

Chef::Exceptions::Win32APIError: windows_package[.NET 4.0] (<my recipe> line 10) had an error: 
 Chef::Exceptions::Win32APIError: remote_file[C:/vagrant/cache/dotNetFx40_Full_x86_x64_SC.exe] (dynamically defined) had an error: 
 Chef::Exceptions::Win32APIError: Incorrect function.
get_named_security_info(C:/vagrant/cache/dotNetFx40_Full_x86_x64_SC.exe, SE_FILE_OBJECT, 7)
 ---- Begin Win32 API output ----
System Error Code: 1
System Error Message: Incorrect function.
---- End Win32 API output ----

The setup file is downloaded correctly and I can run it manually from the VM console after the chef error, so I'm guessing it's some Ruby/Chef permission error...

Trying to install the Opscode SQL Server recipe produces the same get_named_security_info error.

Any idea what is wrong??

--
Using Chef version 11.4.4-2

Foi útil?

Solução

Got it. Turns out the error is caused by the fact that the cache folder (where the installer is downloaded) was in the Vagrant "network shared folder" (c:\vagrant\cache\). Changing it to c:\temp\cache for example solves the get_named_security_info() error.

So in my chef-solo config file:

file_cache_path "C:/temp/cache"
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top