Forum Discussion
On-premise DataGateway Powershell error: There was an error while trying to deserialize parameter
Hi there,
I'm using IaC to automatically provision and recover a PowerBi On-Prem DataGateway with PowerShell (see command below). I'm using this approach since 8 month now and - so far - it worked well. Since approx. 1 week, the data-gateway can't be recovered anymore due to an powershell error, so I decided to re-create the gateway from scratch again, but it fails with same error (see below).
This is part of my script:
Install-Module -Name AWS.Tools.SecretsManager -RequiredVersion 4.1.506 -Repository PSGallery -Force
# Retrieve Secrets
$Secrets = (Get-SECSecretValue -SecretId arn:aws:secretsmanager:eu-central-1:XXXXXXXX:secret:powerbi_gateway_recovery_key20240201061715149600000001).SecretString | ConvertFrom-Json
# Install PowerBi Gateway - no version pinning as latest version seems to be required always
Install-Module -Name DataGateway -Repository PSGallery -Force
Import-Module -Name DataGateway
Connect-DataGatewayServiceAccount -ApplicationId $Secrets.ServiceUser_ClientId -ClientSecret (ConvertTo-SecureString $Secrets.ServiceUser_Secret -AsPlainText -Force) -Tenant $Secrets.ServiceUser_TenantId
Install-DataGateway -AcceptConditions
# Add gateway
Add-DataGatewayCluster -RecoveryKey $SecureRecoveryKey -GatewayName gateway_v1
Error, produced by last command of the script above:
Add-DataGatewayCluster: Error getting Gateway static capabilities.
Exception message: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter urn:ps:GetGatewayStaticCapabilitiesResult. The InnerException message was 'Invalid enum value 'GatewaySqlTrustedServers' cannot be deserialized into type 'Microsoft.PowerBI.DataMovement.ExternalContracts.API.GatewayStaticCapabilities'. Ensure that the necessary enum values are present and are marked with EnumMemberAttribute attribute if the type has DataContractAttribute attribute.'. Please see InnerException for more details.
The data gateway was installed at version https://www.powershellgallery.com/packages/DataGateway/3000.240.50 which is the most-recent at time of writing:
I also tried the older version https://www.powershellgallery.com/packages/DataGateway/3000.236.121 but Add-DataGatewayCluster fails with same error.
Any idea what is causing this and how to get it fixed?
Thanks in advance,
Max
This is a known issue with the latest release of the gateway itself. Nothing is wrong with the cmdlet. If you install the July version of the gateway, the cmdlet commands work fine. I have an open ticket with the product team and they're investigating since they've been able to reproduce the error. TrackingID #2409190050002652.
7 Replies
- mzareFrequent Visitor
This is a known issue with the latest release of the gateway itself. Nothing is wrong with the cmdlet. If you install the July version of the gateway, the cmdlet commands work fine. I have an open ticket with the product team and they're investigating since they've been able to reproduce the error. TrackingID #2409190050002652.
- p24maxNew Member
mzare yeah downgrading fixed it! Thank you so much!
This is how I pinned it in code now:
Invoke-WebRequest 'https://download.microsoft.com/download/D/A/1/DA1FDDB8-6DA8-4F50-B4D0-18019591E182/GatewayInstall-24-07.exe' -OutFile 'C:\Windows\Temp\GatewayInstall.exe' Install-DataGateway -InstallerLocation 'C:\Windows\Temp\GatewayInstall.exe' -AcceptConditions - AnonymousNot applicable
Please guys!! Work hard to solve this!! Do your job well!!
- mzareFrequent Visitor
The problem is resolved now. If you install the most recent DataGateway module it will work with the latest On-premises Data Gateway release. You can grab the latest DataGateway module from PowerShell Gallery | DataGateway 3000.244.23
- mzareFrequent Visitor
However now I have another problem with the gateway where it's missing the Simba ODBC driver.