Cannot Open ProcessManager Portal on Server after Sitting Idle for A Year

book

Article ID: 170482

calendar_today

Updated On:

Products

ServiceDesk

Issue/Introduction

Customer restored a snapshot of their production Servicedesk Server and database that was approximately twelve months old. After the restore, when attempting to login to the ProcessManager portal the error below was displayed. [CryptographicException: Bad Data.]
System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr) +41
System.Security.Cryptography.Utils._DecryptData(SafeKeyHandle hKey, Byte[] data, Int32 ib, Int32 cb, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode PaddingMode, Boolean fDone) +0
System.Security.Cryptography.CryptoAPITransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) +442
System.Security.Cryptography.CryptoStream.FlushFinalBlock() +51
System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing) +48
System.IO.Stream.Close() +26
LogicBase.Framework.EncryptionHelper.DecryptByteArray(Byte[] key, Byte[] value, SymetricalCryptographyTypes type) +741
LogicBase.Framework.EncryptionHelper.DecryptString(Byte[] key, Byte[] value, SymetricalCryptographyTypes type) +14
LogicBase.Ensemble.Settings.DataLayer.SettingsHelper.DecryptPassword(String encryptedSmtpPassword) +143
LogicBase.Ensemble.Settings.DataLayer.SettingsHelper.GetSettings() +344
LogicBase.Ensemble.Settings.EnsembleSettings.get_Settings() +86
LogicBase.Ensemble.GlobalHelper.InitializeGlobal() +18

[TypeInitializationException: The type initializer for 'LogicBase.Ensemble.Global' threw an exception.]
LogicBase.Ensemble.Global..ctor() +0
ASP.global_asax..ctor() +9

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +146
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +298
System.Activator.CreateInstance(Type type, Boolean nonPublic) +79
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +10366811
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +258
System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext context) +11397553
System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext context) +161
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +115
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +196

Cause

Note the highlighted section of the error message.  The proper cryptography algorithm was not longer present to interpret the password stored in the database for the mastersettings SMTP account and password.

Environment

Servicedesk 7.5.3001.112

Resolution

The Servicedesk database requires an edit to the MasterSettings table.   Run the following SQL:
 
Update MasterSettings
Set [UserName] = NULL
Set [UserPassword] = NULL

Restart the services and you should be able to log into the portal.