Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Pardot Connector

Vote:
 

We are running into an issue where locally everything works, but when deploying to servers, it results in a following error.  It appears by the stack that pardot is trying to unprotect.  Below is the following error.  Any help would be greatly appreciated.

Server Error in '/' Application.
Error occurred during a cryptographic operation.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Cryptography.CryptographicException: Error occurred during a cryptographic operation.

Source Error:


[No relevant source lines]


Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\5c72e1ab\4ccac373\App_global.asax.8rodf8-s.0.cs    Line: 0

Stack Trace:


[CryptographicException: Error occurred during a cryptographic operation.]
   System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.HomogenizeErrors(Func`2 func, Byte[] input) +115
   System.Web.Security.Cryptography.HomogenizingCryptoServiceWrapper.Unprotect(Byte[] protectedData) +70
   System.Web.Security.MachineKey.Unprotect(ICryptoServiceProvider cryptoServiceProvider, Byte[] protectedData, String[] purposes) +62
   System.Web.Security.MachineKey.Unprotect(Byte[] protectedData, String[] purposes) +121
   EPiServer.MarketingAutomationIntegration.Helpers.SecurityHelper.Unprotect(String providerName, String value) +123
   EPiServer.MarketingAutomationIntegration.Pardot.Framework.PardotManager.GetPardotSettings() +449
   EPiServer.MarketingAutomationIntegration.Pardot.Framework.PardotManager..ctor() +34
   EPiServer.MarketingAutomationIntegration.PardotProvider.get_PardotManager() +32
   EPiServer.MarketingAutomationIntegration.PardotProvider.get_Settings() +8
   EPiServer.MarketingAutomationIntegration.PardotProvider.Init(ServiceConfigurationContext serviceConfigurationContext) +138
   EPiServer.MarketingAutomationIntegration.InitializationModule.Initialize(InitializationEngine context) +282
   EPiServer.Framework.Initialization.Internal.<>c__DisplayClass2_0.b__0() +19
   EPiServer.Framework.Initialization.Internal.ModuleNode.Execute(Action a, String key) +52
   EPiServer.Framework.Initialization.Internal.ModuleNode.Initialize(InitializationEngine context) +80
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +300

[InitializationException: Initialize action failed for Initialize on class EPiServer.MarketingAutomationIntegration.InitializationModule, EPiServer.MarketingAutomationIntegration, Version=2.5.1.0, Culture=neutral, PublicKeyToken=null]
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +669
   EPiServer.Framework.Initialization.InitializationEngine.ExecuteTransition(Boolean continueTransitions) +145
   EPiServer.Framework.Initialization.InitializationEngine.Initialize() +40
   EPiServer.Framework.Initialization.<>c.b__7_0(InitializationEngine e) +9
   EPiServer.Framework.Initialization.InitializationModule.EngineExecute(HostType hostType, Action`1 engineAction) +450
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +170
   EPiServer.Global..ctor() +76
   FCStone.Web.EPiServerApplication..ctor() +29
   ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\5c72e1ab\4ccac373\App_global.asax.8rodf8-s.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +114
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1088
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +128
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +20
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +60
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +260
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9963380
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1590.0 
#179821
Jun 22, 2017 15:38
Vote:
 

i should add that i have a machine key in the config.  Just not sure what else to try.  i have tried clearing the cache and Temp files on the server as well.

#179824
Jun 22, 2017 16:06
Vote:
 

Hi Joshua

This error occurs when the machine key used to de-crypt the credentials is different from the one used to encrypt them. I am guessing that the machine key was not specified on the local environment or is different from the one on the server.

Please run this query on the database.

DELETE from tblBigTable WHERE StoreName = 'EPiServer.MarketingAutomationIntegration.Pardot.Contracts.DataClasses.PardotSettings'

This will remove the credentials from the database. You can then re-add the credentials on the server.

We will be releasing a fix next week where this error will not appear anymore. Instead, in a scenario where the machine keys are different between environments, the credentials will be automatically deleted from the database and will have to be re-entered.

To avoid this scenario, make sure that the machine keys specified in the web.config are same in the different servers.

Regards,

Sai.

#180829
Jul 28, 2017 4:56
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.