cli
cli copied to clipboard
Cannot start supabase after stopping
Bug report
Describe the bug
After stopping local supabase with Ctrl+C
, subsequent supabase start
calls fail with the error: Error starting database: ERROR: database "main" does not exist
.
There is a SQL dump inside supabase/.branches/main
directory.
I then have to nuke my supabase directory, then re-init.
To Reproduce
-
supabase init
-
supabase start
-
Ctrl+C
once instance is up -
supabase start
- See error
Expected behavior
supabase start
restarts the instance once stopped.
System information
- OS: macOS
- Version of supabase-js: 0.15.14
- Version of Node.js: 14.18.1
Additional context
Fairly new to the Go CLI, I was using the old Docker setup without incident, so possibly I'm missing something simple.
Sorry for the late reply! Can you see if the latest version (v0.16.1) fixes this? Issues related to branching should be curbed a bit. The new repro steps would be:
-
supabase init
-
supabase start
-
supabase stop
-
supabase start
I also had this same issue. It seems to be running now after upgrading to the latest (0.17.2 as of writing).
Closing this issue since the containers are started in background in cli v1.
This issue still regresses with cli v1.33.0.
Steps to reproduce:
- supabase init
- supabase start
- Used the studio to create a schema and a table
- supabase stop
- supabase start --debug
Error ("Error restoring main: branch was not dumped")
file attached
its obviously related to the .branch directory - when I delete the .branch it starts up fine, but I lose all the state and start from scratch.
@leesus this is probably just a misleading log statement. Can you check supabase status
after start to see if the db is actually running?
the containers are all terminated. so status returns an error.
…/supabase/projects/pragma/supabase supabase status
Error: Error: No such container: supabase_db_pragma Try rerunning the command with --debug to troubleshoot the error.
after the start, still errors
…/supabase/projects/pragma/supabase supabase start Error restoring main: branch was not dumped. Error: unlinkat supabase/.branches/main: operation not permitted Try rerunning the command with --debug to troubleshoot the error.
Error: unlinkat supabase/.branches/main: operation not permitted
This is a problem with local directory permission. Have you modified this before with chown/chmod? A quick fix is to delete .branches/main
Getting the same error on every start even if i delete the .branches/main folder, but i dont have a db dump in that folder.
The supabase status
returns no errors, i also dont get the unlinkat error, just the Error restoring main: branch was not dumped.
I guess it is not able to do a sql dump in that folder?
Using 1.34.5
same error