Please, before you continue, read the disclosure at the bottom of the page.

The Situation

The other day, a backup job from one of our Windows Agents got stuck, collecting recovery media files.
Interesting however, this job was only stuck on the B&R server as the job was still visible as running in the console.
On the client however, everything was fine, thank god.
Even after several days, reboots, service restarts and the like, this job did not go away.
Simply pressing the stop button for the Policy had no affect either, as from the agent point of view, nothing was going on.
Finally, attempts to repair Veeam via the B&R installation media did not provide any resolve.

Further more, successive jobs were still running as scheduled without any trouble.
As we were still creating valid backups, I’d attempt to just remove the job manually from the database and hope that this would fix things.

The Fix

Setup

  1. One stuborn Veeam B&R installation with a running backup job that refuses to quit it
  2. Microsoft SQL Server Management Studio

Actions taken

Once installed, fire up SQL Server Management Studio and connect to the VeeamSQL server (VEEAMSERVER\VEEAMSQL2016 in my case).
I could not find any documentation how to navigate this beast, so I only know what I was able to figure out.
Via the Object Explorer, I needed to navigate to Databases>VeeamBackup>Tables
Here we’ll find a lot, after some enumeration I found what I was looking for in the following tables:

  • dbo.Backup.Model.JobSessions
  • dbo.Backup.Model.BackupTaskSessions

Here, comparing the date from the job and those in the table, as well as the job name I was able to retrieve the unique ID for this specific backup that was causing trouble.
Then, using the ID, deleted those rows from the database, paving the path to glory.
For this, the following Transact-SQL scripts was used.
Locate job:

USE VeeamBackup;
GO
SELECT *
FROM dbo.[Backup.Model.JobSessions]
WHERE id = 'youridhere'
USE VeeamBackup;
GO
SELECT *
FROM dbo.[Backup.Model.BackupTaskSessions]
WHERE session_id = 'youridhere'

Then, to delete the row:

DELETE FROM VeeamBackup.dbo.[Backup.Model.JobSessions]
WHERE id = 'youridhere'
DELETE FROM VeeamBackup.dbo.[Backup.Model.BackupTaskSessions]
WHERE session_id = 'youridhere'

After this, the skies opened up and the sun shined upon the world once again.


Disclosure:
This post is for story telling purposes only.
Should you try and use any of the above, you do this at your own risk.
I know nothing.