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-warehouse): recognize S3's bodyless 404 as a missing file (#128395)

Tom Owers2d94d7aa0472
diff --git a/products/warehouse_sources/backend/models/table.py b/products/warehouse_sources/backend/models/table.py
index ee03ebbb3ac2..c7b939d902cf 100644
--- a/products/warehouse_sources/backend/models/table.py
+++ b/products/warehouse_sources/backend/models/table.py
@@ -98,6 +98,8 @@ ExtractErrors = {
"Access Denied: while reading key:": "Access was denied when reading a file from the bucket. Check that the provided credentials can read objects in this bucket (s3:GetObject), then try again.",
# A HEAD request has no response body, so S3's denial reaches ClickHouse without "Access Denied".
"Failed to get object info: No response body.. HTTP response code: 403": "Access was denied when reading a file from the bucket. Check that the provided credentials can read objects in this bucket (s3:GetObject), then try again.",
+ # Same HEAD-request shape as the 403 above, but for a key that isn't there at all.
+ "Failed to get object info: No response body.. HTTP response code: 404": "The provided file doesn't exist in the bucket. Check the files URL pattern, then try again.",
# 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",
diff --git a/products/warehouse_sources/backend/tests/test_table.py b/products/warehouse_sources/backend/tests/test_table.py
index 5b91764d3d28..0fe436c621fc 100644
--- a/products/warehouse_sources/backend/tests/test_table.py
+++ b/products/warehouse_sources/backend/tests/test_table.py
@@ -276,6 +276,16 @@ class TestWarehouseReadErrorClassification:
),
"doesn't exist in the container",
),
+ (
+ ServerException(
+ "S3 error occurred. (DB::Exception: Failed to get object info: No response body.. "
+ "HTTP response code: 404: while reading 'exports/my_table/' in bucket 'my-bucket' on disk "
+ "'StorageS3': The table structure cannot be extracted from a CSV format file. You can "
+ "specify the structure manually.",
+ code=499,
+ ),
+ "doesn't exist in the bucket",
+ ),
(
ServerException("DB::Exception: A failure shape nobody has classified yet.", code=999),
None,