Active IQ Unified Manager Discussions

Get-NCVol Returns "Object reference not set to an instance of an object."

coreywanless
5,864 Views

Has anyone got this error before when trying to run get-ncvol? the command passes back some of the volumes before failing.

 

get-ncvol : Object reference not set to an instance of an object.
At line:1 char:1
+ get-ncvol
+ ~~~~~~~~~
+ CategoryInfo : InvalidOperation: (n1fsc1.nas.cat.com:NcController) [Get-NcVol], NullReferenceException
+ FullyQualifiedErrorId : ApiException,DataONTAP.C.PowerShell.SDK.Cmdlets.Volume.GetNcVol

1 ACCEPTED SOLUTION

coreywanless
5,658 Views

Sorry guys, I left you alll hanging on this thread. For me it ended up being that one of the nodes was down. When the node issue was resolved the error went away. I believe the cluster at the time was running 8.2.1, but I could be mistaken. 

 

Thanks for all your input.

View solution in original post

4 REPLIES 4

coreywanless
5,854 Views

Actually looking further into it, I'm getting it on a bunch of commands. It seems specific to that cluster, and it is not just the server running the script.  I tried it on my PC, and got the same error.

 

This cluster is running 8.2.2p1

geringer
5,849 Views

I have seen this when I am testing newly developed code.  Could you post the complete section of code that you believe is generating the error?

 

Mike

omegazero
5,827 Views

I had a similar problem with the clone create applet. It seems like there's a 60 second timeout, after which the applet throws this error. In my case the action was actually completing though, despite the error. I was able to work around the issue similar to this:

 

$CloneVolume = $Null
$LoopCounter = 0

Get-WFALogger -Info -Message $("--- Creating volume clone $($CloneVolName) of parent volume $($ParentVolname) with backing snapshot $($ParentVolName).")

Try { New-NcVolClone -VserverContext $VserverName -CloneVolume $CloneVolName -ParentVolume $ParentVolname -ParentSnapshot $ParentSnapname -SpaceReserve none -ErrorAction SilentlyContinue }
Catch { Get-WFALogger -Warn -Message $("=== Caught an error in previous command.") }

While (!$CloneVolume -And ($LoopCounter -le 3)) {

  $CloneVolume = Get-NcVolClone -Vserver $VserverName -Name $CloneVolName -ErrorAction SilentlyContinue
  
  If (!$CloneVolume) {
    Get-WFALogger -Warn -Message $("=== Timed out waiting for $($CloneVolName) to arrive - waiting another 10 seconds.")
    Sleep 10
    $LoopCounter++
  }  

}

 I'm sure there's a better way to address the issue, but this is has been working in my case for over a week now.

coreywanless
5,659 Views

Sorry guys, I left you alll hanging on this thread. For me it ended up being that one of the nodes was down. When the node issue was resolved the error went away. I believe the cluster at the time was running 8.2.1, but I could be mistaken. 

 

Thanks for all your input.

Public