With .7zip archive format an incorrect user is used and access is denied to temp folder

I have the following configuration:

  • Temp folder: \BackupServer\Backup\SqlBackupAndFTP Temp
  • Store folder: \BackupServer\Backup\Databases

The task runs as user BackupUser@dom. The user BackupUser@dom has full rights of the folder \BackupServer\Backup and all its subfolders.

The database backup itself runs fine, the backup file is placed in a subfolder of \BackupServer\Backup\SqlBackupAndFTP Temp as expected.

During the archiving step, if the .zip format is selected, everything works fine. However, if the .7zip or .zip(7-zip engine) is selected (no other changes in the job), there is a problem with the access to the temp file.

It looks like the 7zip engine is being started with an incorrect user (not the BackupUser@dom one).

Log for .zip (success):

02.11.2024 18:17 Starting job "tst" - "Full". Server "MGM". System account "BackupUser@dom". App v."12.7.27". 
02.11.2024 18:17 Connecting to "SQL Server": "DB". 
02.11.2024 18:17 Connected to "SQL RTM Standard Edition (64-bit)". 
02.11.2024 18:17 The backup folder is "\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup". The temporary folder is "\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup". 
02.11.2024 18:17 Backing up "DB" SQL Server databases. 
02.11.2024 18:17 Backing up "tst" with "Full" backup type. 
02.11.2024 18:17 Database "tst" successfully backed up to "\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup\tst202411021917.bak : 3.024MB". 
02.11.2024 18:17 Compressing "\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup\tst202411021917.bak" file with Internal archiver. Encryption: "Off". 
02.11.2024 18:17 Backup of "tst" successfully compressed to "(tst202411021917.zip : 369.68KB)". 
02.11.2024 18:17 Connecting to "Folder" destination "\\BackupServer\Backup\Databases". 
02.11.2024 18:17 Reading folder information by path: "\\BackupServer\Backup\Databases". 
02.11.2024 18:17 The current destination folder is "\\BackupServer\Backup\Databases". 
02.11.2024 18:17 Sending backup of "tst" to "Folder" destination "\\BackupServer\Backup\Databases". 
02.11.2024 18:17 Reading the folder information: "tst". 
02.11.2024 18:17 Uploading local "tst202411021917.zip" to remote "tst202411021917.zip" in folder "\\BackupServer\Backup\Databases\tst". 
02.11.2024 18:17 Uploaded 100.00 % (average speed = 9.03 MB/s). 
02.11.2024 18:17 Cleaning up backups of "tst" job. 
02.11.2024 18:17 Cleaning up backups of "tst" database at "Folder" destination "\\BackupServer\Backup\Databases". 
02.11.2024 18:17 Cleanup of "tst" completed. 
02.11.2024 18:17 Disconnecting from "Folder" destination "\\BackupServer\Backup\Databases". 
02.11.2024 18:17 Deleting temporary files. 
02.11.2024 18:17 Job "tst" finished. 

Log for .7zip (failure):

02.11.2024 18:16 Starting job "tst" - "Full". Server "MGM". System account "BackupUser@dom". App v."12.7.27". 
02.11.2024 18:16 Connecting to "SQL Server": "DB". 
02.11.2024 18:16 Connected to "SQL RTM Standard Edition (64-bit)". 
02.11.2024 18:16 The backup folder is "\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup". The temporary folder is "\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup". 
02.11.2024 18:16 Backing up "DB" SQL Server databases. 
02.11.2024 18:16 Backing up "tst" with "Full" backup type. 
02.11.2024 18:16 Database "tst" successfully backed up to "\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup\tst202411021916.bak : 3.024MB". 
02.11.2024 18:16 Compressing "\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup\tst202411021916.bak" file with 7zip archiver. Encryption: "Off". 
02.11.2024 18:16 Failed to backup "tst" database with "Full" backup type: Access to the path '\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup\tst202411021916.bak' is denied. 
02.11.2024 18:16 Cleaning up backups of "tst" job. 
02.11.2024 18:16 Deleting temporary files. 
02.11.2024 18:16 Job "tst" finished with "1" errors. 
02.11.2024 18:16 Sending job log to mosex@payloop.com. 

Log for .zip(7-zip engine):

02.11.2024 18:16 Starting job "tst" - "Full". Server "MGM". System account "BackupUser@dom". App v."12.7.27". 
02.11.2024 18:16 Connecting to "SQL Server": "DB". 
02.11.2024 18:16 Connected to "SQL RTM Standard Edition (64-bit)". 
02.11.2024 18:16 The backup folder is "\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup". The temporary folder is "\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup". 
02.11.2024 18:16 Backing up "DB" SQL Server databases. 
02.11.2024 18:16 Backing up "tst" with "Full" backup type. 
02.11.2024 18:16 Database "tst" successfully backed up to "\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup\tst202411021916.bak : 3.024MB". 
02.11.2024 18:16 Compressing "\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup\tst202411021916.bak" file with 7zip archiver. Encryption: "Off". 
02.11.2024 18:16 Failed to backup "tst" database with "Full" backup type: Access to the path '\\BackupServer\Backup\SqlBackupAndFTP Temp\Pranas.NET\SBF\5311569d-9695-4d12-a176-dfd9ce5ba699\backup\tst202411021916.bak' is denied. 
02.11.2024 18:16 Cleaning up backups of "tst" job. 
02.11.2024 18:16 Deleting temporary files. 
02.11.2024 18:16 Job "tst" finished with "1" errors. 
02.11.2024 18:16 Sending job log to mosex@payloop.com. 

I found a workaround which seems to be working:

  • Assign the user BackupUser@dom as the account under which the service “SQLBackupAndFTP (Database backup)” is running
  • Give the user BackupUser@dom full access writes to the folder C:\ProgramData\Pranas.NET
  • Restart the service

This way it seems the 7zip engine starts under this user and everything works fine. It will not work if you have jobs running under different users though.

Hello,

Thank you for bringing this to our attention and for your suggestion.

This issue occurs because the 7-zip utility runs as a separate process, whereas the zip compression algorithm is executed within the main SQLBackupAndFTP application thread. The main application thread may operate under the user specified in the Windows Authorization settings for the SQL Server backup connection.

If you have any further questions, please let us know.

I understand the issue. When starting the 7zip process, the user can be provided and thus be the same as the one running the whole job. That would solve the problem completely.

Hello,

Thank you for your insight.

Yes, providing the same user for the 7zip process as the one running the backup job should indeed resolve the issue.