Skip to content

fix: skip failing resources instead of aborting listing#122

Open
shsketch wants to merge 1 commit intopassbolt:v5from
shsketch:fix/resilient-resource-listing
Open

fix: skip failing resources instead of aborting listing#122
shsketch wants to merge 1 commit intopassbolt:v5from
shsketch:fix/resilient-resource-listing

Conversation

@shsketch
Copy link

Summary

When a single resource fails to decrypt (e.g. malformed secret data, unsupported resource type, or request timeout), the list resource command aborts entirely with an error. This makes the command unusable on instances with even one problematic resource.

This patch makes the listing resilient by:

  • Printing a warning to stderr for each skipped resource
  • Continuing with the next resource instead of returning an error

Affected code paths:

  • resource/list.go: JSON output loop and table output loop
  • resource/filter.go: CEL filter evaluation loop

Context

On a Passbolt v5 instance with ~1270 resources, the list resource command was failing due to individual resources with parsing issues. With this fix, all valid resources are listed and problematic ones are reported as warnings.

Test plan

  • Verify list resource completes even when some resources fail to decrypt
  • Verify warnings are printed to stderr for skipped resources
  • Verify JSON and table output modes both handle failures gracefully
  • Verify CEL filter mode skips failing resources

When a single resource fails to decrypt (e.g. malformed secret data,
unsupported resource type, or timeout), the entire list command would
abort with an error. This patch makes the listing resilient by logging
a warning to stderr and continuing with the next resource.

Affected code paths:
- resource/list.go: JSON output loop and table output loop
- resource/filter.go: CEL filter evaluation loop
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@speatzle
Copy link
Collaborator

I think this already was fixed on main here d1ea838

I tagged main as a new release just now, can you confirm if this is still an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants