Medium severityexecution
Power BI Refresh Error:
Time Travel query out of range
What does this error mean?
A Time Travel query or operation referenced a historical state of a table that is no longer within the DATA_RETENTION_TIME_IN_DAYS window. Snowflake cannot retrieve data older than the configured retention period.
Common causes
- 1A query using AT(OFFSET => -N) or BEFORE(STATEMENT => ...) referenced a point in time older than DATA_RETENTION_TIME_IN_DAYS
- 2A stream on a table consumed its offset so slowly that it fell outside the retention window (stale stream)
- 3An automated Time Travel restore script ran too late after the data was deleted
- 4The table's retention period was set to 0 (no Time Travel) and a historical query was attempted
- 5An incremental pipeline using Time Travel-based change detection ran on a table with a 1-day retention in Enterprise edition
How to fix it
- 1Increase DATA_RETENTION_TIME_IN_DAYS on the table: ALTER TABLE t SET DATA_RETENTION_TIME_IN_DAYS = 7.
- 2For streams, ensure the stream is consumed before the retention window expires — check stream age with SELECT SYSTEM$STREAM_GET_TABLE_TIMESTAMP('stream_name').
- 3For recovery beyond the retention window, contact Snowflake Support to request a Fail-Safe restore (Enterprise+ only).
- 4Adjust automated Time Travel scripts to run within the retention window after any delete or update operation.
- 5For tables where historical queries are routine, set a longer retention period appropriate to the query look-back window.