FortiClient
FortiClient proactively defends against advanced attacks. Its tight integration with the Security Fabric enables policy-based automation to contain threats and control outbreaks. FortiClient is compatible with Fabric-Ready partners to further strengthen enterprises’ security posture.
MZBZ
Staff
Staff
Article Id 365745
Description

This article explains a workaround for some cases of failed FortiClient EMS upgrades to v7.2.7+, where the Microsoft SQL server needs to be upgraded to SQL 2022 Express from SQL 2017 Express.

In some instances, the SQL upgrade is not successful, causing the EMS upgrade to fail. The issue is due to the SQL installer not being able to correctly locate the required OLE and ODBC drivers. A possible workaround for some of these cases is provided in this article.

Scope FortiClient EMS v7.2.
Solution

This issue can happen during manual installation with GUI or silent background installation. During a manual installation, an error similar to this picture is shown:

 

EMS_Failed_install_Error.JPG

 

Checking the EMS installation logs shows these error lines: 

 

21FC:1BF4][2024-11-27T13:36:04]i301: Applying execute package: sql_server, action: Install, path: C:\ProgramData\Package Cache\F52C72AC20994DE663F63977987BE0A6A1095A57\SqlServerInstaller.exe, arguments: '"C:\ProgramData\Package Cache\F52C72AC20994DE663F63977987BE0A6A1095A57\SqlServerInstaller.exe" WixBundleAction=5 SQLCmdlineOptions="/INSTANCENAME=FCEMS" TempFolder=C:\Users\ADMINI~1\AppData\Local\Temp\2\'
[21FC:1BF4][2024-11-27T13:40:28]e000: Error 0x84bb0001: Process returned error: 0x84bb0001
[21FC:1BF4][2024-11-27T13:40:28]e000: Error 0x84bb0001: Failed to execute EXE package.
[3DD8:18C4][2024-11-27T13:40:28]e000: Error 0x84bb0001: Failed to configure per-machine EXE package.
[3DD8:18C4][2024-11-27T13:40:28]i319: Applied execute package: sql_server, result: 0x84bb0001, restart: None
[3DD8:18C4][2024-11-27T13:40:28]e000: Error 0x84bb0001: Failed to execute EXE package.
[21FC:1BF4][2024-11-27T13:40:28]i329: Removed package dependency provider: 1.0.0.0-100.0.0.0, package: sql_server
[21FC:1BF4][2024-11-27T13:40:28]i351: Removing cached package: sql_server, from path: C:\ProgramData\Package Cache\F52C72AC20994DE663F63977987BE0A6A1095A57\
[21FC:1BF4][2024-11-27T13:40:29]i326: Removed dependency: {2675a747-ea2d-45e2-a369-1c9303282c48} on package provider: {AD34D250-2127-48E7-B29A-618E65533F77}, package FortiClientEnterpriseManagementServerUninstallCleanup.msi
[21FC:1BF4][2024-11-27T13:40:29]i329: Removed package dependency provider: {AD34D250-2127-48E7-B29A-618E65533F77}, package: FortiClientEnterpriseManagementServerUninstallCleanup.msi
[21FC:1BF4][2024-11-27T13:40:29]i351: Removing cached package: FortiClientEnterpriseManagementServerUninstallCleanup.msi, from path: C:\ProgramData\Package Cache\{AD34D250-2127-48E7-B29A-618E65533F77}v7.2.7.1117\
[21FC:1BF4][2024-11-27T13:40:29]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2675a747-ea2d-45e2-a369-1c9303282c48}, resume: None, restart: None, disable resume: No
[21FC:1BF4][2024-11-27T13:40:29]i330: Removed bundle dependency provider: {2675a747-ea2d-45e2-a369-1c9303282c48}
[21FC:1BF4][2024-11-27T13:40:29]i352: Removing cached bundle: {2675a747-ea2d-45e2-a369-1c9303282c48}, from path: C:\ProgramData\Package Cache\{2675a747-ea2d-45e2-a369-1c9303282c48}\
[21FC:1BF4][2024-11-27T13:40:29]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2675a747-ea2d-45e2-a369-1c9303282c48}, resume: None, restart initiated: No, disable resume: No
[3DD8:18C4][2024-11-27T13:40:29]i399: Apply complete, result: 0x84bb0001, restart: None, ba requested restart: No

 

