Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fern/definition/utils/api/vm/vulnerability/export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ types:
source: optional<string>
finding_id: optional<string>
resurfaced_date: optional<string>
time_taken_to_fix: optional<string>
time_taken_to_fix: optional<integer>
VulnerabilityPlugin:
properties:
id: integer
Expand Down
9 changes: 5 additions & 4 deletions utils/api/was/finding/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,14 @@ func downloadAllWasFindingsChunks(ctx context.Context, secrets *methodtenablefer

// Get the list of available chunks from the status response
var availableChunks []int
if status.ChunksAvailable != nil {
if len(status.ChunksAvailable) > 0 {
availableChunks = status.ChunksAvailable
log.Info("Got available chunks from status", svc1log.SafeParam("chunks", availableChunks))
} else {
// Fallback: if no chunks listed in status, try chunk 1
availableChunks = []int{1}
log.Info("No chunks available in status, trying chunk 1")
log.Error("No chunks available for WAS findings export",
svc1log.SafeParam("export_uuid", exportUUID),
svc1log.SafeParam("status", status.Status))
return nil, fmt.Errorf("no chunks available to download for export %s (potentially because no findings were found using the current filter)", exportUUID)
}

// Download each available chunk
Expand Down
Loading