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

  1. Create previews using safe methods: If the preview is in DELETING state, the platform automatically waits for deletion to complete before allowing recreation. Generate previews using createIfNotExists / create_if_not_exists to reuse preview IDs safely and prevent race conditions with the deletion process.

  2. 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.