cohesity / cohesity-powershell-module

This repository provides a PowerShell Module for Cohesity DataPlatform. https://cohesity.github.io/cohesity-powershell-module
Apache License 2.0
42 stars 16 forks source link

Error when running Get-CohesityRestoreTask #244

Closed JDoughertyNREL closed 1 week ago

JDoughertyNREL commented 1 month ago

🐛 Bug Report

Similar to issue #214, when running the command Get-CohesityRestoreTask it throws an error (screenshot below).

I am currently running version 1.9.8

To Reproduce

  1. Connect to the Cohesity cluster (Connect-CohesityCluster)
  2. Run Get-CohesityRestoreTask

Expected behavior

I am expecting an output of restore tasks.

Actual Behavior

PS C:\temp> Get-CohesityRestoreTask -Types kRecoverVMs
Get-CohesityRestoreTask : Error converting value "kCancelled" to type 'System.Nullable`1[Cohesity.Model.RestoreObjectState+ObjectStatusEnum]'. Path '[96].restoreObjectState[0].objectStatus', line 1, position 78224.
At line:1 char:1
+ Get-CohesityRestoreTask -Types kRecoverVMs
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-CohesityRestoreTask], JsonSerializationException
    + FullyQualifiedErrorId : Newtonsoft.Json.JsonSerializationException,Cohesity.Powershell.Cmdlets.Recovery.GetCohesityRestoreTask

PS C:\temp> Get-CohesityRestoreTask
Get-CohesityRestoreTask : Error converting value "kCancelled" to type 'System.Nullable`1[Cohesity.Model.RestoreObjectState+ObjectStatusEnum]'. Path '[131].restoreObjectState[0].objectStatus', line 1, position 133933.
At line:1 char:1
+ Get-CohesityRestoreTask
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-CohesityRestoreTask], JsonSerializationException
    + FullyQualifiedErrorId : Newtonsoft.Json.JsonSerializationException,Cohesity.Powershell.Cmdlets.Recovery.GetCohesityRestoreTask
JDoughertyNREL commented 1 month ago

It appears this was broken in commit #224 when the kCancelled state was removed.

image

pyashish commented 1 month ago

Thanks JD, we will get back to you

On Wed, Jul 24, 2024 at 12:24 PM JD @.***> wrote:

It appears this was broken in commit #224 https://github.com/cohesity/cohesity-powershell-module/pull/224 when the kCancelled state was removed.

image.png (view on web) https://github.com/user-attachments/assets/f295eb04-f198-4c92-8639-9ffcd4e5acc2

— Reply to this email directly, view it on GitHub https://github.com/cohesity/cohesity-powershell-module/issues/244#issuecomment-2248744668, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCPI55SP4U3THYCLY36LALZN75PNAVCNFSM6AAAAABLM7CSFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBYG42DINRWHA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Regards, Ashish Bhat