- Community Home
- >
- Servers and Operating Systems
- >
- HPE ProLiant
- >
- Servers - General
- >
- RedFish - HPERedFishCMdlets - Error when connectin...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-23-2021 11:07 AM - last edited on тАО01-04-2022 12:31 AM by support_s
тАО12-23-2021 11:07 AM - last edited on тАО01-04-2022 12:31 AM by support_s
RedFish - HPERedFishCMdlets - Error when connecting
Hi,
i try to use the HPERedFishCMdlets for PowerShell (v7.2) on a Windows 2012 R2 System, but i got the following error when i try to connect to an HPE Proliant DL380 Gen10 Server (ILO 5):
$cred = Import-Clixml -Path "[path to credentials.xml]"
Connect-HPERedfish -Address [ip-address] -Credential $cred -DisableCertificateAuthentication
Error: InvalidOperation: The property 'Expect100Continue' cannot be found on this object. Verify that the property exists and can be set.
Any help is appreciated.
Regards,
Johannes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-26-2021 01:24 AM - edited тАО12-26-2021 01:30 AM
тАО12-26-2021 01:24 AM - edited тАО12-26-2021 01:30 AM
Re: RedFish - HPERedFishCMdlets - Error when connecting
Small Update - i have found out, that the connect-hpeRedFish Command works correctly on the windows integrated PowerShell 5.1:
Unfortunately i haven't found out the difference to PowerShell 7.2 until yet:
However, i have one difference. The System has Internet Connection over an authenticating proxy. Although i tried to removing any customized proxy settings, in contrast to PowerShell 5.1, PowerShell 7 starts every new session with an definied proxy. So i must set "[system.net.webrequest]::DefaultWebProxy = new-object system.net.webproxy($null)" to remove the proxy settings. I have checked out every settings, but i haven't found out, where PowerShell is getting the proxy settings, Neither PowerShell Profile, Internet Proxy Settings, nor envirenonment variables like http_proxy or https_proxy are set. Policy Settings are excluded- this proxy is not distributed over the system policies.
I don't know if this could affect the Expect100Continue Problem.
Best regards
Johannes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2021 04:16 AM
тАО12-30-2021 04:16 AM
Re: RedFish - HPERedFishCMdlets - Error when connecting
Hi,
is there no one who can help here?
Best regards
Johannes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2022 12:29 AM
тАО01-04-2022 12:29 AM
Re: RedFish - HPERedFishCMdlets - Error when connecting
Hello @Johannes219
As there is no response to the query yet, I would recommend to directly contact technical support and log a support call for quicker resolution. Please refer the links below for support ticket options:
https://support.hpe.com/help/en/Content/supportAndOtherResources.html
https://www.hpe.com/psnow/doc/A00039121ENW
Thanks,
Parvez_Admin
I work for HPE
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2022 03:33 AM
тАО01-04-2022 03:33 AM
Re: RedFish - HPERedFishCMdlets - Error when connecting
Hello,
i simply have deactivated the Expect100Continue now:
$httpWebRequest.ServicePoint.Expect100Continue = $false
But when i try to connect i become to followed error:
Exception: Exception calling "GetResponse" with "0" argument(s): "The SSL connection could not be established, see inner exception."
With "$Errors[0].Exception.InnerException | FL *" i get the followed error:
InvalidOperation: Cannot index into a null array.
I have found some solutions on https://stackoverflow.com/questions/34331206/ignore-ssl-warning-with-powershell-downloadstring to set ServerCertificateValidationCallback to $true, but it did not help:
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
Also, to get the line of this error, i have copied the CMDLet Functions in own script and renamed the function "Connect-HPERedfish2"
The Result of this Error is on Line 1723:
[System.Net.WebResponse] $resp = $httpWebRequest.GetResponse()
All commands to create variable $httpsWebRequest before the Line 1723 are listed below:
$wr = [System.Net.WebRequest]::Create($Uri)
$httpWebRequest = [System.Net.HttpWebRequest]$wr
$httpWebRequest.Method = $Method
$httpWebRequest.AutomaticDecompression = [System.Net.DecompressionMethods]::GZip
$httpWebRequest.Headers.Add('Odata-version','4.0')
$httpWebRequest.ServicePoint.Expect100Continue = $false
$httpWebRequest.Headers.Add('X-Auth-Token',$Session.'X-Auth-Token'
$httpWebRequest.ServerCertificateValidationCallback = {$true}
The $session variable is definied as followed:
$session = New-Object PSObject
$session|Add-Member -MemberType NoteProperty 'RootUri' $rootUri
$session|Add-Member -MemberType NoteProperty 'X-Auth-Token' $webResponse.Headers['X-Auth-Token']
$session|Add-Member -MemberType NoteProperty 'Location' $webResponse.Headers['Location']
$session|Add-Member -MemberType NoteProperty 'RootData' $rootData
$session|Add-Member -MemberType NoteProperty 'DisableExpect100Continue' $DisableExpect100Continue
Additionally, i have tried to connect to the Server with the Invoke-Webrequest:
Invoke-WebRequest https://<IP-Address>/ -SkipCertificateCheck
This was successfull.
Referring to the inner Exception, the $httpWebRequest.GetResponse() is $null. But why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2022 03:34 AM
тАО01-05-2022 03:34 AM
Re: RedFish - HPERedFishCMdlets - Error when connecting
Hello,
i have a couple of updates - while i create my own script depending on the HPE ConnectCMDLet, i have found out, that the system proxy settings works against me.
With the line:
[System.Net.WebResponse] $resp = $httpWebRequest.GetResponse()
i got the following error:
Line |
72 | [System.Net.WebResponse] $resp = $httpWebRequest.GetResponse()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling "GetResponse" with "0" argument(s): "The proxy tunnel request to proxy 'http://<proxyUri>/' failed with status code '403'.""
Doesn't matter that the authentication fails - the connection should definitly not use this proxy.
So, i tried to reset the proxy with following line:
[System.Net.Webrequest]::DefaultWebProxy = New-object System.Net.Webproxy($null)
This results in the root failure again:
Line |
69 | $httpWebRequest.ServicePoint.Expect100Continue = -not($DisableExpect1 тАж
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The property 'Expect100Continue' cannot be found on this object. Verify that the property exists and can be set.
Then, i tried to configure the webproxy including bypass parameters in reference to https://stackoverflow.com/questions/28434480/creating-proxy-with-bypass-list-fails-if-it-contains
$proxyUri = "http<proxy:port>"
$snwr = [System.Net.Webrequest]::DefaultWebProxy = new-object System.Net.Webproxy($proxyUri, $true)
$snwr.Credentials = Import-Clixml -Path "<path-to-credentials>"
$snwr.BypassArrayList.Add("localhost")
$snwr.BypassArrayList.Add("*.local")
$snwr.BypassArrayList.Add("127.0.0.0/8")
$snwr.BypassArrayList.Add("172.16.0.0/16")
$snwr.BypassArrayList.Add("192.168.0.0/16")
$snwr.BypassProxyOnLocal = $true
But the bypasslist does not work. The only thing that works is "localhost':
$snwr.IsBypassed("https://localhost") >> returns true
$snwr.IsBypassed("https://192.168.1.1") >> returns false
$snwr.IsBypassed("https://website.local") >> returns false
Additionally, i used the ip-addresses without apostrophes, but without success. Even the "192.168.* does not work.
There is annother property, called "BypassArrayList.AddRange" There, i don't know which value is valid, i become the followed error every time:
Line |
47 | $snwr.BypassArrayList.AddRange(192.168.0.0/8)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert argument "c", with value: "0", for "AddRange" to type "System.Collections.ICollection": "Cannot convert the "0" value of type "System.Int32" to type "System.Collections.ICollection"."
In Conclusion - its not a basically error in PowerShell 7, more an error with the proxy settings. I hope, when the proxy settings are correct / bypassed, the connection to the server will success.
How do I configure the proxy bypass settings to work properly?
Regards
Johannes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-07-2022 02:02 AM - edited тАО01-07-2022 02:32 AM
тАО01-07-2022 02:02 AM - edited тАО01-07-2022 02:32 AM
Re: RedFish - HPERedFishCMdlets - Error when connecting
Hi,
The proxy settings are reset does not cause problems anymore.
The root cause for this problem are incompatibilities about the ServerCertificateValidationCallback property of ServicePointManager in PowerShell Core+.
The property is only supported in PowerShell 5.1, not in PowerShell Core and newer.
Links:
https://get-powershellblog.blogspot.com/2017/12/powershell-core-web-cmdlets-in-depth.html
HttpWebRequest/HttpClient with self-signed client certificate ┬╖ Issue #17154 ┬╖ dotnet/runtime
Is there a way to update the HPE RedFish CMDLets?
Regards
Johannes