Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions products/warehouse_sources/backend/models/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
ExtractErrors = {
"The AWS Access Key Id you provided does not exist": "The Access Key you provided does not exist",
"Access Denied: while reading key:": "Access was denied when reading the provided file",
# DeltaLake-kernel object_store errors (Delta-format tables, e.g. all warehouse_sources synced
# tables) use a different vocabulary than ClickHouse's native S3 errors above.
"The operation lacked the necessary privileges to complete": "Access was denied when reading the provided file",
"Could not list objects in bucket": "Access was denied to the provided bucket",
"file is empty": "The provided file contains no data",
"The specified key does not exist": "The provided file doesn't exist in the bucket",
Expand Down
17 changes: 17 additions & 0 deletions products/warehouse_sources/backend/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,23 @@ def test_transient_errors_without_message_are_reraised_untouched(self, err: Exce
DataWarehouseTable()._safe_expose_ch_error(err)
assert exc_info.value is err

def test_delta_kernel_permission_error_gets_actionable_message(self) -> None:
# Delta-format tables (the default for every warehouse_sources synced table) read via
# ClickHouse's DeltaLake kernel, whose object_store errors use different wording than
# the native ClickHouse S3 errors above. Without a matching ExtractErrors entry this
# fell through to the generic fallback message regardless of the actual cause.
delta_kernel_error = ServerException(
"DB::Exception: Received DeltaLake kernel error ObjectStoreError: Error interacting with "
"object store: The operation lacked the necessary privileges to complete for path "
"team_2_mysql_x/dw_table/_delta_log/_last_checkpoint: Error performing GET "
"http://objectstorage:19000/data-warehouse/team_2_mysql_x/dw_table/_delta_log/_last_checkpoint "
"- Server returned non-2xx status code: 403 Forbidden: AccessDenied",
code=742, # DELTA_KERNEL_ERROR
)

with pytest.raises(Exception, match="Access was denied when reading the provided file"):
DataWarehouseTable()._safe_expose_ch_error(delta_kernel_error)


class TestRunChdbQuery:
def test_hung_query_is_killed_and_raises_instead_of_blocking(self) -> None:
Expand Down
Loading