Gravatar for jim.manson@roundedcube.com

Question by jmanson, Mar 19, 2015 12:00 PM

Coveo says "OOPS!" on search

We have installed Coveo Enterprise Search 7 / Rest API on an application server. It seems to be functional. We installed Coveo for Sitecore on a web site on our test web server and pointed it to the application server for Coveo. When we go to the search page it says "OOPS! SOMETHING WENT WRONG ON THE SERVER." If the problem persists contact the administrator.

This same code works fine in our development environment where CES/REST API are installed on the same machine with the web server but breaks when we separate the web server from the Coveo server.

I see the following error in the log files:

Heartbeat 10:31:14 INFO  Cache created: 'SqlDataProvider - Property data(master)' (max size: 500KB, running total: 173MB)
 144 10:31:14 ERROR An error occurred while decrypting the SitecorePassword configuration element value. The element value will be used as is.
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.Connectors.Utilities.Encryption.RijndaelEncrypter.DecryptData(Byte[] p_DataToDecrypt)
   at Coveo.Framework.Security.ConfigurationValueEncrypter.Decrypt(String p_EncryptedValue)
   at Coveo.Framework.Configuration.CoveoIndexConfiguration.set_SitecorePassword(String value)

Heartbeat 10:31:14 INFO  Cache created: 'SqlDataProvider - Property data(web)' (max size: 500KB, running total: 173MB)
 144 10:31:14 ERROR An error occurred while decrypting the SitecorePassword configuration element value. The element value will be used as is.
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.Connectors.Utilities.Encryption.RijndaelEncrypter.DecryptData(Byte[] p_DataToDecrypt)
   at Coveo.Framework.Security.ConfigurationValueEncrypter.Decrypt(String p_EncryptedValue)
   at Coveo.Framework.Configuration.CoveoIndexConfiguration.set_SitecorePassword(String value)

Did I miss a step when I was setting up the Coveo server and config? The firewall is off so I don't believe it is a port issue. Any insight or assistance would be appreciated.

1 Reply
Gravatar for jflheureux@coveo.com

Answer by Jean-François L'Heureux, Mar 19, 2015 12:56 PM

Did you copy the Coveo.SearchProvider.config from the working server to the non working one? It seems your configured encrypted passwords cannot be decrypted on that server. Did you copy the encryption key on the new server as well ([DataFolder]\Coveo\ConfigurationEncryptionKeys)?

If not already present, each server will generate its own encryption key. Copying an encrypted password from a machine to another will not work if the encryption key is not the same on the servers.

Gravatar for jim.manson@roundedcube.com

Comment by jmanson, Mar 20, 2015 3:29 PM

The first server is only an application server with CES7/REST API and the second server is only a web server. Can you be more specific about the config information? I believe we did copy the file from the application server to ([DataFolder]\Coveo\ConfigurationEncryptionKeys) how can I verify this?

Gravatar for jim.manson@roundedcube.com

Comment by jmanson, Apr 6, 2015 8:54 AM

Little help here?

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Apr 6, 2015 11:24 AM

I see encryption errors in your logs. I believe you copied the Coveo.SearchProvider.config file from another environment to your test environment/web server. When doing so, you also need to copy the Coveo encryption key from the source instance to the destination instance because some XML elements of the Coveo.SearchProvider.config file are encrypted with the instance Coveo encryption key. On a new Coveo for Sitecore installation, a local Coveo encryption key is created and it is unique on each instance by default. The location of the key is [DataFolder]\Coveo\ConfigurationEncryptionKeys

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Apr 6, 2015 11:29 AM

This error can also happen if you deleted the Coveo encryption key from the file system after the installation of Coveo for Sitecore because Coveo for Sitecore will generate a new encryption key. This new key cannot be used to decrypt the passwords encrypted with the old key.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Apr 6, 2015 11:29 AM

In that case, you can set the passwords again from the "Coveo Search" section of the Sitecore Control Panel:

Gravatar for jim.manson@roundedcube.com

Comment by jmanson, Apr 16, 2015 5:05 PM

I do believe the config file may have come from a dev machine where everything is install on a single machine For our test environment CES is on a separate server and Sitecore is on a separate server. It sounds like you are saying I need to get the "keys in sync. That makes sense but I am not clear how to do that. Thank you for your help and assistance.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Apr 16, 2015 5:18 PM

Simply copy the [DataFolder]\Coveo\ConfigurationEncryptionKeys folder from the dev machine to the broken Sitecore instance data folder.

Gravatar for jim.manson@roundedcube.com

Comment by jmanson, Apr 17, 2015 11:37 AM

The dev machine have Coveo installed locally to the web server and works. It's when we are trying to move it to our test environment with separate servers that we have the issue. Do we just need to uninstall Coveo for Sitecore and then reinstall it directly on the test web server/Sitecore? I have tried coping the encryption keys fro the test CES server over to the [DataFolder]\Coveo\ConfigurationEncryptionKeys folder from the Test web server.

Gravatar for jim.manson@roundedcube.com

Comment by jmanson, Apr 17, 2015 11:38 AM

BTW I did go through the steps in the links you provided, no change.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Apr 17, 2015 11:41 AM

On your test environment, simply set the passwords again from the "Coveo Search" section of the Sitecore Control Panel as I suggested in a previous comment. It will encrypt your passwords with your test encryption key and you'll be fine.

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Apr 17, 2015 11:44 AM

Then please contact Coveo Support and provide:

  • A copy of your Dev environment Coveo.SearchProvider.config file.
  • A copy of your Dev environment [DataFolder]\Coveo\ConfigurationEncryptionKeys folder.
  • A copy of your Test environment Coveo.SearchProvider.config file.
  • A copy of your Test environment [DataFolder]\Coveo\ConfigurationEncryptionKeys folder.
Gravatar for jim.manson@roundedcube.com

Comment by jmanson, Apr 17, 2015 12:28 PM

When I look at the "Coveo for Sitecore components state" it looks like: Component Name State

Sitecore's Configuration Up and running
Coveo Pipeline Names Configuration Up and running
Admin Service Up and running Coveo Entreprise Search Up and running Coveo Search REST Endpoint () The remote server returned an error: (500) Internal Server Error.
Coveo Search Web Service The system cannot find the path specified.
Coveo Security Service The remote server returned an error: (500) Internal Server Error.
Coveo Security Provider Up and running RabbitMQ Up and running

Gravatar for jim.manson@roundedcube.com

Comment by jmanson, Apr 17, 2015 12:28 PM

Currently loaded Coveo configuration files (configuration files that contains Coveo in the name): Coveo.SearchProvider.config Coveo.SearchProvider.Licensing.config Coveo.SearchProvider.Rest.config Coveo.UI.Controls.config

Gravatar for jflheureux@coveo.com

Comment by Jean-François L'Heureux, Apr 17, 2015 1:12 PM

As I said earlier, please contact Coveo Support for more assistance on this problem. We'll need the files I asked you to provide to continue the investigation.

Ask a question