Operating system error 5(Access is denied.).
You get a clear error message: Access denied, the SQL Server service account don't have permission th write to the destination.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Using a containerised MSSQL Server 2022 we want to backup our database to URL for S3-compatible object storage and mirror the backup to the same bucket but different path. As soon we add the Mirror to URL option, the statement fails with "Cannot open backup device 's3://my.domain.com/bucket/some-filder/db-mirror.bak'. Operating system error 5(Access is denied.).". The mentioned Url is the one from the MIRROR TO URL option. The access rights on S3 are correct. We are able to back up to both destinations separately, when omitting the "MIRROR TO URL" option.
Our Statement:
BACKUP DATABASE $db_name TO URL = '$target' MIRROR TO URL = '$target_mirror' WITH FORMAT, COMPRESSION, STATS;
both targets points to same bucket but different paths.
the errorlog on /var/opt/mssql/log shows
2023-09-19 06:57:55.48 spid53 Error: 18204, Severity: 16, State: 1. 2023-09-19 06:57:55.48 spid53 BackupDiskFile::CreateMedia: Backup device 's3://my.domain.com/bucket/some-filder/db-mirror.bak' failed to create. Operating system error 5(Access is denied.). 2023-09-19 06:57:55.50 Backup Error: 3041, Severity: 16, State: 1. 2023-09-19 06:57:55.50 Backup BACKUP failed to complete the command BACKUP DATABASE DATABASE_NAME. Check the backup application log for detailed messages.
Any idea whats wrong? Where can I find the application log on the linux container?
Operating system error 5(Access is denied.).
You get a clear error message: Access denied, the SQL Server service account don't have permission th write to the destination.
Hi @Stofer Stephan,
both targets points to same bucket but different paths.
BackupDiskFile::CreateMedia: Backup device 's3://my.domain.com/bucket/some-filder/db-mirror.bak' failed to create. Operating system error 5(Access is denied.).
Please double check the account has full permission to access the device.
Regards,
Zoe Hui
If the answer is helpful, please click "Accept Answer" and upvote it.