Further investigating SQL installation logs located inside 'C:\Program Files\Microsoft SQL Server\160\Setup Bootstrap' shows these error lines:

 

[3CFC:1834][2024-12-16T19:16:47]i301: Applying execute package: sql_server, action: Install, path: C:\ProgramData\Package Cache\EDE75CFAD94443937DA170A12AF799F4B9B55DC0\SqlServerInstaller.exe, arguments: '"C:\ProgramData\Package Cache\EDE75CFAD94443937DA170A12AF799F4B9B55DC0\SqlServerInstaller.exe" WixBundleAction=5 SQLCmdlineOptions="/INSTANCENAME=FCEMS" TempFolder=C:\Users\ADMINI~1\AppData\Local\Temp\'
[3CFC:1834][2024-12-16T19:18:42]e000: Error 0x84bc06aa: Process returned error: 0x84bc06aa
[3CFC:1834][2024-12-16T19:18:42]e000: Error 0x84bc06aa: Failed to execute EXE package.
[1018:03A8][2024-12-16T19:18:42]e000: Error 0x84bc06aa: Failed to configure per-machine EXE package.
[1018:03A8][2024-12-16T19:18:42]i319: Applied execute package: sql_server, result: 0x84bc06aa, restart: None
[1018:03A8][2024-12-16T19:18:42]e000: Error 0x84bc06aa: Failed to execute EXE package.

 

  1. If EMS is running as a virtual machine (VM), take a snapshot of the VM.
  2. Create a full DB backup of the EMS and copy it to a safe place other than the current EMS server under EMS Web UI -> Dashboard -> Status -> Database: Backup (the password is required for restoring this backup!)

 

Stop here before proceeding to the next steps and create the snapshot and backup. This is critically important.

 

The following guide is for upgrading SQL 2017 EXPRESS to SQL 2022 EXPRESS. If the EMS SQL database is a standard or enterprise edition, the SQL upgrade must be done to a matching non-Express edition. If EMS is using a remote database or a non-Express SQL database, it is recommended to manually upgrade EMS (if required from the CLI) before the autograde kicks in.

 

To check SQL server version and edition:

 

SQLCMD -S .\fcems -Q "SELECT @@VERSION"

SQLCMD -S .\fcems -Q "SELECT SERVERPROPERTY('Edition') AS 'Edition'"

 

SQL VERSION.png

 

All the following installations must be done as an administrator using a local or domain admin account, 'right-click', and run as administrator.

 

  1. Manually download and install Microsoft Visual C++ Redistributable (both X86 and X64) from one of the following and reboot the server:
    https://aka.ms/vs/17/release/vc_redist.x86.exe
    https://aka.ms/vs/17/release/vc_redist.x64.exe
  2. Open Windows Program and Features using appwiz.cpl, uninstall everything related to ODBC{17-18-19} and OLE and reboot the server. Do NOT uninstall ODBC13 or ODBC11.
  3. Manually download and install ODBC17 (x64) and OLE18 (x64) from the direct Microsoft links and reboot the server.
    ODBC 17.10.6.1: https://go.microsoft.com/fwlink/?linkid=2266337
    OLE DB 18.7.4: https://go.microsoft.com/fwlink/?linkid=2278907

During the installation of these drivers, both 'Client Components' and 'Driver for SQL Server SDK' should be enabled on the Feature Selection page.

 

Feature Select.png

 

Installed Versions.png

 

  1. After the reboot, the current EMS server should be up and running. Web UI should be accessible and all services running normally.

