Missing Permissions Cause: exception.db.mssqlstagingdb.backup.read.header.failed (KBA5399)
KBA
KBA# 5399
Issue
It is possible to experience this issue while linking a SQL Server dSource and/or a Delphix Managed Backup. The following error example is from linking a Delphix Managed Backup:
Error For dSource "ODSTEST", failed to read the backup header at position "1" in backup file "C:\Program Files\Delphix\DelphixConnector\555-555-555-555-staging-##\TEMP\dlpx_TEMP\dlpxCopyOnlyFullBackup.dlpxbak" using the RESTORE HEADERONLY command. Error Code exception.db.mssqlstagingdb.backup.read.header.failed Suggested Action Make sure a valid backup file is present at the backup location, the instance owner "FROG\SASQL" has permissions to read the backup file and inspect the backup headers with the RESTORE HEADERONLY command for correctness and try the operation again. Command Output Changed database context to 'master'. Msg 262, Level 14, State 1, Server TST-SQL-DB-3, Line 1 CREATE DATABASE permission denied in database 'master'. Msg 3013, Level 16, State 1, Server TST-SQL-DB-3, Line 1 RESTORE HEADERONLY is terminating abnormally. Msg 50000, Level 11, State 127, Server TST-SQL-DB-3, Line 3 error_restore_headeronly die : Error: SQLCMD_FAILED At C:\Program Files\Delphix\DelphixConnector\555-555-555-555-staging-##\SCRIPT\RestoreBackupHeader.wrap.ps1:26 char:12 + die <<<< "$($args[0])" + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,die
If the error occurs with SQL Server native backups, the error is similar on the failed action:
Run SnapSync for database "SourceDB3". Error For dSource "SourceDB3", failed to read the backup header at position "1" in backup file "\\10-11-11-111\Backups\srcdb2_071320_1149_full.bak" using the RESTORE HEADERONLY command. Error Code exception.db.mssqlstagingdb.backup.read.header.failed Suggested Action Make sure a valid backup file is present at the backup location, the instance owner "ad\SQLServerUser" has permissions to read the backup file and inspect the backup headers with the RESTORE HEADERONLY command for correctness and try the operation again. Command Output Changed database context to 'master'. Msg 262, Level 14, State 1, Server 10-11-11-111\SQL2014, Line 1 CREATE DATABASE permission denied in database 'master'. Msg 3013, Level 16, State 1, Server 10-11-11-111\SQL2014, Line 1 RESTORE HEADERONLY is terminating abnormally. Msg 50000, Level 11, State 127, Server 10-11-11-111\SQL2014, Line 3 error_restore_headeronly die : Error: SQLCMD_FAILED At E:\Delphix\DelphixConnector\88888888-8888-8888-8888-888888888888-staging-19\SCRIPT\RestoreBackupHeader.wrap.ps1:26 char:12 + die <<<< "$($args[0])" + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,die
Applicable Delphix Versions
- Click here to view the versions of the Delphix engine to which this article applies
-
Major Release All Sub Releases 6.0 6.0.0.0, 6.0.1.0, 6.0.1.1, 6.0.2.0 5.3
5.3.0.0, 5.3.0.1, 5.3.0.2, 5.3.0.3, 5.3.1.0, 5.3.1.1, 5.3.1.2, 5.3.2.0, 5.3.3.0, 5.3.3.1, 5.3.4.0, 5.3.5.0 5.3.6.0, 5.3.7.0, 5.3.7.1, 5.3.8.0, 5.3.8.1, 5.3.9.0 5.2
5.2.2.0, 5.2.2.1, 5.2.3.0, 5.2.4.0, 5.2.5.0, 5.2.5.1, 5.2.6.0, 5.2.6.1
5.1
5.1.0.0, 5.1.1.0, 5.1.2.0, 5.1.3.0, 5.1.4.0, 5.1.5.0, 5.1.5.1, 5.1.6.0, 5.1.7.0, 5.1.8.0, 5.1.8.1, 5.1.9.0, 5.1.10.0
5.0
5.0.1.0, 5.0.1.1, 5.0.2.0, 5.0.2.1, 5.0.2.2, 5.0.2.3, 5.0.3.0, 5.0.3.1, 5.0.4.0, 5.0.4.1 ,5.0.5.0, 5.0.5.1, 5.0.5.2, 5.0.5.3, 5.0.5.4
4.3
4.3.1.0, 4.3.2.0, 4.3.2.1, 4.3.3.0, 4.3.4.0, 4.3.4.1, 4.3.5.0
4.2
4.2.0.0, 4.2.0.3, 4.2.1.0, 4.2.1.1, 4.2.2.0, 4.2.2.1, 4.2.3.0, 4.2.4.0 , 4.2.5.0, 4.2.5.1
4.1
4.1.0.0, 4.1.2.0, 4.1.3.0, 4.1.3.1, 4.1.3.2, 4.1.4.0, 4.1.5.0, 4.1.6.0
Resolution
Following our documentation regarding Windows database and OS users, under the Windows User Requirements section, https://docs.delphix.com/docs/datasets/sql-server-environments-and-data-sources/sql-server-support-and-requirements/sql-server-user-requirements#SQLServerUserRequirements-WindowsUserRequirements, add the sysadmin server role to the Delphix Windows Environment user (OS user) shown in the screen shot below:
If the Delphix OS user has this permission, please check the same for the SQL Server instance owner, if different from the OS user. If the instance owner does not have the sysadmin server role, you should expect the same failure.
Troubleshooting
Navigate to the login properties for the Delphix OS user and verify that sysadmin has been checked off.
If the backup file is for SQL Server native backups (not Delphix managed backup), you can run the following SQL command from a SSMS query window, logged in as the Delphix OS, providing the correct path. Copy the file path and name from the Delphix error message.
RESTORE HEADERONLY FROM DISK =' \\10-11-111-111\Backups\srcdb2_071320_1149_full.bak'
GO
This helps to understand the issue, especially if it is permissions related.
Results if the Delphix OS user does not have the server role sysadmin:
Msg 262, Level 14, State 1, Line 5 CREATE DATABASE permission denied in database 'master'. Msg 3013, Level 16, State 1, Line 5 RESTORE HEADERONLY is terminating abnormally.
This matches the error seen on the Delphix engine from the failed DB_SYNC operation. When the permission issue is resolved, the above query returns the backup header information.
Related Articles
The following articles may provide more information or related information to this article:
- https://docs.delphix.com/docs537/delphix-administration/sql-server-environments-and-data-sources/setting-up-and-configuring-delphix-for-sql-server/tasks-for-the-sql-server-database-administrator/database-user-requirements-for-sql-server#DatabaseUserRequirementsforSQLServer-StagingTargetSQLServerDatabaseUserTasks
- https://docs.delphix.com/docs/datasets/sql-server-environments-and-data-sources/sql-server-support-and-requirements/sql-server-user-requirements#SQLServerUserRequirements-WindowsUserRequirements