Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(data-imports): map DeltaLake object-store access errors to an actionable message (#73490)

Tom Owers84c9db66ffe1
diff --git a/products/warehouse_sources/backend/models/table.py b/products/warehouse_sources/backend/models/table.py
index 45e5612da9a8..fbd22bc1df91 100644
--- a/products/warehouse_sources/backend/models/table.py
+++ b/products/warehouse_sources/backend/models/table.py
@@ -71,6 +71,9 @@ SERIALIZED_FIELD_TO_CLICKHOUSE_MAPPING: dict[DatabaseSerializedFieldType, str] =
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",
diff --git a/products/warehouse_sources/backend/tests/test_table.py b/products/warehouse_sources/backend/tests/test_table.py
index 270c83e53755..b89131ce3241 100644
--- a/products/warehouse_sources/backend/tests/test_table.py
+++ b/products/warehouse_sources/backend/tests/test_table.py
@@ -140,6 +140,23 @@ class TestSafeExposeChError:
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: