This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Enterprise Console Server to Server Migration - Cannot open database "SOPHOSPATCH52" requested by the login. The login failed.

Hi,

I'm trying to migrate my Sophos Enterprise Console (5.5) from one server to another (Windows Server 2008 R2 Standard to Windows Server 2012 R2 Standard). I have followed the 5.5 Sophos Enterprise Console server to server migration guide and got as far as 11.1 where I am starting services. 'Sophos Patch Endpoint Communicator', 'Sophos Patch Endpoint Orchestrator' and 'Sophos Patch Server Communicator' hang on starting.

Event Viewer reveals that the service account cannot open the SQL database however, I am 99% sure permissions are correct. Apart from being identical to the setup on the old server, the service account is a member of the local 'Sophos DB Admins' which has access to the SQL database. The service account has 'Logon as as a service' rights in the Local Security Policy. I've double checked it has the right password. I've triple checked the migration guide and the registry keys, it's definitely pointing to the new server. Everything indicates to me that this account should have no problem connecting to the database, yet it can't. I'm just not convinced it's a Windows permissions or SQL error.

Here's the event viewer entry:


PID 8424 : TID 4
Error fetching upgrade status.
-- System Exception Details --
Message: Cannot open database "SOPHOSPATCH52" requested by the login. The login failed.
Login failed for user '[domain]\[username]'.
Type: SqlException
Source: .Net SqlClient Data Provider
Target: Boolean TryGetConnection(System.Data.Common.DbConnection, UInt32, Boolean, Boolean, System.Data.Common.DbConnectionOptions, System.Data.ProviderBase.DbConnectionInternal ByRef)
Stack Trace:
 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
 System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
 System.Data.SqlClient.SqlConnection.Open()
 Sophos.SC.Core.UpgradeHelper.QueryDatabase(String connectionString)
 Sophos.SC.Core.UpgradeHelper.WaitForUpgradeCompleteStatus(Int32 loggingClassId)


 Login failed for user '[domain]\[username]'. Reason: Failed to open the explicitly specified database 'SOPHOSPATCH52'. [CLIENT: <local machine>]




This thread was automatically locked due to age.
  • Hello Ron Bishop,

    which service (PID 8424) generated the event?
    Please check the SophosPatchConnectionString value of the key HKLM\SOFTWARE\Sophos\Patch\. For a local database it's Data Source=(local)\SOPHOS;Initial Catalog=SOPHOSPATCH52;Integrated Security=SSPI;Connect Timeout=60.

    Christian

  • That was the "Sophos Patch Endpoint Communicator" service.

    That reg key was the problem. It was pointing to the name of the SQL instance on the old server. Thank you.

    Couldn't find any mention of this key in the migration guide. Perhaps someone should add it?

  • Hello Rob Bishop,

    [no] mention of this key
    because in a vanilla installation with a local database (as written in chapter 3) the value is (local)\SOPHOS on all instances (and bitness doesn't matter). Even under these assumptions variations are possible and a guide that covers all scenarios would be quite voluminous (and unusable as "beginner" guide).

    Christian