Note:

MS SQL Server 2022 requires Microsoft .NET Framework 4.7.2. If this is not installed on the EMS Windows Sever, it should be manually downloaded and installed from here.

 

EMS Services.png

 

  1. Create another server snapshot at this point.
  2. Run the EMS installer as administrator and wait for the upgrade. If the upgrade failed, restore to the snapshot created in step 7 and proceed to the next steps.
  3. Download SQL Server 2022 Express from the Microsoft website: Download Microsoft® SQL Server® 2022 Express from Official Microsoft Download Center
  4. Run the Microsoft SQL Express 2022 installer > Download Media > Express Advanced > Set the download location > Download. A file of around 500 MB is downloaded.
  5. Launch the downloaded installer from step 10. During the installation, select Upgrade from a previous version of SQL -> Next -> Accept the license -> Next. In the Select Instance page, ensure that EMS is detected and selected. Select 'Next', and wait 10-20 minutes for the upgrade to complete. When complete, reboot the server and confirm access to the EMS GUI and the connected FortiClient endpoints.
  6. (Optional but recommended) Create another VM snapshot.
  7. Run the EMS v7.2.7 installer as administrator to perform the upgrade. The upgrade skips the database upgrade/install phase and proceeds directly to upgrade EMS to 7.2.7. Confirm access to the EMS GUI and the connected FortiClient endpoints.
  8. Reboot the server. Confirm access to the FortiClient EMS GUI and the connected FortiClient endpoints.
  9. If the upgrade fails again, contact Fortinet TAC and attach the following files to the ticket.
  • EMS installer logs which are created and located next to the installer executable file.
  • Compressed content of %temp%
  • Compressed content of c:\Program Files\Microsoft SQL Server\160\Setup Bootstrap\
  • Run the following commands in a terminal window (CMD) and share a screenshot of the terminal window and a text copy of the printout.: c:\Program Files (x86)\Fortinet\FortiClientEMS\EMSDiagnosticTool.exe (If the Diagnostic report file is generated, please find it in %temp% and attach it to the ticket.)
  • Run the following commands in a terminal window (CMD) and share the screenshot of the terminal window and a text copy of the printout. SQLCMD -S .\fcems -Q "SELECT name, collation_name FROM sys.databases"
  • A screenshot of Run > appwiz.cpl with all the columns visible and expanded to fit the content.
  • A screen shot of Run > odbcad32 > Drivers with all the columns visible and expanded to fit the content.

 

SQLCMD.png

 

DiagTool.png

 

ODBCAD32.png

 

Additional Notes:

 

If the sqlcmd command returns the error message ‘Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server: Data source name not found and no default driver specified,’ a quick workaround is to duplicate one of the directories named '170', '160', or '130' inside 'C:\Program Files\Microsoft SQL Server\Client SDK\ODBC' (should have the SQLCMD.EXE file under \Tools\Binn\) and rename the duplicate to '110'. This will allow the EMS installer to access the sqlcmd binary and complete the installation. However, it is strongly recommended to back up the database after the EMS upgrade and restore it on a fresh Windows + EMS installation, as this error message indicates an unhealthy Windows environment.

 

EMS minimum system requirements:

 

Note that the EMS operating system requirement has changed with v7.2.x releases:

 

If the upgrade (automated or manual) is performed on an unsupported OS, it will fail. The only supported solution is to install the same EMS version on a supported operating system and restore the EMS database backup (created from the old EMS web UI) on this new installation.

 

After restoring the EMS database, a manual EMS (and SQL) upgrade can be performed. Note that the EMS database backup is version-sensitive, and the source and destination versions of the database backup must match exactly.

 

Installing Microsoft .Net framework 4.7.2 on a Windows Server 2016 could allow upgrading SQL and EMS. However, this is not supported by Fortinet Tech Support and should be done for temporary recovery purposes before moving to a supported Windows Server edition.


Related documents: