#Error in cmdlet "Read-NcDirectory"

1 messages · Page 1 of 1 (latest)

wintry matrix
#

With the new Module 9.11 or with the lastest 9.12 I got the error if I want to browse a volume

PS C:\Temp> Connect-NcController -Name $cluster -Credential $cred -ZapiCall

Name      Address      Version
----      -------      -------
cluster   10.10.10.10  NetApp Release 9.10.1P8: Tue Sep 13 14:10:13 UTC 2022                        

PS C:\Temp> Read-NcDirectory -VserverContext $vserver -Path /vol/$volname
Read-NcDirectory : Invalid path. Path should be in format /vol/<volume name>/<directory name> [/<directory name>...]
At line:1 char:1
+ Read-NcDirectory -VserverContext $vserver -Path /vol/$volname
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Read-NcDirectory], Exception
    + FullyQualifiedErrorId : System.Exception,DataONTAP.C.PowerShell.SDK.Cmdlets.File.ReadNcDirectory

Is this a BUG ? With the old module, like 9.8 it works perfect. And yes. With a directory it works. But I want to browse the volume.

wintry matrix
#

any help here ?

pearl bison
#

If it works with the raw API of the same ONTAP version but not different Powershell module version, then it's certainly a bug in the later version of the powershell module.

pearl bison
#

I actually had to refactor a function to use this instead of the excessively slow VMware *-datastoreitem functions...

#

Let me collect some info around my test...

#

oof, I'm using module version 9.10.1.2111

# Environment
PS \> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.20348.1366
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.20348.1366
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

PS \> get-module -Name NetApp.ONTAP | Select-Object -Property Name,Version

Name         Version    
----         -------
NetApp.ONTAP 9.10.1.2111

PS \> get-ncSystemVersion

NcController          Value
------------          -----
[Redacted FQDN] NetApp Release 9.7P13: Thu Apr 15 02:06:46 UTC 2021

PS \>

# In my environment, $vAppName == Datastore Name == Volume Name
PS \> $NcVol = Get-NcVol -Name $vAppName
PS \> Read-NcDirectory -Path ("/vol" + $NcVol.JunctionPath)

Name              Type            Size      Created     Modified Owner Group   Perm Empty
----              ----            ----      -------     -------- ----- -----   ---- -----
.                 directory       4 KB    3/28/2023    3/28/2023     0     0    755 False
..                directory       8 KB    4/24/2018    3/28/2023     0     0    755 False
.dvsData          directory       4 KB    3/28/2023    3/28/2023     0     0    755 False
.snapshot         directory       4 KB    3/28/2023    3/29/2023     0     0    777 False
JG00185-GW        directory       4 KB    3/28/2023    3/28/2023     0     0    755 False
JG00185-Mint20-JH directory       4 KB    3/28/2023    3/29/2023     0     0    755 False

PS \>
# The 'proof' this is the root of the volume is the '.snapshot' directory.
#

Let me update and try again...

pearl bison
#

After updating the PowerShell module to 9.12.1.2302 I was no longer able to connect to my ONTAP 9.7P13 cluster... Unsure this is just too many versions apart or someone changed something because I was getting an access denied which is typically not an issue with the module. Either way, rolling back versions one at a time until I can connect or if still not able to connect when back at my original version, then it's not PowerShell and is officially something else.

wintry matrix
#

I tried with ONTAP version 9.10.

wintry matrix
#
$vol = Get-NcVol -Name $volume_name
Read-NcDirectory -VserverContext $vol.Vserver -Path ("/vol" + $vol.JunctionPath)
Read-NcDirectory : Invalid path. Path should be in format /vol/<volume name>/<directory name> [/<directory name>...]
At line:1 char:1
+ Read-NcDirectory -VserverContext $vol.Vserver -Path ("/vol" + $vol.Ju ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Read-NcDirectory], Exception
    + FullyQualifiedErrorId : System.Exception,DataONTAP.C.PowerShell.SDK.Cmdlets.File.ReadNcDirectory

ONTAP: 9.10.1
PS Module: 9.11

Tried with -ZapiCall and without