Agent-based backups for Windows and Linux, centralized agent management
Post Reply
sedwards
Novice
Posts: 9
Liked: never
Joined: Nov 13, 2019 8:27 pm
Full Name: Steve Edwards
Contact:

Deleted job stuck in running state

Post by sedwards »

This one's a bit odd, it doesn't really affect anything currently but I'd like to get it cleaned up if possible.

A Veeam Windows Agent backup managed by my B&R11 (community license) server has been frozen since February 27. It shows in my console as running and 99% finished.

This is a test job I set up when I was first deploying Veeam in the middle of last year and for a while it ran just fine. I didn't mean to keep it running and didn't notice it until it had been stuck for a few days. I'm unable to cancel it, stopping all Veeam processes and waiting for 15 minutes then restarting as well as rebooting the entire Veeam server similarly has no effect. The affected PC even got reloaded and doesn't have Veeam installed or the same FQDN anymore.

I opened a support case but Veeam closed it without replying, presumably since it's not really a problem and I don't have a paid license. Just curious if anyone here had seen anything similar and might have a resolution since I've been unable to find anything online.

Image

edit: I forgot to add that I was able to delete the backup job itself, its files in the repository, and the PC's entry in the Manually Added group. There's no other trace of it besides this running job.

oleg.feoktistov
Veeam Software
Posts: 916
Liked: 326 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Deleted job stuck in running state

Post by oleg.feoktistov » 1 person likes this post

Hi Steve,

The easiest way to clean it up I can think of is through invoking .NET methods in powershell. Unsupported and quite radical, but still effective if you are sure this is the session you need to cancel as it is clearly stuck:

Code: Select all

asp VeeamPSSnapin # Remove this line if you use VBR v11

# Gets agent management job type from job types enum
$jobType = [Veeam.Backup.Model.EDbJobType]::EpAgentManagement

# Gets running session of agent management backup type
$session = [Veeam.Backup.Core.CBaseSession]::GetRunning() | where {$_.JobType -eq $jobType}

# Aborts the session found
$session.AbortSession() 
I encourage you to check the output of $session before calling AbortSession() method on it to make sure it's the right session you are canceling.

Please let me know if it helps.

Thanks,
Oleg

sedwards
Novice
Posts: 9
Liked: never
Joined: Nov 13, 2019 8:27 pm
Full Name: Steve Edwards
Contact:

Re: Deleted job stuck in running state

Post by sedwards »

I get "Unable to find type [Veeam.Backup.Model.EDbJobType]" and can't proceed further

Sorry I'm not very fluent with Powershell

oleg.feoktistov
Veeam Software
Posts: 916
Liked: 326 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Deleted job stuck in running state

Post by oleg.feoktistov » 1 person likes this post

With VBR v11 you might need to import powershell module explicitly:

Code: Select all

Import-Module Veeam.Backup.Powershell #Add this before the rest of the script
Should help.

sedwards
Novice
Posts: 9
Liked: never
Joined: Nov 13, 2019 8:27 pm
Full Name: Steve Edwards
Contact:

Re: Deleted job stuck in running state

Post by sedwards »

The value of $session appears to be blank

oleg.feoktistov
Veeam Software
Posts: 916
Liked: 326 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Deleted job stuck in running state

Post by oleg.feoktistov » 1 person likes this post

And what is printed to the console if you run it without filters?

Code: Select all

[Veeam.Backup.Core.CBaseSession]::GetRunning()

sedwards
Novice
Posts: 9
Liked: never
Joined: Nov 13, 2019 8:27 pm
Full Name: Steve Edwards
Contact:

Re: Deleted job stuck in running state

Post by sedwards »

I do see the backup job there, it says the restore type is EndpointBackup. I assume I can replace EpAgentManagement with that in the $jobtype variable line?

oleg.feoktistov
Veeam Software
Posts: 916
Liked: 326 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Deleted job stuck in running state

Post by oleg.feoktistov » 1 person likes this post

Yep, that's the case. I must have mistaken the job type for this, sorry.

sedwards
Novice
Posts: 9
Liked: never
Joined: Nov 13, 2019 8:27 pm
Full Name: Steve Edwards
Contact:

Re: Deleted job stuck in running state

Post by sedwards »

OK, now the value of $session comes to Veeam.Backup.Core.CBaseSession.

Not obvious to me whether that's what I want or not.

oleg.feoktistov
Veeam Software
Posts: 916
Liked: 326 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Deleted job stuck in running state

Post by oleg.feoktistov » 1 person likes this post

If you happen to use Write-Host to output $session value, the object type will be printed instead.
Make sure to return it like that:

Code: Select all

$jobType = [Veeam.Backup.Model.EDbJobType]::EndpointBackup
$session = [Veeam.Backup.Core.CBaseSession]::GetRunning() | where {$_.JobType -eq $jobType}
$session
Thanks!

sedwards
Novice
Posts: 9
Liked: never
Joined: Nov 13, 2019 8:27 pm
Full Name: Steve Edwards
Contact:

Re: Deleted job stuck in running state

Post by sedwards »

Perfect, that showed the job name and killing it worked instantly. It now shows as failed.

Thanks a lot for your help!

oleg.feoktistov
Veeam Software
Posts: 916
Liked: 326 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Deleted job stuck in running state

Post by oleg.feoktistov »

Glad I could help you, Steve. Thanks for the cooperation!

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests