W
Wasp4w ago
wardbox

Running wasp start db locally errors

 wasp start db
✨ Starting a PostgreSQL dev database (based on your Wasp config) ✨

Additional info:
ℹ Connection URL, in case you might want to connect with external tools:
postgresql://postgresWaspDevUser:postgresWaspDevPass@localhost:5432/sdcmanager-71577e3a77
ℹ Database data is persisted in a docker volume with the following name (useful to know if you will want to delete it at some point):
wasp-dev-db-sdcmanager-71577e3a77

...
Error: in 18+, these Docker images are configured to store database data in a
format which is compatible with "pg_ctlcluster" (specifically, using
major-version-specific directory names). This better reflects how
PostgreSQL itself works, and how upgrades are to be performed.

See also https://github.com/docker-library/postgres/pull/1259

Counter to that, there appears to be PostgreSQL data in:
/var/lib/postgresql/data (unused mount/volume)

This is usually the result of upgrading the Docker image without
upgrading the underlying database using "pg_upgrade" (which requires both
versions).

The suggested container configuration for 18+ is to place a single mount
at /var/lib/postgresql which will then place PostgreSQL data in a
subdirectory, allowing usage of "pg_upgrade --link" without mount point
boundary issues.

See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
wasp-bin: callCommand: docker run --name wasp-dev-db-sdcmanager-71577e3a77 --rm --publish 5432:5432 -v wasp-dev-db-sdcmanager-71577e3a77:/var/lib/postgresql/data --env POSTGRES_PASSWORD=postgresWaspDevPass --env POSTGRES_USER=postgresWaspDevUser --env POSTGRES_DB=sdcmanager-71577e3a77 postgres (exit 1): failed
 wasp start db
✨ Starting a PostgreSQL dev database (based on your Wasp config) ✨

Additional info:
ℹ Connection URL, in case you might want to connect with external tools:
postgresql://postgresWaspDevUser:postgresWaspDevPass@localhost:5432/sdcmanager-71577e3a77
ℹ Database data is persisted in a docker volume with the following name (useful to know if you will want to delete it at some point):
wasp-dev-db-sdcmanager-71577e3a77

...
Error: in 18+, these Docker images are configured to store database data in a
format which is compatible with "pg_ctlcluster" (specifically, using
major-version-specific directory names). This better reflects how
PostgreSQL itself works, and how upgrades are to be performed.

See also https://github.com/docker-library/postgres/pull/1259

Counter to that, there appears to be PostgreSQL data in:
/var/lib/postgresql/data (unused mount/volume)

This is usually the result of upgrading the Docker image without
upgrading the underlying database using "pg_upgrade" (which requires both
versions).

The suggested container configuration for 18+ is to place a single mount
at /var/lib/postgresql which will then place PostgreSQL data in a
subdirectory, allowing usage of "pg_upgrade --link" without mount point
boundary issues.

See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
wasp-bin: callCommand: docker run --name wasp-dev-db-sdcmanager-71577e3a77 --rm --publish 5432:5432 -v wasp-dev-db-sdcmanager-71577e3a77:/var/lib/postgresql/data --env POSTGRES_PASSWORD=postgresWaspDevPass --env POSTGRES_USER=postgresWaspDevUser --env POSTGRES_DB=sdcmanager-71577e3a77 postgres (exit 1): failed
i have verified there's no data in the /var/lib/postgresql/data mount/volume, and i have no volumes listed in docker and i still get this issue. I'm on 0.18.1 running on a mac
16 Replies
kapa.ai
kapa.ai4w ago
Hi @wardbox. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The error you're encountering is related to changes in how PostgreSQL Docker images (version 18+) handle data storage, specifically the directory structure for database data. The error message suggests a mismatch between the expected data directory structure and what is present in your Docker volume. This is a known issue when upgrading to newer PostgreSQL Docker images without migrating the underlying data using tools like pg_upgrade. From your description, even though you have no volumes listed and no data in the mount, the error persists. This suggests that the default volume or mount configuration used by Wasp's wasp start db command is not compatible with the new requirements of the PostgreSQL 18+ Docker image. What is happening: - Wasp runs PostgreSQL in a Docker container, mounting a Docker volume at /var/lib/postgresql/data. - PostgreSQL 18+ expects the data directory to be structured differently (see the links in your error message). - If the volume was previously used with an older PostgreSQL version, or if the mount is not set up as PostgreSQL 18+ expects, you get this error. What you can do: - The knowledge sources do not provide a direct solution for this specific PostgreSQL 18+ Docker image issue. - However, they do show that Wasp uses a Docker volume named like wasp-dev-db-<project> for persisting data, and you can safely delete this volume if you don't need to preserve any data. This will force Docker to create a fresh volume with the correct structure the next time you run wasp start db. How to delete the volume: 1. List your Docker volumes:
docker volume ls

