Skip to content

fix(ENG-701788): support kSkipped in copy-run status enums - #261

Merged
deepak-patel-cohesity merged 2 commits into
masterfrom
ENG-701788
Sep 2, 2026
Merged

fix(ENG-701788): support kSkipped in copy-run status enums#261
deepak-patel-cohesity merged 2 commits into
masterfrom
ENG-701788

Conversation

@deepayan-bose-cohesity

@deepayan-bose-cohesity deepayan-bose-cohesity commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes deserialization failure when C# cmdlets resolve a protection job by name on clusters running Iris 7.3.2+ that return kSkipped for skipped archival/replication copy runs in lastRun.copyRun[].

  • Add KSkipped = 11 with [EnumMember(Value = "kSkipped")] to CopyRun.StatusEnum and CopySnapshotTaskStatus.StatusEnum
  • Bump module version from 1.10.4 to 1.10.5

Problem

Start-CohesityProtectionJob -Name <job> fails with:

Error converting value "kSkipped" to type 'System.Nullable`1[Cohesity.Model.CopyRun+StatusEnum]'.
Path '[7].lastRun.copyRun[1].status'

The same command with -Id succeeds because it skips the name-resolution GET.

Root cause

When -Name is used, RestApiCommon.GetProtectionJobByName() calls:

GET /public/protectionJobs?includeLastRunAndStats=true

The full JSON array is deserialized via Newtonsoft.Json into strongly typed ProtectionJob models. Iris 7.3.2+ can return "kSkipped" at lastRun.copyRun[n].status when an archival/replication copy task was skipped, but the PowerShell module enums did not define that value.

Script-based cmdlets such as Get-CohesityProtectionJob were unaffected because they use ConvertFrom-Json and keep status values as strings.

Changes

File Change
src/Cohesity.Powershell.Models/CopyRun.cs Add KSkipped to StatusEnum
src/Cohesity.Powershell.Models/CopySnapshotTaskStatus.cs Add KSkipped to StatusEnum
src/Cohesity.Powershell/Cohesity.PowerShell.psd1 Version bump to 1.10.5
src/Cohesity.Powershell/Cohesity.PowerShell.Core.psd1 Version bump to 1.10.5

Other cmdlets affected by the same root cause

Any C# cmdlet calling GetProtectionJobByName() with -Name / -JobName:

  • Start-CohesityProtectionJob
  • Suspend-CohesityProtectionJob / Resume-CohesityProtectionJob
  • Enable-CohesityProtectionJob / Disable-CohesityProtectionJob
  • Remove-CohesityProtectionJob
  • Remove-CohesitySnapshot -JobName

Test plan

  • Build module on Windows (src/Build.bat)
  • Import locally built module and connect to repro cluster 10.136.7.114
  • Verify Start-CohesityProtectionJob -Name "PG-repro-FI-67449" no longer throws on deserialization
  • Verify Start-CohesityProtectionJob -Id <jobId> still works (control)
  • Spot-check Suspend-CohesityProtectionJob -Name / Resume-CohesityProtectionJob -Name on the same job
  • Run existing Pester unit tests: tests/Get-CohesityProtectionJobRun.Tests.ps1

Made with Cursor

@deepak-patel-cohesity
deepak-patel-cohesity merged commit c0e30aa into master Sep 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants