PowerShell script exchange
Post Reply
tigattack
Influencer
Posts: 11
Liked: never
Joined: Feb 20, 2018 10:06 am
Contact:

Get-VBRViEntity Error

Post by tigattack »

Hi all.

I'm running into a terminating error with a very basic request using the Get-VBRViEntity cmdlet.

This is what I'm running:

Code: Select all

$server = Get-VBRServer -Name '<my vCenter>'
Find-VBRViEntity -Server $server -VMsAndTemplates
And the result:

Code: Select all

Find-VBRViEntity : An unexpected object occured [index: 8].
At line:1 char:1
+ Find-VBRViEntity -Server $server -VMsAndTemplates
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Find-VBRViEntity], InvalidDataException
    + FullyQualifiedErrorId : System.IO.InvalidDataException,Veeam.Backup.PowerShell.Cmdlets.FindVBRViEntity
I can many perform other requests just fine, this is the only place I'm seeing this issue.

Any advice or pointers on what to look at here would be appreciated.

Cheers,
tig.
HannesK
Product Manager
Posts: 14844
Liked: 3086 times
Joined: Sep 01, 2014 11:46 am
Full Name: Hannes Kasparick
Location: Austria
Contact:

Re: Get-VBRViEntity Error

Post by HannesK »

Hello,
the "-Type VC" seems to be missing

this code works for me:

Code: Select all

$server = Get-VBRServer -Type VC -Name "vcenter.lab.intern"
Find-VBRViEntity -Server $server -VMsAndTemplates

Best regards,
Hannes
tigattack
Influencer
Posts: 11
Liked: never
Joined: Feb 20, 2018 10:06 am
Contact:

Re: Get-VBRViEntity Error

Post by tigattack »

Thanks, Hannes.

The "Type" property of $server already reported as "VC" but I tried running it as you suggested, just in case.
Unfortunately, this didn't make a difference, or perhaps only a slight difference:

Code: Select all

Find-VBRViEntity : An unexpected object occured [index: 11].
At line:1 char:1
+ Find-VBRViEntity -Server $server -VMsAndTemplates
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Find-VBRViEntity], InvalidDataException
    + FullyQualifiedErrorId : System.IO.InvalidDataException,Veeam.Backup.PowerShell.Cmdlets.FindVBRViEntity
Here are the contents of $server, in case it's of any use:

Code: Select all

Info               : <my vCenter> (VMware vCenter server)
ParentId           : 00000000-0000-0000-0000-000000000000
Id                 : f88bf2ca-9b68-43c7-98af-5c259179a518
Uid                : f88bf2ca9b6843c798af5c259179a518
Name               : <my vCenter>
Reference          : 
Description        : vCentre.
                     Created by domain\Admin at 11/11/2018 19:12.
IsUnavailable      : False
Type               : VC
ApiVersion         : V70
PhysHostId         : a96f1eda-8f45-469a-81d3-c783aa382527
ProxyServicesCreds : 
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBRViEntity Error

Post by veremin »

Just for the purpose of testing try to remove -VMsAndTemplates switch and see whether it makes any difference? Thanks!
tigattack
Influencer
Posts: 11
Liked: never
Joined: Feb 20, 2018 10:06 am
Contact:

Re: Get-VBRViEntity Error

Post by tigattack »

Same error as before, I'm afraid.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBRViEntity Error

Post by veremin »

Can you also tell us what product version you're using? v10, v11?
tigattack
Influencer
Posts: 11
Liked: never
Joined: Feb 20, 2018 10:06 am
Contact:

Re: Get-VBRViEntity Error

Post by tigattack »

I'm using v11.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBRViEntity Error

Post by veremin »

Can you tell us whether you're using remote console or accessing PS module locally on backup server machine? Also, if you input $env:PSModulePath in PS session, what does it show? Thanks!
tigattack
Influencer
Posts: 11
Liked: never
Joined: Feb 20, 2018 10:06 am
Contact:

Re: Get-VBRViEntity Error

Post by tigattack »

I'm using the PS module on a different machine to the B&R server.
I just tried running the original commands locally (on the B&R server) and it works as expected.

$env:PSModulePath returns the following results.
Remote machine:

Code: Select all

C:\Users\admin\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Modules;C:\Program Files\Veeam\Backup and Replication\Console\;C:\Program Files\Veeam\Backup and Replication\Explorers\Exchange\;C:\Program Files\Veeam\Backup and Replication\Explorers\SharePoint\;C:\Program Files\Veeam\Backup and Replication\Explorers\SQL\;C:\Program Files\Veeam\Backup and Replication\Explorers\ActiveDirectory\;C:\Program Files\Veeam\Backup and Replication\Explorers\Oracle\;C:\Program Files\Veeam\Backup and Replication\Explorers\Teams\
B&R server:

Code: Select all

C:\Users\admin\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\Veeam\Backup and Replication\Console\;C:\Program Files\Veeam\Backup and Replication\Explorers\Exchange\;C:\Program Files\Veeam\Backup and Replication\Explorers\SharePoint\;C:\Program Files\Veeam\Backup and Replication\Explorers\SQL\;C:\Program Files\Veeam\Backup and Replication\Explorers\ActiveDirectory\;C:\Program Files\Veeam\Backup and Replication\Explorers\Oracle\;C:\Program Files\Veeam\Backup and Replication\Explorers\Teams\;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\Veeam\Backup and Replication\Console\;C:\Program Files\Veeam\Backup and Replication\Explorers\Exchange\;C:\Program Files\Veeam\Backup and Replication\Explorers\SharePoint\;C:\Program Files\Veeam\Backup and Replication\Explorers\SQL\;C:\Program Files\Veeam\Backup and Replication\Explorers\ActiveDirectory\;C:\Program Files\Veeam\Backup and Replication\Explorers\Oracle\;C:\Program Files\Veeam\Backup and Replication\Explorers\Teams\
I'm not sure why the path is duplicated here, but it seems inconsequential since it works fine.
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get-VBRViEntity Error

