PowerShell script exchange
Post Reply
DomBros
Influencer
Posts: 10
Liked: 1 time
Joined: Mar 17, 2017 12:30 pm
Full Name: Tomasz Dabrowski
Contact:

Get-VBRSureBackupJob error: Cannot convert CSbRole

Post by DomBros »

Support Case Number is 06005880

Hello, because we use much of stuff connected with Veeam and Sure jobs using powershell I have few errors / problems/ challenges :)
when it's starts and first of all
cmdlet

Code: Select all

Get-VBRSureBackupJob
ends with error:
Get-VBRSureBackupJob : Cannot convert CSbRole
the same as

Code: Select all

Get-VBRSureBackupJob -Name 'Test (001) vm#OBJPLAAD'
and of course I can us work-a-round

Code: Select all

[Veeam.Backup.Core.SureBackup.CSbJob]::GetAll()
for

Code: Select all

Get-VBRSureBackupJob
but when i want to use it for only one item / sure job

Code: Select all

$VsbJobsAll = [Veeam.Backup.Core.SureBackup.CSbJob]::GetAll()
$VsbJobsAll[0] | Start-VBRSureBackupJob
i get the error:
Start-VBRSureBackupJob : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
and

Code: Select all

Start-VBRSureBackupJob -Job $VsbJobsAll[0]
ends with error:
Start-VBRSureBackupJob : Cannot bind parameter 'Job'. Cannot convert the "Veeam.Backup.Core.SureBackup.CSbJob" value of type "Veeam.Backup.Core.SureBackup.CSbJob" to type "Veeam.Backup.PowerShell.Infos.VBRSureBackupJob".
please help :)
david.domask
Veeam Software
Posts: 1226
Liked: 323 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get-VBRSureBackupJob error: Cannot convert CSbRole

Post by david.domask »

Hi @DomBros,

The first item is unexpected, so continue working with your support engineer; I suspect there is just something mis-cast in the Configuration Database, but let's see what they find. I cannot reproduce this in my lab, so I'm guessing it's something specific to your environment.

Your second item fails for exactly why Powershell explained :) Start-VBRSureBackupJob only accepts Veeam.Backup.PowerShell.Infos.VBRSureBackupJob type objects, which are returned by Get-VBRSureBackupJob, but the .NET Reflection returns CSBJob objects:

Code: Select all

PS C:\Program Files\PostgreSQL\15\bin> (Get-VBRSurebackupJob).GetType()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     False    VBRViSureBackupJob                       Veeam.Backup.PowerShell.Infos.VBRSureBackupJob


PS C:\Program Files\PostgreSQL\15\bin> ([Veeam.Backup.Core.SureBackup.CSbJob]::GetAll())[0].GetType()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     False    CSbJob                                   System.Object
So kind of expected to fail. Let's wait for the Support Engineer to advance their analysis, and we will get the cmdlet working again soon.
David Domask | Product Management: Principal Analyst
DomBros
Influencer
Posts: 10
Liked: 1 time
Joined: Mar 17, 2017 12:30 pm
Full Name: Tomasz Dabrowski
Contact:

Re: Get-VBRSureBackupJob error: Cannot convert CSbRole

Post by DomBros »

thank you very much for the initial analysis, that's great because it looks like it can be fixed quickly
david.domask
Veeam Software
Posts: 1226
Liked: 323 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get-VBRSureBackupJob error: Cannot convert CSbRole

Post by david.domask »

Sure, happy to advise @DomBros,

I only just got to checking the case (I was out of office earlier this week), and looks like it still needs to be assigned to an Engineer; I will help accelerate this, but to help, can you provide us with a copy of the Veeam Configuration Database?

https://www.veeam.com/kb1471

Add it to the case as it will help us to test the issue internally as I cannot reproduce it in my lab easily :)
David Domask | Product Management: Principal Analyst
DomBros
Influencer
Posts: 10
Liked: 1 time
Joined: Mar 17, 2017 12:30 pm
Full Name: Tomasz Dabrowski
Contact:

Re: Get-VBRSureBackupJob error: Cannot convert CSbRole

Post by DomBros »

one again thank you very much for helping me
logs uploaded, backup uploaded
david.domask
Veeam Software
Posts: 1226
Liked: 323 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get-VBRSureBackupJob error: Cannot convert CSbRole

Post by david.domask »

You're very welcome @DomBros,

I've checked the case and consulted with the Engineer, I believe I see the issue; I'm having the Engineer confirm it (second set of eyes never hurts), but I think we can get it fixed pretty fast. They will update you soon :)

There will be some questions on how the Application Group was created; if you have the exact code (or if it's still in your PS history), that would be very useful to see.
David Domask | Product Management: Principal Analyst
DomBros
Influencer
Posts: 10
Liked: 1 time
Joined: Mar 17, 2017 12:30 pm
Full Name: Tomasz Dabrowski
Contact:

Re: Get-VBRSureBackupJob error: Cannot convert CSbRole

Post by DomBros » 1 person likes this post

Thanks Veeam Team for clarifying the issue.
The problem was the application group in which I used a custom role running powershell script check.
I created the role by manually adding it to the role configuration file.
However, while upgrading to Veeam 12, I also migrated the VBR server to new one, forgetting (not transferring) this configuration file :(.
(VM roles are described in XML files stored in the %ProgramFiles%\Veeam\Backup and Replication\Backup\SbRoles folder on the backup server)
Issue resolved.
Thank you very much.
david.domask
Veeam Software
Posts: 1226
Liked: 323 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get-VBRSureBackupJob error: Cannot convert CSbRole

Post by david.domask »

Hi @DomBros,

Very glad that the Engineer was able to get to the root cause with you :)

Thank you for sharing the solution here.
David Domask | Product Management: Principal Analyst
DomBros
Influencer
Posts: 10
Liked: 1 time
Joined: Mar 17, 2017 12:30 pm
Full Name: Tomasz Dabrowski
Contact:

Re: Get-VBRSureBackupJob error: Cannot convert CSbRole

Post by DomBros »

This idea came to me:
Maybe role configuration should be stored in the database?
david.domask
Veeam Software
Posts: 1226
Liked: 323 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Get-VBRSureBackupJob error: Cannot convert CSbRole

Post by david.domask »

Well, not a bad idea indeed, since I guess it could avoid this issue entirely. I am not sure on the design decision behind the XML files (my guess is portability across environments), but I suppose this could be handled with some export cmdlet.

I will register a feature request for it, as it's interesting for me at least personally :)
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests