Problem description
Before the schedule for the log backup kicks in, at least one database is in the full recovery model, and the permissions to perform a log backup are correct. However, the log backup fails with error SQL6 (No database found for backup).
Cause
In rare situations, changing the recovery model type from full to simple or vice versa before or during the backup window causes this error.
Traceback
The event viewer will have the following error:
โ
โ
The database configuration is as follows:
The backup job will fail with the following errors:
[2020-05-14 02:51:29,529] [ERROR] <_MainThread(MainThread)> Exception: BACKUP LOG cannot be performed because there is no current database backup. (#100030008) (Error Code : SQL8).
[2020-05-14 02:51:29,529] [ERROR] <_MainThread(MainThread)> Error <class 'inSyncLib.inSyncError.SyncError'>:BACKUP LOG cannot be performed because there is no current database backup. (#100030008) (Error Code : SQL8). Traceback -Traceback (most recent call last):
File "agentPartnerProcess.pyc", line 157, in _process_request
File "agentPartnerProcess.pyc", line 85, in _process_request_start
File "agents\sqlserver\SqlAgent.pyc", line 62, in process_backup_start
File "agents\sqlserver\SqlBackup.pyc", line 256, in prepare
File "agents\sqlserver\SqlBackup.pyc", line 234, in __discover_databases
File "agents\sqlserver\VssHelper.pyc", line 824, in discover_databases
File "agents\sqlserver\VssHelper.pyc", line 1066, in check_backup_status
SyncError: BACKUP LOG cannot be performed because there is no current database backup. (#100030008) (Error Code : SQL8)
Troubleshooting
Examine the SQL server logs to check if the following sequence of events exists.
If you notice a change in the recovery model such as SIMPLE followed by FULL, then the issue is caused due to the cause explained in this article.
โ
Resolution
When a SQL Server database has a LOG BACKUP schedule, and the Recovery Model changes from FULL to SIMPLE, then upon changing back to FULL, A FULL BACKUP must occur to start a new log backup chain.
Since, in most cases, a FULL backup is only scheduled once a day, the log backup continues to fail until a FULL backup happens, and after that, if the recovery model is changed again, then the issue repeats itself.
Please check with your DB administrator or the user who keeps changing the recovery model of the affected DBโs. Ideally, the recovery model should remain unchanged.
If there are unavoidable environmental requirements, check with your DB admin for a time window when he changes the recovery model and can schedule a FULL backup after it. Running a full backup creates a new log chain, but you will still see log backup errors until the FULL backup completes.
If the recovery model of a database needs to be changed for some reason, create another backup set for this SQL server. After the changes, only the backups for this backup set will fail, and the other backups will be unaffected.
๐ Note
โ Before creating a new backup set for this database, deselect this database from the current backup set.