docker volume ls

2. Remove the problematic volume (replace the name with your actual volume name, e.g., wasp-dev-db-sdcmanager-71577e3a77):
docker volume rm wasp-dev-db-sdcmanager-71577e3a77

docker volume rm wasp-dev-db-sdcmanager-71577e3a77

3. Try running wasp start db again. Note: This will delete all data in the development database for this project. If you continue to have issues, you might want to try running the database manually with a compatible Docker command, as suggested in the knowledge sources:
docker run --name mydb -p 5432:5432 -v mydb:/var/lib/postgresql/data -e POSTGRES_PASSWORD=postgresWaspDevPass -e POSTGRES_USER=postgresWaspDevUser -e POSTGRES_DB=mydb --rm postgres:16
docker run --name mydb -p 5432:5432 -v mydb:/var/lib/postgresql/data -e POSTGRES_PASSWORD=postgresWaspDevPass -e POSTGRES_USER=postgresWaspDevUser -e POSTGRES_DB=mydb --rm postgres:16
This uses PostgreSQL 16, which may avoid the new directory structure issue for now, but is a workaround and not a long-term fix if you need PostgreSQL 18+ features. You can then set your DATABASE_URL accordingly in your environment before running your Wasp appSchedule email with sendgrid. Summary:
- Delete the existing Docker volume for your Wasp project and try again. - If you need to use PostgreSQL 18+, ensure your Docker volume and mount points are set up as per the new requirements (see the links in your error message for advanced configuration). - Alternatively, use an older PostgreSQL image (e.g., 16) as a temporary workaround. If you need more detailed help with configuring the mount points for PostgreSQL 18+, the knowledge sources do not provide step-by-step instructions, so you may need to refer to the official PostgreSQL Docker documentation or the links provided in your error message. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @wardbox, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
wardbox
wardboxOP4w ago
i delete it and it still doesn't work
 docker volume ls
DRIVER VOLUME NAME
local wasp-dev-db-sdcmanager-71577e3a77

dylank in sdc-manager on  main [$] via ⬢ v22.12.0
 docker volume rm wasp-deb-db-sdcmanager-71577e3a77
Error response from daemon: get wasp-deb-db-sdcmanager-71577e3a77: no such volume

dylank in sdc-manager on  main [$] via ⬢ v22.12.0
 docker volume rm wasp-dev-db-sdcmanager-71577e3a77
wasp-dev-db-sdcmanager-71577e3a77

dylank in sdc-manager on  main [$] via ⬢ v22.12.0
 docker volume ls
DRIVER VOLUME NAME

dylank in sdc-manager on  main [$] via ⬢ v22.12.0
 wasp start db
✨ Starting a PostgreSQL dev database (based on your Wasp config) ✨

Additional info:
ℹ Connection URL, in case you might want to connect with external tools:
postgresql://postgresWaspDevUser:postgresWaspDevPass@localhost:5432/sdcmanager-71577e3a77
ℹ Database data is persisted in a docker volume with the following name (useful to know if you will want to delete it at some point):
wasp-dev-db-sdcmanager-71577e3a77

...
Error: in 18+, these Docker images are configured to store database data in a
format which is compatible with "pg_ctlcluster" (specifically, using
major-version-specific directory names). This better reflects how
PostgreSQL itself works, and how upgrades are to be performed.

See also https://github.com/docker-library/postgres/pull/1259

Counter to that, there appears to be PostgreSQL data in:
/var/lib/postgresql/data (unused mount/volume)

This is usually the result of upgrading the Docker image without
upgrading the underlying database using "pg_upgrade" (which requires both
versions).

The suggested container configuration for 18+ is to place a single mount
at /var/lib/postgresql which will then place PostgreSQL data in a
subdirectory, allowing usage of "pg_upgrade --link" without mount point
boundary issues.

See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
wasp-bin: callCommand: docker run --name wasp-dev-db-sdcmanager-71577e3a77 --rm --publish 5432:5432 -v wasp-dev-db-sdcmanager-71577e3a77:/var/lib/postgresql/data --env POSTGRES_PASSWORD=postgresWaspDevPass --env POSTGRES_USER=postgresWaspDevUser --env POSTGRES_DB=sdcmanager-71577e3a77 postgres (exit 1): failed
 docker volume ls
DRIVER VOLUME NAME
local wasp-dev-db-sdcmanager-71577e3a77

dylank in sdc-manager on  main [$] via ⬢ v22.12.0
 docker volume rm wasp-deb-db-sdcmanager-71577e3a77
Error response from daemon: get wasp-deb-db-sdcmanager-71577e3a77: no such volume

dylank in sdc-manager on  main [$] via ⬢ v22.12.0
 docker volume rm wasp-dev-db-sdcmanager-71577e3a77
wasp-dev-db-sdcmanager-71577e3a77

dylank in sdc-manager on  main [$] via ⬢ v22.12.0
 docker volume ls
DRIVER VOLUME NAME

dylank in sdc-manager on  main [$] via ⬢ v22.12.0
 wasp start db
✨ Starting a PostgreSQL dev database (based on your Wasp config) ✨

Additional info:
ℹ Connection URL, in case you might want to connect with external tools:
postgresql://postgresWaspDevUser:postgresWaspDevPass@localhost:5432/sdcmanager-71577e3a77
ℹ Database data is persisted in a docker volume with the following name (useful to know if you will want to delete it at some point):
wasp-dev-db-sdcmanager-71577e3a77

...
Error: in 18+, these Docker images are configured to store database data in a
format which is compatible with "pg_ctlcluster" (specifically, using
major-version-specific directory names). This better reflects how
PostgreSQL itself works, and how upgrades are to be performed.

See also https://github.com/docker-library/postgres/pull/1259

Counter to that, there appears to be PostgreSQL data in:
/var/lib/postgresql/data (unused mount/volume)

This is usually the result of upgrading the Docker image without
upgrading the underlying database using "pg_upgrade" (which requires both
versions).

The suggested container configuration for 18+ is to place a single mount
at /var/lib/postgresql which will then place PostgreSQL data in a
subdirectory, allowing usage of "pg_upgrade --link" without mount point
boundary issues.

