Agent skill · posthog
debugging-table-access-denied
Debugs a TableAccessDeniedError from an error tracking issue, Slack alert, or user report. Use when investigating why HogQL denied a system or warehouse table and whether the occurrence is a real bug or expected behavior. Trigger terms include TableAccessDeniedError, table_access_denied, and "You don't have access to table".
What it needs
About 1k tokens when loaded.
What this skill does
Debugging "You don't have access to table" TableAccessDeniedError (posthog/hogql/errors.py, code tableaccessdenied) means the query referenced a table that access control removed from the HogQL schema. The mechanism — how and why tables get removed — is documented in posthog/hogql/ACCESSCONTROL.md; read it first. Hints: The error proves the table exists and was denied. A nonexistent table raises Unknown table instead. On an HTTP request this is an expected 4xx, never captured. An error tracking issue means it was raised in a background context — figure out which from the event's query tags (teamid, userid, product, celerytaskid, temporal.). A system. name is a system-table decision; a bare name is a warehouse table/view denial. No userid on the event usually means a userless Database.createfor — it fails closed, and bypasswarehouseaccesscontrol does not cover system tables. That's a bug in the calling code. Background jobs run as the resource's createdby; a creator who left the org is the known benign cause (cache warming, alerts, and exports already suppress capture for it via creatoraccessrevoked). Otherwise it's a real access rule (RBAC or entitlement) — see the readme for how a table's access level resolves, and check the AccessControl rows for the table's accessscope.
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills posthog/debugging-table-access-denied