Chef client is not getting installed on Target windows machine

1.7k views Asked by At

I am unable to figure why its not installing the client on the target machine.
In C drive opscode directory is not available and hence client is not getting installed on target node.

Can some help me out in this .

10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 1"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 2"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 3"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 4"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 5"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 6"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 7"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 8"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 9"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 10"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 11"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 12"
10.233.188.207 "Rendering "C:\Users\ADMINI~1\AppData\Local\Temp\bootstrap-12616-1401793287.bat" chunk 13"
10.233.188.207 Checking for existing directory "C:\chef"...
10.233.188.207 Existing directory found, skipping creation.
10.233.188.207
10.233.188.207 C:\Users\Administrator>(
10.233.188.207 echo.url = WScript.Arguments.Named("url")
10.233.188.207  echo.path = WScript.Arguments.Named("path")
10.233.188.207  echo.proxy = null
10.233.188.207  echo.Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
10.233.188.207  echo.Set wshShell = CreateObject( "WScript.Shell" )
10.233.188.207  echo.Set objUserVariables = wshShell.Environment("USER")
10.233.188.207  echo.
10.233.188.207  echo.'http proxy is optional
10.233.188.207  echo.'attempt to read from HTTP_PROXY env var first
10.233.188.207  echo.On Error Resume Next
10.233.188.207  echo.
10.233.188.207  echo.If NOT (objUserVariables("HTTP_PROXY") = "") Then
10.233.188.207  echo.proxy = objUserVariables("HTTP_PROXY")
10.233.188.207  echo.
10.233.188.207  echo.'fall back to named arg
10.233.188.207  echo.ElseIf NOT (WScript.Arguments.Named("proxy") = "") Then
10.233.188.207  echo.proxy = WScript.Arguments.Named("proxy")
10.233.188.207  echo.End If
10.233.188.207  echo.
10.233.188.207  echo.If NOT isNull(proxy) Then
10.233.188.207  echo.'setProxy method is only available on ServerXMLHTTP 6.0+
10.233.188.207  echo.Set objXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP.6.0")
10.233.188.207  echo.objXMLHTTP.setProxy 2, proxy
10.233.188.207  echo.End If
10.233.188.207  echo.
10.233.188.207  echo.On Error Goto 0
10.233.188.207  echo.
10.233.188.207  echo.objXMLHTTP.open "GET", url, false
10.233.188.207  echo.objXMLHTTP.send()
10.233.188.207  echo.If objXMLHTTP.Status = 200 Then
10.233.188.207  echo.Set objADOStream = CreateObject("ADODB.Stream")
10.233.188.207  echo.objADOStream.Open
10.233.188.207  echo.objADOStream.Type = 1
10.233.188.207  echo.objADOStream.Write objXMLHTTP.ResponseBody
10.233.188.207  echo.objADOStream.Position = 0
10.233.188.207  echo.Set objFSO = Createobject("Scripting.FileSystemObject")
10.233.188.207  echo.If objFSO.Fileexists(path) Then objFSO.DeleteFile path
10.233.188.207  echo.Set objFSO = Nothing
10.233.188.207  echo.objADOStream.SaveToFile path
10.233.188.207  echo.objADOStream.Close
10.233.188.207  echo.Set objADOStream = Nothing
10.233.188.207  echo.End if
10.233.188.207  echo.Set objXMLHTTP = Nothing
10.233.188.207 ) 1>C:\chef\wget.vbs
10.233.188.207
10.233.188.207 C:\Users\Administrator>(
10.233.188.207 echo.param(
10.233.188.207  echo.   [String] $remoteUrl,
10.233.188.207  echo.   [String] $localPath
10.233.188.207  echo.)
10.233.188.207  echo.
10.233.188.207  echo.$webClient = new-object System.Net.WebClient;
10.233.188.207  echo.
10.233.188.207  echo.$webClient.DownloadFile($remoteUrl, $localPath);
10.233.188.207 ) 1>C:\chef\wget.ps1
10.233.188.207
10.233.188.207 C:\Users\Administrator>(
10.233.188.207
10.233.188.207
10.233.188.207
10.233.188.207 )
10.233.188.207 Detected Windows Version 6.1 Build 7600
10.233.188.207
10.233.188.207 C:\Users\Administrator>goto Version6.1
10.233.188.207
10.233.188.207 C:\Users\Administrator>goto architecture_select
10.233.188.207
10.233.188.207 C:\Users\Administrator>goto Architecture
10.233.188.207
10.233.188.207 C:\Users\Administrator>goto ArchitectureAMD64
10.233.188.207
10.233.188.207 C:\Users\Administrator>goto install
10.233.188.207 Checking for existing downloaded package at "C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-latest.msi"
10.233.188.207 No existing downloaded packages to delete.
10.233.188.207 Attempting to download client package using cscript...
10.233.188.207
10.233.188.207 C:\Users\Administrator>cscript /nologo C:\chef\wget.vbs /url:"https://www.opscode.com/chef/download?p=windows&pv=2008r2&m=x86_64" /path:"C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-latest.msi"
10.233.188.207 C:\chef\wget.vbs(29, 1) msxml3.dll: The operation timed out
10.233.188.207
10.233.188.207
10.233.188.207 Failed download: download completed, but downloaded file not found
10.233.188.207 Warning: Failed to download "https://www.opscode.com/chef/download?p=windows&pv=2008r2&m=x86_64" to "C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-latest.msi"
10.233.188.207 Warning: Retrying download with PowerShell if available...
10.233.188.207 powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -command "& 'C:\chef\wget.ps1' 'https://www.opscode.com/chef/download?p=windows&pv=2008r2&m=x86_64&DownloadContext=PowerShell' 'C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-latest.msi'"
10.233.188.207 Exception calling "DownloadFile" with "2" argument(s): "The remote server retur
10.233.188.207 ned an error: (407) Proxy Authentication Required."
10.233.188.207 At C:\chef\wget.ps1:8 char:24
10.233.188.207 + $webClient.DownloadFile <<<< ($remoteUrl, $localPath);
10.233.188.207     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
10.233.188.207     + FullyQualifiedErrorId : DotNetMethodException
10.233.188.207
10.233.188.207 Download via PowerShell succeeded.
10.233.188.207 Installing downloaded client package...
10.233.188.207
10.233.188.207 C:\Users\Administrator>msiexec /qn /log "C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-msi1331.log" /i "C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-latest.msi"
10.233.188.207 This installation package could not be opened.  Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.
10.233.188.207 Chef-client package failed to install with status code 1619.
10.233.188.207

10.233.188.207  echo.10.233.188.207  echo.# Using default node name (fqdn)
10.233.188.207 ) 1>C:\chef\client.rb
10.233.188.207
10.233.188.207 C:\Users\Administrator>(echo.{"run_list":["recipe[notepad]"]}) 1>C:\chef\first-boot.json
10.233.188.207 Starting chef to bootstrap the node...
10.233.188.207
10.233.188.207 C:\Users\Administrator>SET "PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\BMC Software\BBCA\Tuner\System;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\ruby\bin;C:\opscode\chef\bin;C:\opscode\chef\embedded\bin"
10.233.188.207
10.233.188.207 C:\Users\Administrator>chef-client -c c:/chef/client.rb -j c:/chef/first-boot.json -E _default
10.233.188.207 See installation log for additional detail: C:\Users\ADMINI~1\AppData\Local\Temp\chef-client-msi1331.log.
10.233.188.207 'chef-client' is not recognized as an internal or external command,
10.233.188.207 operable program or batch file.
2

There are 2 answers

0
Manak Wadhwa On

Please check with which user its trying to execute chef-client. Verify that user has the privileges to install chef-client.

0
Tensibai On

Your problem is here:

10.233.188.207 Exception calling "DownloadFile" with "2" argument(s): "The remote server retur
10.233.188.207 ned an error: (407) Proxy Authentication Required."

So seems your proxy requires authentification. Two options:

1) Your proxy supports basic auth (and not only NTLM) and you can set user and password in the proxy you gives for bootstrap in the form of http://<user>:<password>@<proxy_adress>:<proxy_port WARNING: if your password contains special characters (like @, #, é, etc.) you should add them as url encoded char (i.e: @ => %40 , # => %23 so in your password you'll have % for each special char. see http://meyerweb.com/eric/tools/dencoder/ to encode it)

2) You're stuck with an NTLM authentification on your target node, bad luck but: you may use an authentification proxy between your node and your proxy like ntlmaps Try it with a simple navigator at first to ensure it works, you'll probably have to tweak the parameters for it to work.

One more thing: if your proxy does SSL interception, you'll have another bad time with its certificate later on, you'll have to add it to chef cacert.pem in addition to your windows ca certificate store. For some tooling (like bundle) you'll have to set SSL_CERT_FILE=c:/chef/embedded/ssl/certs/cacert.pem (adapt the path to your install location)

For vagrant it has its own cacert.pem file needing the same operation at the root of vagrant installation dir and vagrant enforce the use of this file when running, overriding the environment variable.

Edit: (Just saw the question was quite old, I'm unsure why I found it, but the informations I gave are still valid, so leaving it as is)