Chef client is not getting installed on Target windows machine - knife

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.

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

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)

Related

ERR_INVALID_PROTOCOL when installing sentry-cli

I have an app running on docker container with nodejs 12.3.1
Now I'm trying to upgrade the nodejs to 16.14.2
I can run the app in local system, but when trying to deploy to docker. I get error while installing sentry-cli. Below is the error when sentry-cli is also upgraded to 2.9.0. Initially sentry-cli was at 1.57.0 (had the same error)
error code 1
09:47:43 5329 error path /usr/app/src/node_modules/#sentry/cli
09:47:43 5330 error command failed
09:47:43 5331 error command sh -c node ./scripts/install.js
09:47:43 5332 error [sentry-cli] Downloading from https://downloads.sentry-cdn.com/sentry-cli/2.9.0/sentry-cli-Linux-x86_64
09:47:43 5332 error [sentry-cli] Using proxy URL: http://pkg.proxy.prod.jp.local:10080/
09:47:43 5332 error Error: Unable to download sentry-cli binary from https://downloads.sentry-cdn.com/sentry-cli/2.9.0/sentry-cli-Linux-x86_64.
09:47:43 5332 error Error message: Protocol "https:" not supported. Expected "http:"
09:47:43 5332 error Error code: ERR_INVALID_PROTOCOL
09:47:43 5333 verbose exit 1
Your proxy server (pkg.proxy.prod.jp.local) is using http protocol, so it cannot proxy an https request that our install script is performing.
Either change proxy URL or don't use it at all.
Optionally you can change the CDN address with SENTRYCLI_CDNURL=https://github.com/getsentry/sentry-cli/releases/download/

Getting "405: method not allowed" error while pinging to Jfrog Artifactory in Jfrog CLI

