vmware-archive / powernsx

PowerShell module that abstracts the VMware NSX-v API to a set of easily used PowerShell functions
173 stars 90 forks source link

An unknown exception occured calling invoke-internalwebrequest #632

Closed cpitchai closed 3 years ago

cpitchai commented 3 years ago

Getting the below error while trying to create a switch.

WebRequest: /root/.local/share/powershell/Modules/PowerNSX/3.0.1174/PowerNSX.psm1:10095 Line | 10095 | … $response = invoke-nsxwebrequest -method "post" -uri $URI -body $body … | ~~~~~~~~~~~~~ | Invoke-NsxWebRequest : An unknown exception occured calling invoke-internalwebrequest. System.Management.Automation.PSArgumentException: Cannot find type [InternalHttpClientHandler]: | verify that the assembly containing this type is loaded. at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord) in | /usr/src/photon/BUILD/PowerShell-7.0.0/src/System.Management.Automation/engine/MshCommandRuntime.cs:line 2078 StackTrace: at Invoke-InternalWebRequest, | /root/.local/share/powershell/Modules/PowerNSX/3.0.1174/PowerNSX.psm1: line 3825 at Invoke-NsxWebRequest, /root/.local/share/powershell/Modules/PowerNSX/3.0.1174/PowerNSX.psm1: line | 4324 at New-NsxLogicalSwitch, /root/.local/share/powershell/Modules/PowerNSX/3.0.1174/PowerNSX.psm1: line 10095 at Get-NsxTransportZone, | /root/.local/share/powershell/Modules/PowerNSX/3.0.1174/PowerNSX.psm1: line 9232 at , : line 1 PropertyNotFoundException: /root/.local/share/powershell/Modules/PowerNSX/3.0.1174/PowerNSX.psm1:10098 Line | 10098 | Get-NsxLogicalSwitch -virtualWireId $response.content -connec … | ~~~~~~~~~~~~~ | The property 'content' cannot be found on this object. Verify that the property exists.

alagoutte commented 3 years ago

Hi,

What cmdlet do you are using ?

What release of NSX-V ?

cpitchai commented 3 years ago

New-NsxLogicalSwitch -Name Test -TransportZone $transportzone Version : 6.4.6 BuildNumber : 14819921 Credential : System.Management.Automation.PSCredential Server : X.X.X Port : 443 Protocol : https

cpitchai commented 3 years ago

vCenter version 6.7 VMware NSX networking solution NSX-V NSX for vSphere 6.4.6-14819921

cpitchai commented 3 years ago

I am able to run the same command from using this docker image. "docker.io/vmware/powerclicore:ubuntu16.04

alagoutte commented 3 years ago

What release of PowerNSX ?

What do you have on $transportzone variable ?

What the platform ?

cpitchai commented 3 years ago

PowerNSX Version 3.0.1174 $transportzone = Get-NsxTransportZone "name of the transportzone" Its a VMWARE on Softlayer

cpitchai commented 3 years ago

I am using this docker image "docker pull vmware/powerclicore"

alagoutte commented 3 years ago

may be need to update powerclicore (powershell release), look a internal error with the docker image...

cpitchai commented 3 years ago

Thank you.