Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
CFOChrisH
Frequent Visitor

On-premises data gateway (personal mode) Key Error

Hey all,

 

I am moving from a Personal Gateway to the new On-Prem data gateway (personal mode). When I try to sign in, I get the following error message:

 

"Error generating an asymmetric key. Key not valid for use in specified state"

 

This is a VM with Windows Server 2008 R2 Enterprise 64-Bit. 

 

The error is followed by this string of info:

 

Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.PowerBI.DataMovement.Pipeline.InternalContracts.IGatewayConfigurationService.GenerateAsymmetricKey()
at Microsoft.PowerBI.DataMovement.Pipeline.GatewayClient.GatewayConfigurationClient.GenerateAsymmetricKey()An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.

at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)
at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()
at Microsoft.PowerBI.DataMovement.CommonUtilities.AsymmetricKeyEncryptionHelper.ProduceAsymmetricKey(String containerName, Boolean cleanUpOldKeys)
at Microsoft.PowerBI.DataMovement.Pipeline.Common.Diagnostics.PipelineTelemetryService.ExecuteInActivity[T](PipelineActivityType pipelineActivityType, Func`1 action)
at SyncInvokeGenerateAsymmetricKey(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

 

1 ACCEPTED SOLUTION

Hey Atish,

 

Interesting timing on this, as I was able to get a workaround yesterday. In order to make the personal gateway work, I set up a new virtual machine that was on Windows Server 2012 R2 Standard. (I had to setup a new machine because the client owns the other older machine and didn't want to upgrade). The Gateway (Personal Mode) is running like a gem on this new machine, which may mean there is a problem with running it on Windows Server 2008 R2 Enterprise

 

What are the specs of the machine you're trying to run this on?

 

 

View solution in original post

12 REPLIES 12
dy
New Member

@CFOChrisH  Hi, i need your help. it's been a week stuck on it. having error "Failed to decrypt data: Key not valid for use in specified state". 

let me brief you about my scenario,  I'm using enterprise gateway. all data sources is working fine in which i use data import method. but when i use Direct Query method it's giving me this error "Failed to decrypt data: Key not valid for use in specified state". Pls help me. 


Awaiting for your response. will be thankfull to you.

idanw_1984
Frequent Visitor

I'm getting the same issue. is there a solution for this problem?

Atish
Frequent Visitor

Hi All,

 

We are also getting this error for the last few days.

 

Error generating an asymmetric key.
Key not valid for use in specified state.


Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.PowerBI.DataMovement.Pipeline.InternalContracts.IGatewayConfigurationService.GenerateAsymmetricKey()
at Microsoft.PowerBI.DataMovement.Pipeline.GatewayClient.GatewayConfigurationClient.GenerateAsymmetricKey()An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Security.Cryptography.CryptographicException: Key not valid for use in specified state.

at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)
at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)
at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()
at Microsoft.PowerBI.DataMovement.CommonUtilities.AsymmetricKeyEncryptionHelper.ProduceAsymmetricKey(String containerName, Boolean cleanUpOldKeys)
at Microsoft.PowerBI.DataMovement.Pipeline.Common.Diagnostics.PipelineTelemetryService.ExecuteInActivity[T](PipelineActivityType pipelineActivityType, Func`1 action)
at SyncInvokeGenerateAsymmetricKey(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

 

Any solution to this

Thanks 

Hey Atish,

 

Interesting timing on this, as I was able to get a workaround yesterday. In order to make the personal gateway work, I set up a new virtual machine that was on Windows Server 2012 R2 Standard. (I had to setup a new machine because the client owns the other older machine and didn't want to upgrade). The Gateway (Personal Mode) is running like a gem on this new machine, which may mean there is a problem with running it on Windows Server 2008 R2 Enterprise

 

What are the specs of the machine you're trying to run this on?

 

 

Hi,

Am not using VM, am using in normal machine which is Windows 10.

 

 

Regards,

Suresh Pantra.

I'm getting the same issue and installing a virtual machine is a little outside of my abilities (or admin credentials...). Is there another workaround?

Thanks CFOChrisH,

 

I installed the Gateway in a different VM and it is working fine there 🙂 

 

CFOChrisH
Frequent Visitor

Update: I tried to just use the full version of the on-premises data gateway, but then when I go to the Service, it says that I must use the personal mode, and will not allow me to use the enterprise. See screen shot below:

Gateway personal.JPG

@CFOChrisH,

What data sources are contained in your dataset? You would need to add all the data sources of your dataset under the registered enterprise gateway, then you will be able to use enterprise gateway to refresh the dataset. However, please note that if your dataset contains on-premises data sources and online data sources that use OAuth type authentication, you would need to use personal gateway to refresh the dataset.

Besides, if you create reports in Power BI Desktop, you can go to File -> Options and settings ->Data source settings to check data sources, please post a screenshot about the data sources.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey Lydia, 

 

Sorry for my delay in responding. I've beenable to get all of my data sources except Facebook reconnected through the Enterprise gateway. Why is the OAuth not supported with the enterprise? I can't use the personal Gateway as I continue to have the issues mentioned in the original post. 

@CFOChrisH,

The team is working on the feature that add OAuth type auth in Enterprise gateway. In your scenario, you can split the Facebook data source and other dta sources into different PBIX files, then publish the PBIX files to Power BI Service. The dataset that contains only Facebook data source doesn't require gatewat to refresh.

Besides, do you install the latest version of on-premise gateway(personal mode)?

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I attempt to dowload and install the latest version of the On-premises data gateway (personal mode), but I keep getting the key error, as mentioned in the first post in this thread.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors