This knowledge base article addresses two distinct but common issues that can cause SQL database backup failures, particularly after a Druva agent upgrade, resulting in the error "The system cannot find the file specified" (WindowsError: [Error 2]).
Problem Description
A Druva agent upgrade to version v7.0.6::r807653 on a Microsoft SQL Server (e.g., IITSQL) causes backups for a specific database (e.g., KnowBe4) to fail during the discovery and component processing phase with an SQL74 error.
The customer confirms:
Sufficient disk space.
No scheduled maintenance activities were running.
The Druva agent and necessary services are running.
Server reboot did not resolve the issue.
The detailed error message indicates the failure is due to an inability to locate the physical data file for the database, and the root cause may be one of two scenarios: a physically missing/moved file, or a VSS incompatibility due to a trailing space in the database name.
Cause 1: Missing or Moved Physical Database File
The SQL Server's internal system catalogs contain a file path that does not match the actual location of the physical data file (KnowBe4.mdf). The backup agent relies on the SQL Server VSS Writer to report the location of all database files. If the writer reports an incorrect or non-existent path, the underlying Windows VSS system and the backup agent cannot locate the file for snapshot creation.
Traceback (Example):
Summary of Issue
The backup process is consistently failing during the discovery and component processing phase due to an inability to locate the physical data file for the database named KnowBe4.
Specific Error Message: WindowsError: [Error 2] The system cannot find the file specified: u'S:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\KnowBe4.mdf'
Conclusion: The database metadata is present in the SQL Server, but the corresponding physical data file (KnowBe4.mdf) is either missing from the S: drive or has been moved, preventing the backup process from completing.
Cause 2: Trailing Space in the Database Name
SQL Server allows databases to be created with trailing spaces (e.g., KnowBe4 ), but the underlying Windows Operating System (OS) and the Volume Shadow Copy Service (VSS) framework do not recognize or process file paths that end with a literal space.
The updated Druva agent (v7.0.6::r807653) may include stricter validation checks for VSS best practices. This compliant logic now correctly identifies the non-standard trailing space provided by the SQL VSS Writer, exposing the platform incompatibility that existed but was not previously enforced.
Consequence: The VSS system fails to locate the physical file due to the mismatched file path, leading to the SQL VSS Writer becoming unstable or unresponsive, which in turn causes the backup to fail.
Resolution
A resolution must be implemented on the IITSQL server by the Database Administrator (DBA) team, depending on the identified cause.
Resolution for Cause 1: Validate and Correct File Paths
Check the Current Registered Path:
Execute the following T-SQL query in SQL Server Management Studio (SSMS) to list all databases and their file paths:
SQL
SELECT
d.name AS DatabaseName,
f.name AS LogicalName,
f.physical_name AS PhysicalName,
f.type_desc AS TypeofFile
FROM
sys.master_files f
INNER JOIN
sys.databases d ON d.database_id = f.database_id;
Compare and Verify:
Find the row for the KnowBe4 database.
Manually verify the path listed in the PhysicalName column (e.g., S:\Program Files\...\KnowBe4.mdf) in Windows File Explorer.
Action: If the file is physically located elsewhere, the database files must be moved and their paths updated in the SQL Server system catalogs using the ALTER DATABASE ... MODIFY FILE command, or the database must be detached and re-attached with the correct physical paths.
Note: UNC paths (e.g., \\server_name\share\db.mdf) are generally not supported for primary data files and will cause VSS-based backup failures.
Resolution for Cause 2: Remove Trailing Spaces from Database Name
Identify Problematic Databases:
Run the following T-SQL query in SSMS to find database names with leading or trailing spaces. The ## markers will help visually confirm spaces.
SQL
SELECT
'##' + name + '##' AS DatabaseNameWithMarkers
FROM
sys.databases
WHERE
name LIKE '% ' OR name LIKE ' %';
Look for names where the markers are not flush, e.g., ##KnowBe4 ##.
Rename the Database:
Use the ALTER DATABASE ... MODIFY NAME command to remove the trailing space. You must use square brackets to reference the old name, including the space.
SQL
-- Replace [DatabaseNameWithTrailingSpace ] with the actual name including the space
-- Replace [DatabaseNameWithoutSpace] with the new, clean name
ALTER DATABASE [KnowBe4 ]
MODIFY NAME = [KnowBe4];
Verification
Check SQL Writer Status:
Open an Administrator Command Prompt and run:
vssadmin list writers
Ensure the SqlServerWriter is listed and its State is Stable.Re-run Backup Job:
Trigger the Druva backup job for the IITSQL server. The backup should now proceed past the discovery and component processing phase and complete successfully.
See Also
