SIM error: Failed to update database "Symantec_CMDB" because the database is read-only
search cancel

SIM error: Failed to update database "Symantec_CMDB" because the database is read-only

book

Article ID: 240487

calendar_today

Updated On:

Products

IT Management Suite

Issue/Introduction

You are trying to migrate a copy of your current production database to a new SQL Server. While trying to switch to this copy of your database in SIM (Symantec Installation Manager), during the reconfiguration process, it failed:

Failure 2 during product configure:(exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Altiris.NS.Exceptions.AeXException: Failed to construct DatabaseContext object. Begin Transaction failed. ---> Altiris.NS.Exceptions.AeXException: Failed to construct DatabaseContext object. Begin Transaction failed. ---> System.Data.SqlClient.SqlException: Failed to update database "Symantec_CMDB" because the database is read-only.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at Altiris.Database.DatabaseContext`1.ExecuteScalar[TR](String sql, Object[] args)
   at Altiris.Database.DatabaseContext`1.BeginTransaction(IsolationLevel isolationLevel)
   at Altiris.Database.DatabaseContext`1.Initialize(Boolean beginTransaction, IsolationLevel isolationLevel)
   --- End of inner exception stack trace ---
   at Altiris.NS.ContextManagement.AdminDatabaseContext.ThrowGeneralException(String exceptionDetails, Exception innerException)
   at Altiris.Database.DatabaseContext`1.Initialize(Boolean beginTransaction, IsolationLevel isolationLevel)
   at Altiris.Database.DatabaseContext`1.CreateFirstContext(ContextTransactionMode tmode, Nullable`1 isolationLevel, DatabaseContextStack currentStack, Boolean trans)
   at Altiris.Database.DatabaseContext`1.GetContextImpl(ContextTransactionMode tmode, Nullable`1 isolationLevel, Boolean independentContext)
   at Altiris.Database.DatabaseContext`1.GetContext(ContextTransactionMode tmode, Nullable`1 isolationLevel, Boolean independentContext)
   at Altiris.Database.DatabaseContext`1.RetryActionRequest.DefaultGetContext()
   at Altiris.Database.DatabaseContext`1.RetryActionRequest.Perform(Boolean throwIfRetriedOut)
   at Altiris.Database.DatabaseContext`1.PerformWithDeadlockRetryHelper(Int32 retries, Int32 retryDelay, Boolean outerTransaction, Getter`1 getContext, Action`1 action, Action`1 retry, Boolean selfTransaction, String deadlockMessage, String category)
   at Altiris.NS.Utilities.AppIdentity.EnsureAppIdentityCredential(String sUserName, SecurityIdentifier sid, RoleResource& adminRole)
   at Altiris.NS.Utilities.AppIdentity.PrepareAppIdentityResource(String sUserName, RoleResource& adminRole)
   at Altiris.NS.Utilities.AppIdentity.SetApplicationId(String sUserName, String sPassword)
   --- End of inner exception stack trace ---
   at Altiris.NS.Utilities.AppIdentity.SetApplicationId(String sUserName, String sPassword)
   at Altiris.NS.Installation.ServiceConfiguration.ConfigureServices(String username, String userpassword)
   --- End of inner exception stack trace ---
   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 ReflectionProxy.ReflectionProxy.ConfigureServices(InstallationCredential credentials)
   at SyncInvokeConfigureServices(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.ProcessMessage11(MessageRpc& rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)). Trying again in 20 seconds....
-----------------------------------------------------------------------------------------------------
Date: 4/22/2022 4:42:46 AM, Tick Count: 102964265 (1.04:36:04.2650000), Size: 5.38 KB
Process: SymantecInstallationManager (6544), Thread ID: 52, Module: SymantecInstallationManager.exe
Priority: 4, Source: Symantec.Installation.ConfigureNS.task_Completed

Then, SIM tries to roll back to the previous database reference but the SMP Server stays as misconfigured.

Environment

ITMS 8.x

Cause

This message "Failed to update database "Symantec_CMDB" because the database is read-only" actually is referring to SIM trying to rollback to the previous SQL Server but since the customer already had set the original database to read-only, then SIM fails.

Resolution

Don't set the original database to "Read-Only". Set the original database in normal mode (not making read-only mode).