Skip to main content

CRE-2025-0141

Supabase Self-Hosted: Disk Full During Database Migration OperationsHigh
Impact: 10/10
Mitigation: 7/10

CRE-2025-0141View on GitHub

Description

Detects when Supabase PostgreSQL database operations fail due to insufficient disk space during migrations,\ndata imports, or large transactions. This can corrupt the database, leave migrations in inconsistent state,\nand cause complete service failure requiring manual intervention.\n

Mitigation

IMMEDIATE:\n - Stop database operations: `docker-compose stop db`\n - Check disk usage: `df -h` and `docker system df`\n - Free up disk space by removing unnecessary files\n - Increase volume size or move to larger storage\nRECOVERY:\n - Restart database service after freeing space\n - Check database integrity: `docker-compose exec db pg_check`\n - Manually complete failed migrations if needed\n - Restore from backup if database is corrupted\nPREVENTION:\n - Monitor disk usage continuously\n - Set up disk space alerts (‹ 10% free)\n - Use larger Docker volumes for production\n - Implement automated cleanup of old WAL files\n - Test migrations on staging with similar data volumes\n - Configure PostgreSQL to limit WAL retention\n

References