fix: Return structured errors from GFAL2 storage operations#8439
Merged
fstagni merged 1 commit intoDIRACGrid:integrationfrom Jan 29, 2026
Merged
fix: Return structured errors from GFAL2 storage operations#8439fstagni merged 1 commit intoDIRACGrid:integrationfrom
fstagni merged 1 commit intoDIRACGrid:integrationfrom
Conversation
Return error dictionaries with errno codes from exists() and getFileMetadata() to allow consumers to distinguish between different error types (e.g., ENOENT vs EACCES). This enables downstream code to properly handle permission denied errors separately from file-not-found errors, avoiding false positives when checking file existence at storage elements.
fstagni
approved these changes
Jan 29, 2026
Contributor
|
Ouuuuh dangerous ! |
Contributor
|
We tried such things in the past and it was a disaster because upper in the chain we do string comparisons which of course break against the dictionary |
Contributor
|
that was merged too quickly, it needs to be carefully checked |
Contributor
|
just to add, I am happy with the idea, but we never converged on a way to do it. Maybe time to rethink it globally. |
Contributor
|
Btw that's why |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
exists()andgetFileMetadata()inGFAL2_StorageBasegfal2.GErrorseparately to extract thee.code(errno)ENOENTvsEACCES)See: https://gitlab.cern.ch/lhcb-dirac/LHCbDIRAC/-/merge_requests/1870
Motivation
When a storage element returns HTTP 401 (Permission Denied / Authentication Error),
dirac-dms-check-fc2seincorrectly reports files as "missing at SEs". This is because all files inmetadata["Failed"]are treated as "not existing" regardless of the actual error type.By returning structured error information with errno codes, downstream code can properly handle permission denied errors separately from file-not-found errors, avoiding false positives.
Changes
The error format changes from:
to:
Backward Compatibility
Downstream code should handle both the old string format and new dict format during the transition period: