Unable to install Database - Due to previous Enterprise Console database not being accessible

  • Article ID: 118900
  • Rating:
  • 1 customers rated this article 6.0 out of 6
  • Updated: 04 Apr 2013

Issue

Upgrade to Enterprise Console 5.2 fails populating the new database. The error message displayed by the installer is:

Unable to install Database
A custom action failed.

The log file: 'Sophos_InstallCoreDB.log' ('C:\ProgramData\Sophos\Management Installer\') has similar text to that shown below (file paths and SQL instance name may differ):

Upgrade ...

Msg 5120, Level 16, State 101, Server ComputerName\SOPHOS, Procedure FromSCC4, Line 24

Unable to open the physical file "C:\Program Files\Microsoft SQL Server\MSSQL$SOPHOS\Data\SOPHOS4.mdf". Operating system error 2: "2(The system cannot find the file specified.)".

File activation failure. The physical file name "C:\Program Files\Microsoft SQL Server\MSSQL$SOPHOS\Data\SOPHOS4_log.LDF" may be incorrect.

Msg 945, Level 14, State 2, Server ComputerName\SOPHOS, Procedure FromSCC4, Line 24

Database 'SOPHOS4' cannot be opened due to inaccessible files or insufficient memory or disk space. See the SQL Server errorlog for details.

Note: For a list of databases per version of Enterprise Console see article 17323.

First seen in

Enterprise Console 5.2.0

Cause

Previous Sophos database(s) are referenced in the SQL Server instance but the data and or log files do not exist on disk or cannot be accessed during the upgrade.

In the above example, the failure occurred when running Upgrade.sql as part of the database component upgrade.  The specific line that failed to execute in this case was:

IF NOT EXISTS(SELECT * FROM [SOPHOS4].[dbo].[LatestData] WHERE DataSource = 'ProductAndVersionString' AND Data LIKE N'com.sophos\mansys\applogic\SCC\4.0')

This failed due to the SOPHOS4 database not being accessible, although referenced in the SQL Server instance.

What To Do

  1. Click "Finish" in the Enterprise Console 5.2 installer if still running with the error on screen.
  2. Determine that the issue is that as described in this article by consulting the log file 'Sophos_InstallCoreDB.log', verifying it contains the message detailed in the 'Issue' section above.
    • Windows 2008+: C:\ProgramData\Sophos\Management Installer\Sophos_InstallCoreDB.log
    • Windows 2003: C:\Documents and Settings\All Users\application data\Sophos\Management Installer\Sophos_InstallCoreDB.log

    Note: Check that the timestamp at the start of the file is from the failed upgrade.

  3. Running the following command should enable you to check that the files of each database exist as physical files
    For the above example, SOPHOS4 would be the database that should be checked to ensure SOPHOS4.mdf and SOPHOS4_log.ldf exist.

    sqlcmd.exe -E -S .\SOPHOS -Q "select name, filename from sysdatabases"

    Note: In this example, the command is connecting to a local SOPHOS names SQL Server instance.  If your instance is different see article 113030 to determine the instance in use.  Future sqlcmd.exe commands in this article will use the same default SOPHOS instance name and should be changed accordingly.

  4. Drop the previous Sophos database, e.g. SOPHOS4 by name:
    sqlcmd -E -S .\sophos -Q "DROP DATABASE SOPHOS4"

  5. Drop the incomplete SOPHOS52 database:
    sqlcmd -E -S .\sophos -Q "DROP DATABASE SOPHOS52"

    Note: If you attempt to run the installer again at this point you will get the error:
    The server cannot be upgraded.  The database must be upgraded first.

  6. Run the following command to create the new databases:

    32-bit Computer
    msiexec /i"C:\sec_52\ServerInstaller\Database32.msi" DATABASE_SERVERNAME="(local)\SOPHOS" DATABASE_USERNAME="SophosManagement" DATABASE_USERNAMEDOMAIN="Domain" INSTALLDIR="C:\Program Files\Sophos" 

    64-bit Computer
    msiexec /i"C:\sec_52\ServerInstaller\Database64.msi" DATABASE_SERVERNAME="(local)\SOPHOS" DATABASE_USERNAME="SophosManagement" DATABASE_USERNAMEDOMAIN="Domain" INSTALLDIR="C:\Program Files (x86)\Sophos" 

    Note: Adjust the properties as required for your installation.  

    Tip: Values for the DATABASE_USERNAME and DATABASE_USERNAMEDOMAIN can be found under the registry key: 
    • 64-bit server: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Sophos\EE\Management Tools\DatabaseUser\
    • 32-bit server:
      HKEY_LOCAL_MACHINE\SOFTWARE\Sophos\EE\Management Tools\DatabaseUser\
  7. In 'Add or Remove Programs' or 'Programs and Features' (appwiz.cpl), uninstall the 'Sophos Management Database' [5.2] entry.

    Note: This is required as the installer will detect the installation as having different versions of the components and link to article 118083. This component will be added back later after upgrading of the remaining components.

  8. Re-run 'C:\sec_52\ServerInstaller\setup.exe' to initiate the upgrade of the remaining installed components (Management Server and Management Console).  Restarting the computer if requested.

  9. Close Enterprise Console before continuing should it open.
  10. To add the 5.2 Database component to the machine without touching the now upgraded database run the command:

    32-bit Computer
    msiexec /i"C:\sec_52\ServerInstaller\Database32.msi" DATABASE_SERVERNAME="(local)\SOPHOS" DATABASE_USERNAME="SophosManagement" DATABASE_USERNAMEDOMAIN="Domain" INSTALLDIR="C:\Program Files\Sophos" CREATE_DATABASES=0

    64-bit Computer
    msiexec /i"C:\sec_52\ServerInstaller\Database64.msi" DATABASE_SERVERNAME="(local)\SOPHOS" DATABASE_USERNAME="SophosManagement" DATABASE_USERNAMEDOMAIN="Domain" INSTALLDIR="C:\Program Files (x86)\Sophos" CREATE_DATABASES=0

  11. The upgrade is complete, all 3 components have been upgraded to version 5.2.

 
If you need more information or guidance, then please contact technical support.

Rate this article

Very poor Excellent

Comments