Handling "Preview not found" 404 errors in sandboxes
Last updated: March 24, 2026
If you encounter a "Preview not found" error with a 404 status code when working with newly created sandboxes, this typically indicates that the preview has been deleted, leading to the error when trying to access it.
Common causes
This error can occur when:
The parent sandbox has been manually deleted or expired due to TTL settings
The preview's TTL expired
The preview is in the process of being deleted (`DELETING` state) using an async deletion call
Resolution steps
Create previews using safe methods: If the preview is in
DELETINGstate, the platform automatically waits for deletion to complete before allowing recreation. Generate previews usingcreateIfNotExists/create_if_not_existsto reuse preview IDs safely and prevent race conditions with the deletion process.Check sandbox and preview status: Verify that your sandbox / preview is still active and hasn't been deleted due to TTL or manual cleanup.
Preventing future occurrences
To minimize these errors:
Implement proper error handling in your application to gracefully handle 404 responses
Consider implementing a polling mechanism to check sandbox status periodically
Configure appropriate TTL settings for your sandboxes based on your usage patterns
If the error persists after trying these steps, contact support for further assistance.