I have Installed Jfrog CLI (2.12.0) and configured it by using jf config addcommand.
After passing the platform URL, username and password I executed jf rt ping to check the connection.
But am getting the below error as a response
[root#osc-in-bldslave-1 opt]# jf rt ping
19:13:51 [Error] Server response: 405 Method Not Allowed
{
"errors": [
{
"status": 405,
"message": "Method Not Allowed"
}
]
}
Please let me know if you need any other details.
Below are the Steps I followed while Jfrog CLI configuration. Correct me if there is any issues with configuration.
[root#osc-in-bldslave-1 ~]# jf -version
jf version 2.12.0
[root#osc-in-bldslave-1 ~]#
[root#osc-in-bldslave-1 ~]# jf config add
Choose a server ID : <server id>
JFrog platform URL [http://xxx.xx.xxx.xx:8081/]: http://xxx.xx.xxx.xx:8081/
JFrog access token (Leave blank for username and password/API key):
JFrog username [username]: <username>
JFrog password or API key:<passing password here>
Is the Artifactory reverse proxy configured to accept a client certificate? (y/n) [n]? n
[root#osc-in-bldslave-1 ~]#
[root#osc-in-bldslave-1 ~]# jf rt ping
09:55:13 [Error] Server response: 405 Method Not Allowed
{
"errors": [
{
"status": 405,
"message": "Method Not Allowed"
}
]
}
[root#osc-in-bldslave-1 ~]#
But if it try pinging to my URL directly using below command it is working fine.
[root#osc-in-bldslave-1 ~]# jf rt ping --url=http://172.xx.xxx.xx:8081/artifactory/
OK
I deleted and installed Jfrog CLI freshly, still am facing the same 405: method not allowed issue.
Can anyone please let me know what am missing?
Looks like while configuring the JFrog CLI some of the parameters are incorrect, due to which the error is thrown. Same was tested in my env and its workings as expected.
➜ jf -version jf version 2.12.0
➜ jf rt ping OK
you can find using command which jf & whereis jf

cordova installation error -Command failed: powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption The term 'Get-CimInstance' is not re

I tried to install cordova with " npm install -g cordova"
When I run the command "cordova -v" or "cordova -V" or "cordova --version"
I am getting this error.
Please help to resolve the issue
C:\Users\Admin>cordova -v
C:\Users\Admin\AppData\Roaming\npm\node_modules\cordova\node_modules\windows-release\node_modules\execa\index.js:347
throw err;
^
Error: Command failed: powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption
The term 'Get-CimInstance' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At line:1 char:17
+ (Get-CimInstance <<<< -ClassName Win32_OperatingSystem).caption
+ CategoryInfo : ObjectNotFound: (Get-CimInstance:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
at makeError (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\node_modules\←[4mwindows-release←[24m\node_modules\←[4mexeca←[24m\ind
ex.js:174:9)
at Function.module.exports.sync (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\node_modules\←[4mwindows-release←[24m\node_modules
\←[4mexeca←[24m\index.js:338:15)
at windowsRelease (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\node_modules\←[4mwindows-release←[24m\index.js:39:19)
at osName (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\node_modules\←[4mos-name←[24m\index.js:39:18)
at new Insight (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\node_modules\←[4minsight←[24m\lib\index.js:37:13)
at new RelentlessInsight (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\src\telemetry.js:31:1)
at Object.<anonymous> (C:\Users\Admin\AppData\Roaming\npm\node_modules\←[4mcordova←[24m\src\telemetry.js:39:15)
←[90m at Module._compile (internal/modules/cjs/loader.js:1118:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:982:32)←[39m {
code: ←[33m1←[39m,
stdout: ←[32m''←[39m,
stderr: ←[32m"The term 'Get-CimInstance' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if\r\n"←[39m +
←[32m' a path was included, verify that the path is correct and try again.\r\n'←[39m +
←[32m'At line:1 char:17\r\n'←[39m +
←[32m'+ (Get-CimInstance <<<< -ClassName Win32_OperatingSystem).caption\r\n'←[39m +
←[32m' + CategoryInfo : ObjectNotFound: (Get-CimInstance:String) [], CommandNotFoundException\r\n'←[39m +
←[32m' + FullyQualifiedErrorId : CommandNotFoundException\r\n'←[39m +
←[32m' \r\n'←[39m,
failed: ←[33mtrue←[39m,
signal: ←[1mnull←[22m,
cmd: ←[32m'powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption'←[39m,
timedOut: ←[33mfalse←[39m
}
C:\Users\Admin>
Get-CimInstance was introduced in Powershell v3. It was not available previously.
The rough equivalent in Powershell v2 is Get-WmiObject, but be advised that that command was superseded and deprecated by the Get-Cim* commands. As of Powershell v6, Get-WmiObject no longer exists.
Both Powershell v2 and Windows 7 are at end of life (as of January 2020), and should be considered insecure and inappropriate for contemporary usage. That said, Windows 7 does support Powershell v5 through Windows Management Framework 5.1, although Microsoft is no longer under any obligation to host that file for Windows 7 so it may not remain available.

Error while updating the package castle core package to 4.4.1.0

After updating the castle core package i am facing the following exception .
i am using moq 4.13 .
assembly binding i mentioned as following. please help in resolving this issue.
bindingRedirect oldVersion="0.0.0.0-4.4.1.0" newVersion="4.0.0.0"
Project C:\mypath on node 1 (DemoBuild target(s)).
RESTOREPACKAGES:
" C:\mypath .nuget\NuGet.exe" update -self
Checking for updates from https://api.nuget.org/v3/index.json.
C:\mypath \build\build-git.config(118,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json.
C:\mypath \build\build-git.config(118,5): error : An error occurred while sending the request.
C:\mypath \build\build-git.config(118,5): error : Unable to connect to the remote server
C:\mypath \build\build-git.config(118,5): error : No connection could be made because the target machine actively refused it
C:\mypath \build\build-git.config(118,5): error MSB3073: The command "" C:\mypath .nuget\NuGet.exe" update -self" exited with code 1.
Done Building Project " C:\mypath \build\build-git.config" (DemoBuild target(s)) -- FAILED.
Build FAILED.
Moq 4.13 has a dependency on Castle.Core >= 4.4.0. Do you need your own reference to 4.4.1 for any particular reason?
Otherwise I'm seeing connectivity issues so I would be looking at that first.
error : Unable to load the service index for source https://api.nuget.org/v3/index.json
error : An error occurred while sending the request.
error : Unable to connect to the remote server
error : No connection could be made because the target machine actively refused it
NuGet.org have recently removed TLS 1.0 and 1.1 support, not sure if that's a cause in this case.
I am also getting this and found out that nuget.org dropped support for TLS 1.0 and TLS 1.1 on 15/06/2020. Now only TLS 1.2 can connect. If you use the -v verbosity 'detailed' option it tells you that it fails to make a secure SSL/TLS connection.

azure login in cmd works but powershell fails - behind company proxy

I try to login to azure with
az login
this does not work behind our proxy and I get something like:
Error occurred in request., ConnectionError: HTTPSConnectionPool(host='management.azure.com', port=443): Max retries exceeded with url: /tenants?api-version=2016-06-01 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x0568A070>: Failed to establish a new connection: [WinError 10060] Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat',))
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\urllib3\connection.py", line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\urllib3\util\connection.py", line 80, in create_connection
raise err
File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\urllib3\util\connection.py", line 70, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat
During handling of the above exception, another exception occurred:
In cmd therefor I execute the following commands
set HTTPS_PROXY=myProxy.a200.mh.gro:80
az login
And I get my subscriptions and all works.
Now as most of Azure documentation is used within powershell I tried above way and It did not work. As obviously, setting proxy works different in powershell. So I executed following:
netsh winhttp set proxy "myProxy.a200.mh.gro:80"
az login
This gives same result as az login without proxy in cmd.
Can anyone hint me to the right direction, what setting I need to undertake to use azure cli with powershell?
It means you set the environment variable when you run the command in cmd:
set HTTPS_PROXY=myProxy.a200.mh.gro:80
But it will not work in PowerShell. To set the environment variable in PowerShell, you cloud run the command like this in your issue:
$env:HTTPS_PROXY='myProxy.a200.mh.gro:80'

Resources