{{ message }}
Improve error message for S3 listObjects access denied errors#103463
Open
Improve error message for S3 listObjects access denied errors#103463
listObjects access denied errors#103463Conversation
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
…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 <noreply@anthropic.com>
Contributor
1 task
Contributor
LLVM Coverage ReportChanged lines: 89.77% (79/88) · 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):