"error running container: exit 1" when restoring database backups in local development
Bug report
- [x] I confirm this is a bug with Supabase, not with my own application.
- [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
When I execute supabase db start --from-backup db_cluster.backup, I get the following error:
$ supabase db start --from-backup db_cluster-04-05-2025\@01-08-27.backup --debug
Supabase CLI 2.22.6
Starting database...
+ ulimit -n
+ '[' '!' -z '' ']'
+ export ERL_CRASH_DUMP=/tmp/erl_crash.dump
+ ERL_CRASH_DUMP=/tmp/erl_crash.dump
+ '[' false = true ']'
+ echo 'Running migrations'
+ sudo -E -u nobody /app/bin/migrate
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 14991ms. This means requests are coming in and your connection pool cannot serve them fast enough. You can address this by:
1. Ensuring your database is available and that you can connect to it
2. Tracking down slow queries and making sure they are running fast enough
3. Increasing the pool_size (although this increases resource consumption)
4. Allowing requests to wait longer by increasing :queue_target and :queue_interval
See DBConnection.start_link/2 for more information
(ecto_sql 3.11.3) lib/ecto/adapters/sql.ex:1054: Ecto.Adapters.SQL.raise_sql_call_error/1
(elixir 1.17.3) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
(ecto_sql 3.11.3) lib/ecto/adapters/sql.ex:1161: Ecto.Adapters.SQL.execute_ddl/4
(ecto_sql 3.11.3) lib/ecto/migrator.ex:755: Ecto.Migrator.verbose_schema_migration/3
(ecto_sql 3.11.3) lib/ecto/migrator.ex:563: Ecto.Migrator.lock_for_migrations/4
(ecto_sql 3.11.3) lib/ecto/migrator.ex:432: Ecto.Migrator.run/4
(ecto_sql 3.11.3) lib/ecto/migrator.ex:170: Ecto.Migrator.with_repo/3
nofile:1: (file)
Stopping containers...
Pruned containers: [24e7384f9c3dc72e7b7c02e3af4e2f3fa83d88cba9f41b36b0e38f2e85ab77bf]
Pruned volumes: [supabase_db_temp-supabase supabase_config_temp-supabase]
Pruned network: [supabase_network_temp-supabase]
error running container: exit 1
To Reproduce
- Download a backup from hosted Supabase backup
- Unzip the backup
- Follow steps from https://supabase.com/docs/guides/local-development/restoring-downloaded-backup#restoring-your-backup
- See error
https://github.com/user-attachments/assets/827f8ad1-8b6d-4f8c-97dd-30970da087a1
Expected behavior
No errors.
Screenshots
System information
- OS: macOS
- Version of Supabase CLI: 2.22.6
- Postgres version: 15.6.1.115
Moved over from the supabase repo.
facing same issues.
Could you share the project ref? I need to take a closer look on the backup file.
No project ref needed, you should get this error with any .backup file, even if the file is empty.
hello, i also had a (DBConnection.ConnectionError) on supabase start, in my case it was the wrong docker context.
The error actually comes from realtime container failing to boot. In the latest cli, we actually skip the service containers when restoring from backup. So the first thing you need to try is to use the latest cli.
npx supabase@latest db start --from-backup ...
Secondly, realtime container failing to start is usually a red herring for other failures when restoring the backup file. So if the latest cli doesn't work, please send me your project ref so I can take a closer look on a case by case basis.