Supabase local start fails: `/init-scripts/99-roles.sql` not found, despite correct placement
Describe the bug
I'm encountering a persistent failure when running npx supabase start locally.
To Reproduce Steps to reproduce the behavior:
- Create a Supabase project via CLI.
- Create
supabase/init/99-roles.sqlfile with comment-only content. - Run
npx supabase start - Observe the database container entering a restart loop.
- Error log shows:
psql: error: /docker-entrypoint-initdb.d/init-scripts/99-roles.sql: No such file or directory
Expected behavior
The database container should find 99-roles.sql if it's located inside supabase/init/, as per documentation. The container should initialize successfully and report as healthy.
Screenshots Error output:
psql: error: /docker-entrypoint-initdb.d/init-scripts/99-roles.sql: No such file or directory Stopping containers... supabase_db_RoofQuote6.3.25 container is not ready: unhealthy
Folder structure: /supabase ├── init/ │ └── 99-roles.sql
Confirmed file contents:
-- custom roles live here
**System information**
Rerun the failing command with --create-ticket flag.
Ticket ID: (Supabase CLI didn’t return a usable ticket ID — just displayed help text)
Version of OS: Windows 10 Home with WSL2
Version of CLI: 2.24.3
Version of Docker: 25.0.3
- Versions of services: [output from `supabase services` command]
$ supabase services
Error: supabase local development setup is not running.
**Additional context**
Supabase CLI installed via npx
Docker Desktop running with WSL2 integration
WSL reports:
wsl --list --verbose
Ubuntu (Running) - Version 2
docker-desktop (Running) - Version 2
No migrations or database schema applied yet — container fails during base init
Attempted fixes:
Verified file exists at supabase/init/99-roles.sql
Tried renaming to roles.sql
Removed Docker volumes, restarted CLI, tried --debug mode
CLI keeps mounting an invalid path /init-scripts/99-roles.sql
Running npx supabase start --debug gives same result
Please advise if there is a known fix, or if supabase/init/roles.sql is now the only supported file name/location.
"Fixes Attempted" Section for the Ticket
### Fixes Attempted (Chronological Summary)
1. ✅ Verified Docker & WSL2 were correctly installed and running (Ubuntu is WSL2).
2. ✅ Created empty SQL script `99-roles.sql` in `supabase/init/` and later in `supabase/init-scripts/`.
3. ✅ Updated filename and paths multiple times: `supabase/init/`, `supabase/init-scripts/`, and `supabase/docker-entrypoint-initdb.d/`.
4. ✅ Switched filename to `roles.sql` and moved it directly under `supabase/roles.sql` per documentation.
5. ✅ Ensured file was not empty (`-- custom roles live here` as a placeholder).
6. ✅ Ran `npx supabase stop` and deleted all volumes via `docker volume rm $(...)`.
7. ✅ Verified volumes were removed (`supabase_config_*`, `supabase_db_*`) using `docker volume ls`.
8. ✅ Restarted stack with `npx supabase start` after every file path change.
9. ✅ Verified project tree using VS Code and confirmed correct structure and file presence.
10. ✅ Confirmed Supabase CLI version `2.24.3` and Docker was functioning.
11. ✅ Confirmed `supabase_db_*` container was stuck in an unhealthy restart loop.
12. ✅ Attempted to run with `--debug` flag for more detailed logging.
13. ✅ Tried alternate naming and mounting conventions based on Supabase CLI assumptions.
14. ❌ CLI still reports `psql: error: /docker-entrypoint-initdb.d/init-scripts/99-roles.sql: No such file or directory` despite all the above.
HELP ive been on this for hours!!!! then i see BUG CLI
Hey man, there is discussions on another issue: https://github.com/supabase/cli/issues/3632
The proposed solution is:
- stop the local instance
supabase stop - remove the postgres version file with
rm supabase/.temp/postgres-version - restart the local instance
supabase start
Hope that helps!
i have done that multiple times!!!
Have you also tried explicitly setting the version in the file? If so sorry, I'm also clueless.
- stop the local instance
supabase stop- remove the postgres version file with
rm supabase/.temp/postgres-version- restart the local instance
supabase start
This worked for me! Ive litrally tried everything and was on the verge of giving up. Thanks @fwindolf !
This works because the Supabase CLI defaults to downloading PostgreSQL 15. However, our production project uses PostgreSQL 17, leading to this error when linking (supabase link). Naturally, we want our local environment to match the production database version, so the proposed solution isn't ideal for us.
Same, this wasn't satisfactory solution for me, but for anyone else looking there is a proper fix already and you only need to update to the latest 15 or 17 (supabase.com) and relink :) - https://github.com/supabase/cli/issues/3632#issuecomment-2961417562
supabase link
supabase stop --no-backup
supabase start
Yep, going to infrastructure and then clicking the upgrade button (which causes ~10mins of downtime for a small DB) and then re-linking (after removing the supabase folder completely) + restarting worked for me. Thanks!