Pages

15 July, 2021

Coveo for Sitecore 5 - Steps to follow after restoring Sitecore master database

There are instances when we get the backup of Production database and restore it in development environment to troubleshoot peculiar issues or to update the latest content. In those cases, if we have Coveo for Sitecore, after we restore the Sitecore master database, the linking between your Sitecore instance and Coveo cloud breaks, decryption key become invalid and you will need to link it again. 

After you restore the master database, you may be getting following errors in the Sitecore log. 

13528 13:34:32 WARN  An error occurred while decrypting the SitecorePassword configuration element value. The element value will be used as is assuming it is unencrypted. You can encrypt this password by using the Coveo Command Center at /coveo/command-center/index.html#configuration.
Exception: System.Security.Cryptography.CryptographicException
Message: Padding is invalid and cannot be removed.
Source: mscorlib
   at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
   at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
   at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
   at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing)
   at System.IO.Stream.Close()
   at Coveo.Framework.Encryption.RijndaelEncrypter.DecryptData(Byte[] p_DataToDecrypt)
   at Coveo.Framework.Security.ConfigurationValueEncrypter.Decrypt(String p_EncryptedValue)
   at Coveo.Framework.Security.ConfigurationValueEncrypter.SafeDecrypt(String p_EncryptedValue, String p_WarnMessage)

13528 13:34:32 WARN  An error occurred while decrypting the SitecorePassword configuration element value. The element value will be used as is assuming it is unencrypted. You can encrypt this password by using the Coveo Command Center at /coveo/command-center/index.html#configuration.
Exception: System.Security.Cryptography.CryptographicException
Message: Padding is invalid and cannot be removed.
Source: mscorlib
   at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
   at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
   at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
   at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing)
   at System.IO.Stream.Close()
   at Coveo.Framework.Encryption.RijndaelEncrypter.DecryptData(Byte[] p_DataToDecrypt)
   at Coveo.Framework.Security.ConfigurationValueEncrypter.Decrypt(String p_EncryptedValue)
   at Coveo.Framework.Security.ConfigurationValueEncrypter.SafeDecrypt(String p_EncryptedValue, String p_WarnMessage)


ManagedPoolThread #1 13:35:34 ERROR An error while Initializing occurred
Exception: Coveo.Framework.Exceptions.CoveoIndexConfigurationException
Message: There was an error in the Coveo Index Configuration.: Either the SitecoreUsername or SitecorePassword configuration value is invalid. Please enter valid credentials.
Source: Coveo.Framework
   at Coveo.Framework.Configuration.CoveoIndexConfiguration.ValidateSitecoreCredentials()
   at Coveo.Framework.Configuration.CoveoIndexConfiguration.Validate()
   at Coveo.SearchProvider.ProviderIndexBase.Initialize()


ManagedPoolThread #1 13:35:34 WARN  Precondition failed: The parameter 'p_Communication' must not be null
ManagedPoolThread #1 13:35:34 ERROR Exception
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
   at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
   at (Object , Object )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
   at Sitecore.Jobs.DefaultJob.DoExecute()
   at Sitecore.Abstractions.BaseJob.ThreadEntry(Object state)

Nested Exception

Exception: System.ArgumentNullException
Message: Precondition failed: The parameter 'p_Communication' must not be null
Parameter name: p_Communication
Source: Coveo.Framework
   at Coveo.Framework.CNL.Precondition.NotNull(Object p_Parameter, String p_ParameterName)
   at Coveo.SearchProvider.AbstractProviderUpdateContext..ctor(ISearchIndexSummary p_IndexSummary, IIndexCommunication p_Communication)
   at Coveo.SearchProvider.ProviderUpdateContext..ctor(ISearchIndex p_Index, IIndexCommunication p_Communication)
   at Coveo.SearchProvider.ProviderIndex.CreateUpdateContext()
   at Coveo.SearchProvider.ProviderIndex.Update(IEnumerable`1 p_IndexableInfo)

In order to link the connection, you will need to use Coveo Configuration page and follow the steps.

  1. Go to Sitecore Control Panel -> Coveo Search --> Configuration Manager
  2. Click Login. You will be redirected to Coveo Cloud login. After login, you may need to grant access by clicking Authorize button.


  3. Make sure proper Organization is selected and click Apply and Restart.


  4. Once the Sitecore instance restarts, there is a high chance that user account configured to connect to Sitecore may be locked. You can go to Sitecore User Manager, select that user and unlock it. 
  5. Once it is unlocked or if it is not locked, then you can go Coveo Search --> Configuration Manager --> Security --> Enter the password for the configured user and click Apply and Restart. If there is a success message, then it is working fine and Sitecore instance will restart. And you will be able to see all the indexes and fields in the Coveo Admin page. 

No comments:

Post a Comment

blockquote { margin: 0; } blockquote p { padding: 15px; background: #eee; border-radius: 5px; } blockquote p::before { content: '\201C'; } blockquote p::after { content: '\201D'; }