See https://github.com/docker-library/postgres/issues/37 for a (long)
discussion around this process, and suggestions for how to do so.
wasp-bin: callCommand: docker run --name wasp-dev-db-sdcmanager-71577e3a77 --rm --publish 5432:5432 -v wasp-dev-db-sdcmanager-71577e3a77:/var/lib/postgresql/data --env POSTGRES_PASSWORD=postgresWaspDevPass --env POSTGRES_USER=postgresWaspDevUser --env POSTGRES_DB=sdcmanager-71577e3a77 postgres (exit 1): failed
@kapa.ai
kapa.ai
kapa.ai4w ago
Let me check the knowledge base for you again. One moment! :books: Sorry @wardbox, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
wardbox
wardboxOP4w ago
i tried running 16 manually but i get this
2025-11-01 19:43:16.754 UTC [64] LOG: database system was shut down at 2025-11-01 19:43:16 UTC
2025-11-01 19:43:16.756 UTC [1] LOG: database system is ready to accept connections
2025-11-01 19:44:14.626 UTC [70] FATAL: database "sdcmanager-71577e3a77" does not exist
2025-11-01 19:44:25.756 UTC [72] FATAL: database "sdcmanager-71577e3a77" does not exist
2025-11-01 19:43:16.754 UTC [64] LOG: database system was shut down at 2025-11-01 19:43:16 UTC
2025-11-01 19:43:16.756 UTC [1] LOG: database system is ready to accept connections
2025-11-01 19:44:14.626 UTC [70] FATAL: database "sdcmanager-71577e3a77" does not exist
2025-11-01 19:44:25.756 UTC [72] FATAL: database "sdcmanager-71577e3a77" does not exist
@kapa.ai
kapa.ai
kapa.ai4w ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- The error message:
FATAL: database "sdcmanager-71577e3a77" does not exist
FATAL: database "sdcmanager-71577e3a77" does not exist
means that your PostgreSQL server is running, but the specific database your Wasp app expects (sdcmanager-71577e3a77) has not been created yet. According to the knowledge sources, Wasp previously handled database creation automatically when running commands like wasp db migrate-dev or wasp start. However, there was a regression where Wasp no longer creates the database if it doesn't exist, and instead just reports that it is missing. This is a known issue mentioned in the sources:
Wasp tells you that the database doesn't exist and does not create it.
This is a recent regression.
Fix database initialization
What you should do: You need to manually create the database inside your running PostgreSQL container. You can do this by connecting to the database as the postgres user and running a CREATE DATABASE command. For example:
docker exec -it mydb psql -U postgres -c "CREATE DATABASE \"sdcmanager-71577e3a77\";"
docker exec -it mydb psql -U postgres -c "CREATE DATABASE \"sdcmanager-71577e3a77\";"
Replace mydb with the name of your running container if different. After creating the database, your Wasp app should be able to connect and proceed as expected. If you continue to have issues, ensure your DATABASE_URL is set correctly and matches the database name you created. Let me know if you need the exact steps for your setup! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @wardbox, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
wardbox
wardboxOP4w ago
@kapa.ai running the db migration worked. I think i should definitely still be able to run wasp start db but this workaround is good for now
kapa.ai
kapa.ai4w ago
Let me check the knowledge base for you again. One moment! :books:
MEE6
MEE64w ago
Wohooo @wardbox, you just became a Waspeteer level 14!
kapa.ai
kapa.ai4w ago
---------------------- You're correct that you should be able to run wasp start db to start a managed development database—this is the intended developer experience in Wasp. The command is designed to spin up a PostgreSQL database in Docker and connect your app to it automatically, as long as Docker is installed and running, and port 5432 is available. If you encounter issues, such as database initialization errors or compatibility problems with newer PostgreSQL Docker images, these are known pain points and have been discussed in the Wasp community and issue tracker. Your workaround of running the migration and manually creating the database is valid and aligns with the current state of Wasp, especially given the recent regression where Wasp no longer creates the database automatically if it doesn't exist. The Wasp team is aware of this and has discussed possible solutions, including reverting to previous behavior or improving the database initialization logic to better match Prisma's approachFix database initialization. If you continue to have trouble with wasp start db, you can also run the database manually with Docker and set the DATABASE_URL environment variable, as described in the documentation. This gives you flexibility while the Wasp team works on improving the managed database experienceConnecting to a Database. If you need to use PostgreSQL 18+ and encounter volume/mount issues, you may need to follow the official Docker image recommendations or use an older image (like 16) as a temporary workaround, as the knowledge sources do not provide a Wasp-specific solution for this yet. In summary:
- wasp start db is the intended way to run a dev database, but manual workarounds are sometimes necessary due to current limitations. - Running migrations manually is a valid workaround. - The Wasp team is aware of these issues and improvements are being discussed. If you have further issues or need more specific help, feel free to ask! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @wardbox, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
martinsos
martinsos4w ago
@wardbox this is weird, after you deleted the old volume, it should have worked. Old volume was named wasp-dev-db-sdcmanager-71577e3a77, you did delete that one right? Maybe it is sensitive also to any old volumes. But you said you deleted all of them. We will have somebody look at this into more details, it is a bit unusual that your fix didn't work I think! @miho @Carlos FYI
wardbox
wardboxOP4w ago
I deleted all of them to make sure lol My suspicion (after not researching how it works in the least and wild guessing) is there’s something about how wasp configures it that worked with 16, maybe 18 just dropped and changed something? Idk
martinsos
martinsos4w ago
Hm maybe, I actually implemented wasp db start and I can't think of something that specific off the bat, that would be problematic, but we will look into it for sure.
wardbox
wardboxOP4w ago
Ya just shooting blind lol
martinsos
martinsos4w ago
aren't we all hehe
miho
miho3w ago
Hey @wardbox we misdiagnosed this as a previous issue we faced. I've created an issue for this now: https://github.com/wasp-lang/wasp/issues/3321 where I list some workarounds for older Wasp versions. We are going to release a hotfix for version 0.18.X today/tomorrow.
GitHub
wasp db start fails with latest Postgres 18 version · Issue #332...
Reproduction Wasp version: 0.18.1 (latest at the time of writing) Reproduction steps: # Force Docker to fetch PG 18 docker image rm postgres:latest # Create a new app cd /tmp wasp new saas-app -t s...
miho
miho3w ago
Wasp 0.18.2 is out which comes with a fix for the failing wasp db start command! Update to the latest version by running: curl -sSL https://get.wasp.sh/installer.sh | sh -s

Did you find this page helpful?