Forum Discussion

CFOChrisH's avatar
CFOChrisH
Frequent Visitor
9 years ago
Solved

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)

 

  • 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?

     

     

12 Replies

  • CFOChrisH's avatar
    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:

    • Anonymous's avatar
      Anonymous
      Not applicable

      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

      • CFOChrisH's avatar
        CFOChrisH
        Frequent Visitor

        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. 

  • Atish's avatar
    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 

    • CFOChrisH's avatar
      CFOChrisH
      Frequent Visitor

      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?

       

       

      • Atish's avatar
        Atish
        Frequent Visitor

        Thanks CFOChrisH,

         

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

         

  • idanw_1984's avatar
    idanw_1984
    Frequent Visitor

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

  • dy's avatar
    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.