Skip to content

Troubleshooting AttachingDatabases

Dmitry Kolinchuk edited this page Nov 17, 2023 · 2 revisions

← Troubleshooting

Troubleshooting - Installation fails while Attaching databases processor

Log File

#!txt

  13 11:50:55,374 ERROR Processor execution failed. Database 'sitecore65cSitecore_core' cannot be upgraded because it is read-only, has read-only files or the user does not have permissions to modify some of the files. Make the database or files writeable, and rerun recovery.

  12 15:51:34,052 ERROR Processor of type 'SIM.Pipelines.Install.AttachDatabases' (a part of the 'install' pipeline) failed. Unable to open the physical file "C:\inetpub\wwwroot\sc70\Databases\Sitecore.core.mdf". Operating system error 5: "5(Access is denied.)".
System.Data.SqlClient.SqlException (0x80131904): Unable to open the physical file "C:\inetpub\wwwroot\sc70\Databases\Sitecore.core.mdf". Operating system error 5: "5(Access is denied.)".
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.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.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at SIM.Adapters.SqlServer.SqlServerManager.Execute(SqlConnection sqlConnection, String command, Nullable`1 executionTimeout)
   at SIM.Adapters.SqlServer.SqlServerManager.AttachDatabase(String name, String path, SqlConnectionStringBuilder connectionString, Boolean attachLog)
   at SIM.Pipelines.Install.AttachDatabasesHelper.AttachDatabase(String name, String databasesFolderPath, ConnectionString connectionString, SqlConnectionStringBuilder defaultConnectionString, IPipelineController controller)
   at SIM.Pipelines.Install.AttachDatabases.Process(InstallArgs args)
   at SIM.Pipelines.Install.InstallProcessor.Process(ProcessorArgs args)
   at SIM.Pipelines.Processors.Processor.Execute(ProcessorArgs args)
ClientConnectionId:9e2c4921-da57-4116-9284-14dedc06f8f4

Cause

SQL Server cannot modify the database file due to insufficient access rights to the file/folder.

Solution

  1. Find out what user account is used by that SQL Server instance.
  2. Verify that the user account (typically it is NETWORK SERVICE) has full access rights Full control to your Instances Root folder (typically it is C:\inetpub\wwwroot) and to the database .MDF file.