Debug auto-refresh issues for Iceberg and Delta Direct tables in Snowflake. Use when: auto-refresh stuck, stale data, refresh not working, iceberg table not syncing, delta direct issues. Triggers: auto-refresh, autorefresh, iceberg refresh, delta direct, catalog integration, stale data, refresh stuck.
Debug auto-refresh issues for Iceberg tables and Delta Direct tables in Snowflake.
| Table Type | Action |
|---|---|
| Delta Direct (created from Delta Lake files) | Load ./delta-direct.md |
| Standard Iceberg table - debug | Continue below |
| Monitoring/alerts setup | Load ./monitoring.md |
Ask: What is the fully qualified Iceberg table name? (e.g., DATABASE.SCHEMA.TABLE_NAME)
Store as <TABLE_NAME>.
SHOW ICEBERG TABLES LIKE '<table_part>' IN <DATABASE>.<SCHEMA>;
| Result | Action |
|---|---|
invalid = false | Proceed to Step 2 |
invalid = true | Table invalid - inform user |
| No rows | Check if regular table exists, return to Step 1 |
SELECT SYSTEM$AUTO_REFRESH_STATUS('<TABLE_NAME>');
Key fields:
executionState: RUNNING, STALLED, or STOPPEDpendingSnapshotCount: Snapshots waiting to processoldestSnapshotTime: Compare to current time for staleness| executionState | Go to |
|---|---|
| RUNNING | Step 3A |
| STALLED | Step 3B |
| STOPPED | Step 3C |
| NULL/error | Step 3D |
Ask: What issue are you experiencing?
| Issue | Go to |
|---|---|
| Data stale/not updating | Step 4 |
| Refresh too slow | Step 5 |
| High costs | Step 6 |
| Refresh stuck/hanging | Step 3E |
Snowflake is auto-recovering. Wait 5 minutes, then re-check status.
⚠️ MANDATORY CHECKPOINT: Ask user approval before recovery procedure.
Recovery procedure:
ALTER ICEBERG TABLE <TABLE_NAME> SET AUTO_REFRESH = FALSE;ALTER ICEBERG TABLE <TABLE_NAME> REFRESH;ALTER ICEBERG TABLE <TABLE_NAME> SET AUTO_REFRESH = TRUE;SELECT SYSTEM$AUTO_REFRESH_STATUS('<TABLE_NAME>');If still not RUNNING → Step 7
Check if auto-refresh enabled:
SHOW ICEBERG TABLES LIKE '<table_part>' IN <DATABASE>.<SCHEMA>;
Test manual refresh:
ALTER ICEBERG TABLE <TABLE_NAME> REFRESH;
| Result | Action |
|---|---|
| Manual succeeds | Reset pipe: toggle AUTO_REFRESH off/on |
| Manual fails | Share error - general refresh issue |
If still stuck after reset → Step 7
Check refresh history:
SELECT * FROM TABLE(INFORMATION_SCHEMA.ICEBERG_TABLE_SNAPSHOT_REFRESH_HISTORY(
TABLE_NAME => '<TABLE_NAME>'
)) ORDER BY REFRESH_START_TIME DESC LIMIT 10;
Check pending count:
SELECT PARSE_JSON(SYSTEM$AUTO_REFRESH_STATUS('<TABLE_NAME>')):pendingSnapshotCount::INT;
| pendingSnapshotCount | Action |
|---|---|
| 0 | Source may have no new data |
| 1-50 | Processing ongoing, wait |
| >50 | ⚠️ CHECKPOINT - Offer manual refresh to clear backlog |
Manual backlog clear: Toggle AUTO_REFRESH off, REFRESH, toggle on.
Get catalog integration:
SHOW ICEBERG TABLES LIKE '<table_part>' IN <DATABASE>.<SCHEMA>;
DESCRIBE CATALOG INTEGRATION <catalog_name>;
Adjust:
ALTER CATALOG INTEGRATION <catalog_name> SET REFRESH_INTERVAL_SECONDS = <value>;
| Use Case | Interval |
|---|---|
| Real-time | 10-30s |
| Near real-time | 30-60s |
| Hourly reporting | 300-600s |
SELECT DATE_TRUNC('day', start_time) AS day,
ROUND(SUM(credits_used), 4) AS total_credits
FROM SNOWFLAKE.ACCOUNT_USAGE.PIPE_USAGE_HISTORY
WHERE pipe_name ILIKE '%<table_part>%'
AND start_time > DATEADD(day, -7, CURRENT_TIMESTAMP())
GROUP BY 1 ORDER BY day DESC;
High costs → Consider increasing REFRESH_INTERVAL_SECONDS.
Get event table:
SHOW PARAMETERS LIKE 'EVENT_TABLE' IN ACCOUNT;
Enable debug logging:
ALTER ICEBERG TABLE <TABLE_NAME> SET LOG_LEVEL = DEBUG;
Query events:
SELECT timestamp, parse_json(value):snapshot_state::STRING AS state,
parse_json(value):error_message::STRING AS error
FROM <EVENT_TABLE>
WHERE resource_attributes:"snow.table.name"::STRING ILIKE '%<table_part>%'
AND record:"name"::STRING = 'iceberg_auto_refresh_snapshot_lifecycle'
ORDER BY timestamp DESC LIMIT 20;
DESCRIBE CATALOG INTEGRATION <catalog_name>;
| Issue | Fix |
|---|---|
| ENABLED = FALSE | ALTER CATALOG INTEGRATION ... SET ENABLED = TRUE; |
| REFRESH_INTERVAL_SECONDS not set | ALTER CATALOG INTEGRATION ... SET REFRESH_INTERVAL_SECONDS = 30; |
Return to Step 2 after fixes.
./monitoring.md