-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Summary
Some optional GCP APIs return PERMISSION_DENIED responses with SERVICE_DISABLED details when the service has not been enabled in a project. The current error handling logic only checks the traditional error.errors payload and misses newer error.details entries, so expected disabled-service responses are recorded as failures.
The fix is to recognize SERVICE_DISABLED from the structured error details payload and apply the shared expected-error set in Filestore snapshot collection.
Impact
- Optional services can generate noisy collector errors instead of being treated as expected absence.
- Filestore snapshot collection reports avoidable regional failures when the API is disabled.
- Error handling is inconsistent across older and newer Google API error payload formats.
Affected Files And Changes
plugins/gcp/fix_plugin_gcp/resources/base.py- Add
PERMISSION_DENIED:googleapis.com:SERVICE_DISABLEDto the expected error set. - Read additional structured reasons from
error.detailswhen parsing HTTP error payloads.
- Add
plugins/gcp/fix_plugin_gcp/resources/filestore.py- Pass the shared expected GCP error set into Filestore snapshot collection.
plugins/gcp/test/test_base.py- Add coverage proving the base error handler suppresses a
SERVICE_DISABLEDresponse.
- Add coverage proving the base error handler suppresses a
plugins/gcp/test/test_filestore.py- Add a Filestore-specific regression test verifying disabled services do not populate regional errors.
Expected Behavior
- Disabled optional GCP APIs should be handled as expected when the reason is
SERVICE_DISABLED. - Structured
error.detailspayloads should be parsed alongside legacyerror.errorspayloads. - Filestore snapshot collection should not emit regional errors when the API is simply disabled.
Version
v4.3.0
Environment
Docker
Steps to Reproduce
- Run a collection against a GCP project with filestore service disabled
- Observe PermissionDenied exception
Logs
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working