Post by oleg.feoktistov »

Hi,

I assume you connect to Veeam B&R Server, where Backup Console is installed alongside, from a remote machine using WinRM tools (New-PSSession, Enter-PSSession)?

So, you don't have Veeam Backup console installed on your remote machine, right?

Thanks,
Oleg
tigattack
Influencer
Posts: 11
Liked: never
Joined: Feb 20, 2018 10:06 am
Contact:

Re: Get-VBRViEntity Error

Post by tigattack »

Hi Oleg,

No, I have the VBR console installed on the remote machine. As you may see above, C:\Program Files\Veeam\Backup and Replication\Console\ and the explorer paths are in the PSModulePath environment variable.
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get-VBRViEntity Error

Post by oleg.feoktistov »

Hi @tigattack,

We are trying to reproduce your issue together with Dev team now. As this is a technical one, please, contact our support and share this forum thread with them. Don't forget to share the case id here as well.
In parallel, please, run the commands below on both your remote VBR console and local VBR server and post the output results.

Get modules:

Code: Select all

Get-Module -ListAvailable
Get-Module -All
Get assemblies:

Code: Select all

 [System.AppDomain]::CurrentDomain.GetAssemblies()|?{$_.Location -match "Veeam" `
-or $_.Location -match "VimService" -or $_.Location -match "SpsService"`
 -or $_.Location -match "InvService" -or $_.Location -match "PbmService"} 
Thanks,
Oleg
Theepan
Novice
Posts: 4
Liked: never
Joined: Dec 23, 2014 1:41 pm
Full Name: Kantheepan Rajaratnam
Contact:

Re: Get-VBRViEntity Error

Post by Theepan »

Hi @tigattack and @oleg.feoktistov

Did you find a solution to this problem? I am experiencing the same error.

The command Find-VBRViEntity works fine when executed locally on the VBR server, but as soon as it's executed from a remote server, we get the same error:

Code: Select all

Find-VBRViEntity : An unexpected object occured [index: 8].
At line:1 char:1
+ Find-VBRViEntity -Server "<vc-server-fqdn-name>"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Find-VBRViEntity], InvalidDataException
    + FullyQualifiedErrorId : System.IO.InvalidDataException,Veeam.Backup.PowerShell.Cmdlets.FindVBRViEntity
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get-VBRViEntity Error

Post by oleg.feoktistov » 1 person likes this post

Hi,

We have been discussing this issue with QA and Dev for a while now.
It might be happening because assemblies of some Veeam services are not being updated on a remote VBR console machine when moving from v10 to v11. Hence, the difference between assemblies' versions on a remote machine and a local server might lead to such errors. I'll update this thread as soon as I have precise answers. Meanwhile, it might be worth submitting a case and sharing the number here for further tracking.

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

Re: Get-VBRViEntity Error

Post by oleg.feoktistov »

For anybody, who encountered this issue. This may happen due to assemblies not being deleted from Windows Global Assembly Cache upon VBR v9.x uninstallation. Since v10 we use a different location to keep them, but because of .NET CLR nature it still picks up these libraries from GAC. The solution is to locate outdated assemblies with the script I shared above, find them in GAC and delete from there. Due to the fact that outdated assemblies' names may differ from case to case, I'd recommend contacting our support team so that they could help you with locating the libraries and removing them from GAC. Thanks!
tigattack
Influencer
Posts: 11
Liked: never
Joined: Feb 20, 2018 10:06 am
Contact:

Re: Get-VBRViEntity Error

Post by tigattack »

Apologies for the delayed response and recent lack of feedback, life got in the way of my work on this project.

Thanks for the fix, Oleg, it's much appreciated.
dionrowney
Lurker
Posts: 2
Liked: never
Joined: Aug 19, 2011 8:28 pm
Full Name: Dion Rowney
Contact:

Find-VBRViResourcePool : An unexpected object occured [index: 8]

Post by dionrowney »

I am trying to get the ResourcePool/VM/Datastore object but its giving me a weird error:

Code: Select all


Find-VBRViResourcePool -Server 'hostname.localdomain' -Name PoolName
Find-VBRViResourcePool : An unexpected object occured [index: 8].
At line:1 char:1
+ Find-VBRViResourcePool -Server 'hostname.localdomain' -Name TestPool ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Find-VBRViResourcePool], InvalidDataException
    + FullyQualifiedErrorId : System.IO.InvalidDataException,Veeam.Backup.PowerShell.Cmdlets.FindVBRViResourcePool

Similar errors when doing Find-VBRViDatastore and Find-VBRViFolder

Last time I used these cmdlets was V9.5 and vmware 6.7

Ideas?
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 670 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get-VBRViEntity Error

Post by oleg.feoktistov »

Hi Dion,

I have merged your post with the existing topic, where we discussed this issue a while back. Please, check the recommendations from my last post above.

Thanks,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests