Repository navigation
Improve error message for S3 listObjects access denied errors - #103463
Merged
Merged
Conversation
When `S3ObjectStorage::listObjects` fails (e.g. `AccessDenied` on GCP/S3),
the exception now includes the bucket name, key prefix, and disk name so
users can immediately tell which path and disk caused the permission error.
Before: `Access denied. (Code: 15, S3 exception: 'AccessDenied')`
After: `Access denied. (Code: 15, S3 exception: 'AccessDenied'),
while listing objects in bucket 'my-bucket' with prefix 'data/' on disk 'gcp_disk'`
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Instead of wrapping `throwIfError` in a try/catch at call sites, add a variadic overload that accepts a `fmt::format_string` context and appends it to the exception message directly inside `throwIfError`. Update the `listObjects` call to use the new overload, passing bucket, path prefix, and disk name. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…perations Four call sites where listing or existence-check operations could throw with an opaque error message lacking disk/container/path info: - `AzureObjectStorage::listObjects`: wrap `ListBlobs` loop in `try`/`catch (StorageException)`, re-throw as `DB::Exception` with container, prefix, and disk name. - `AzureIteratorAsync::getBatchAndCheckNext`: same pattern for the async listing path; pass `container` and `disk_name` through the constructor so the catch block has full context. - `AzureObjectStorage::exists`: the existing `StorageException` catch already handles `NotFound` correctly; now re-throws other errors (e.g. `AccessDenied`) as a `DB::Exception` with object path, container, and disk name instead of a bare `throw`. - `S3ObjectStorage::getObjectMetadata`: the existing `addMessage` call only included the object path; extend it to also include the bucket and disk name. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Contributor
|
Workflow [PR], commit [24b611e] Summary: ✅ AI ReviewSummaryThis PR improves S3 object-storage exception context by appending bucket/prefix/disk information to ClickHouse Rules
Final Verdict
|
1 task done
nickitat
marked this pull request as ready for review
April 23, 2026 21:33
kssenii
reviewed
Apr 27, 2026
nickitat
force-pushed
the
improve_list_bucket_exc
branch
from
April 28, 2026 02:33
de35bf0 to
24b611e
Compare
nickitat
enabled auto-merge
April 28, 2026 03:45
Contributor
LLVM Coverage Report
Changed lines: 100.00% (15/15) · Uncovered code |
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.
Changelog category (leave one):
Version info
26.5.1.139