VMware Cloud Community
CRad14
Hot Shot
Hot Shot

vCheck v6 Crash due to Stack Overflow

So today I decided to start using vCheck 6, and of course I cannot get it to work correctly

As I am watching it due its thing...right when it gets to

calculating VMs needing snapshot consolidation by Luc Dekens v1.0

It throws this error:

Process is terminated due to stackoverflowexception

Then powershell crashes

Thoughts, ideas, suggestions??

Conrad www.vnoob.com | @vNoob | If I or anyone else is helpful to you make sure you mark their posts as such! 🙂
0 Kudos
15 Replies
LucD
Leadership
Leadership

There can be several reasons for this.

Do you have a huge amount of deeply nested snapshots in your environment ?

How much memory do you have on the machine you run the vCheck script ?

Are you running the script local or in a remote session ?

What PowerCLI version are you using ? The latest is 5.0.1

Can you list the error and exception in detail ?

Use this

$error[0].Exception | select *

$error[0].Exception.InnerException | select *

$error[0].Exception.InnerException.InnerException | select *


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
CRad14
Hot Shot
Hot Shot

No, it looks like there are only 3 snapshots.

2GB of Mem

The powershell session is local to the computer I am logged into

Yeah I am on the newest version.

I cannot use the exception stuff because powershell gets force closed once that error occurs so the error details are lost....

Conrad www.vnoob.com | @vNoob | If I or anyone else is helpful to you make sure you mark their posts as such! 🙂
0 Kudos
LucD
Leadership
Leadership

Leave out the snapshot consolidation plugin (remove file '45 VMs needing snapshot consolidation.ps1' from the Plugins directory, and see if vCheck runs to the end without an exception.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
CRad14
Hot Shot
Hot Shot

Interesting, it seems to have crashed again with that plugin...However I didn't have my eye on it while it was running(silly work stuff Smiley Happy) so I am not sure what step it died on this time.....I will check that out and update

Conrad www.vnoob.com | @vNoob | If I or anyone else is helpful to you make sure you mark their posts as such! 🙂
0 Kudos
LucD
Leadership
Leadership

Any chance of running it on a machine with more than 2GB ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

CRad14
Hot Shot
Hot Shot

Ok,

Boosted to 3 GB...Failed

Boosted to 4 GB...Still Failed

Redownloaded vCheck....failed

Tried on different computer with 4 GB.... It worked, or atleast it didn't crash, although it threw this error

Send-MailMessage : Cannot validate argument on parameter 'Attachments'. The argument is null or empty. Supply an argume
nt that is not null or empty and then try the command again.
At C:\download\vcheck\vCheck.ps1:385 char:154
+         send-Mailmessage -To $EmailTo -From $EmailFrom -Subject "$VISRV vCheck Report"  -SmtpServer $SMTPSRV -Body "v
Check attached to this email" -Attachments <<<<  $Filename
    + CategoryInfo          : InvalidData: (:) [Send-MailMessage], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.SendMailMessage'
Trying it again with
"If you would prefer the HTML file as an attachement then enable the following: [$true]: $false"
Hey Now it worked,  although I still need to figure out why it isn't working on the first box, and have it send me emails.

Atleast there is progress

Conrad www.vnoob.com | @vNoob | If I or anyone else is helpful to you make sure you mark their posts as such! 🙂
0 Kudos
david615
Enthusiast
Enthusiast

I had same issue with my environment.  When I used 64bit OS and 64bit PowerCLI, the problem went away.

I belive it has something to do with memory issues.  I'll post some more details after I dig in little bit more.

http://powerclinic.blogspot.com/
0 Kudos
CRad14
Hot Shot
Hot Shot

Hmm according to that though I shouldn't have problems as my box is x64 and I pretty much always run the 64bit powershell

Conrad www.vnoob.com | @vNoob | If I or anyone else is helpful to you make sure you mark their posts as such! 🙂
0 Kudos
LucD
Leadership
Leadership

Well, it is clear by now that vCheck v6 is very memory hungry.

Users wanting to run it on clients with a smaller memory footprint, I would advise to run it twice.

With the new plugins concept it is quite easy to have for example a first run with plugins 1-23 and then a 2nd run with plugins 24-46.

I admit this is a cheap bypass, but it should give you some results until the memory problem is fixed :smileygrin:


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

alanrenouf
VMware Employee
VMware Employee

I am storing more into variables in this version to make it faster to run but I have never seen this issue before, it almost sounds like this issue here: http://www.jonathanmedd.net/2011/07/powercli-exception-of-type-system-outofmemoryexception-was-throw...

Might be worth watching the powershell.exe process in Task Manager to see how much memory it is grabbing.

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
0 Kudos
alanrenouf
VMware Employee
VMware Employee

Actually I just went back through the comments on my blog and there was someone there having exactly the same issue, they were running PowerCLI 5.0, they installed PowerCLI 5.1 and all was fine.

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
0 Kudos
CRad14
Hot Shot
Hot Shot

Alan, Thanks!

I am currently at PowerCLI version 5.0.1, although I cannot find a PowerCLI version 5.1. Did you mean 5.0.1 or is there a beta release of 5.1 out there I am missing?

Conrad www.vnoob.com | @vNoob | If I or anyone else is helpful to you make sure you mark their posts as such! 🙂
0 Kudos
alanrenouf
VMware Employee
VMware Employee

Doh! I did indeed mean 5.0.1 - Dont forget the zero or you will start rumours !

Did you check out Jonathans blog and see if this helped ?

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
0 Kudos
CRad14
Hot Shot
Hot Shot

Ok, I believe I may have fixed the isssue.

Alan, I generally always use 64bit, unless I have to use 32... however your whole "rumored" 5.1 did give me an idea.

I completely uninstall PowerCLI , rebooted and Reinstalled it.

Now it works...

However when I choose to have it send an attachment to me I get this error

Send-MailMessage : Cannot validate argument on parameter 'Attachments'. The argument is null or empty. Supply an argument that is not null or empty and then try the command again.
At C:\power\vcheck\vCheck.ps1:385 char:155
+ ... " -Attachments $Filename
+                    ~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Send-MailMessage], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.SendMailMessage

I took a look at the vcheck.ps1 and the globalvariables and I think I may have found the issue....

On line 372 and 391 of the vcheck.ps1, it tries to validate whether or not $SendAsAttachment is true, when I think it shoul be $SendAttachment....

At the very least when I change $SendAsAttachment to $SendAttachment the email gets sent off fine, but it doesn't attach the file, it still puts it in the body.....

Conrad www.vnoob.com | @vNoob | If I or anyone else is helpful to you make sure you mark their posts as such! 🙂
0 Kudos
alanrenouf
VMware Employee
VMware Employee

Great, im glad you got it to work !

Yeah I know about the attachement issue, thanks, it is fixed in v6.8 which is currently in beta testing and should be released soon.

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
0 Kudos