apps/docs/content/guides/deployment/branching/troubleshooting.mdx
This guide covers common issues you might encounter when using Supabase branching and how to resolve them.
To check deployment status and troubleshoot failures:
For programmatic monitoring, you can use the Management API to poll branch status.
For detailed troubleshooting guidance, see our Troubleshooting guide.
You might want to roll back changes you've made in an earlier migration change. For example, you may have pushed a migration file containing schema changes you no longer want.
To fix this, push the latest changes, then delete the preview branch in Supabase and reopen it.
The new preview branch is reseeded from the ./supabase/seed.sql file by default. Any additional data changes made on the old preview branch are lost. This is equivalent to running supabase db reset locally. All migrations are rerun in sequential order.
A deployment might fail for various reasons, including invalid SQL statements and schema conflicts in migrations, errors within the config.toml config, or something else.
To check the error message, see the Supabase workflow run for your branch under the View logs section.
If multiple preview branches exist, each preview branch might contain different schema changes. This is similar to Git branches, where each branch might contain different code changes.
When a preview branch is merged into the production branch, it creates a schema drift between the production branch and the preview branches that haven't been merged yet.
These conflicts can be resolved in the same way as normal Git Conflicts: merge or rebase from the production Git branch to the preview Git branch. Since migrations are applied sequentially, ensure that migration files are timestamped correctly after the rebase. Changes that build on top of earlier changes should always have later timestamps.
You cannot change which project branch serves as the production branch — the base project that all branches are created from will always remain the production branch. However, you can update which GitHub branch is linked to your production branch. To do this, go to the Integrations page and change the production branch name.
When migrations fail, check:
To debug:
# Test migrations locally first
supabase db reset
# Check migration logs in the dashboard
# Navigate to Branches > Your Branch > View Logs
Migrations must run in the correct order. Common issues:
Fix by:
# Rename migration files to fix timestamp order
mv 20240101000000_old.sql 20240102000000_old.sql
# Reset local database to test
supabase db reset
If you can't connect to a preview branch:
Preview branches auto-pause after inactivity. First connections after pause may timeout:
If configuration changes aren't applying:
config.toml syntaxIf secrets aren't working in your branch:
env(SECRET_NAME)Branch creation might be slow due to:
Preview branches may have different performance characteristics:
If seed data isn't loading:
seed.sql is in ./supabase/ directoryRemember that preview branch data:
If you're still experiencing issues: