Docker Permission Denied when running "wasp start db"

Full Error Message: <USER>@DESKTOP-<stuff>:~/Projects/<saas-proj>/app$ 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/OpenSaaS-d41288806f ℹ 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-OpenSaaS-d41288806f ... docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create?name=wasp-dev-db-OpenSaaS-d41288806f": dial unix /var/run/docker.sock: connect: permission denied. See 'docker run --help'. wasp-bin: callCommand: docker run --name wasp-dev-db-OpenSaaS-d41288806f --rm --publish 5432:5432 -v wasp-dev-db-OpenSaaS-d41288806f:/var/lib/postgresql/data --env POSTGRES_PASSWORD=postgresWaspDevPass --env POSTGRES_USER=postgresWaspDevUser --env POSTGRES_DB=OpenSaaS-d41288806f postgres (exit 126): failed
6 Replies
kapa.ai
kapa.ai3mo ago
Hi @themayhem_. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The error message you're seeing indicates that Docker is not able to access the necessary resources due to permission issues. This is a common issue when running Docker commands without sufficient permissions. Here are some steps you can try to resolve this issue: 1. Ensure Docker is running: The error could be due to Docker not running. You can check if Docker is running with the command docker info. If it's not running, you'll need to start it. 2. Check Docker permissions: If Docker is running but you're still seeing the error, it's likely a permissions issue. Docker requires certain permissions to access resources like the Docker daemon socket. You might need to adjust these permissions or run the command with sudo. 3. Run Docker command manually: You can try running the Docker command that Wasp is trying to run manually to see if that works. The command is included in the error message you posted. Here it is for convenience:
docker run --name wasp-dev-db-OpenSaaS-d41288806f --rm --publish 5432:5432 -v wasp-dev-db-OpenSaaS-d41288806f:/var/lib/postgresql/data --env POSTGRES_PASSWORD=postgresWaspDevPass --env POSTGRES_USER=postgresWaspDevUser --env POSTGRES_DB=OpenSaaS-d41288806f postgres
docker run --name wasp-dev-db-OpenSaaS-d41288806f --rm --publish 5432:5432 -v wasp-dev-db-OpenSaaS-d41288806f:/var/lib/postgresql/data --env POSTGRES_PASSWORD=postgresWaspDevPass --env POSTGRES_USER=postgresWaspDevUser --env POSTGRES_DB=OpenSaaS-d41288806f postgres
If you're still having trouble, it might be helpful to look at the Docker documentation (https://docs.docker.com/get-started/overview/) or seek help from the Docker community. Please note that these instructions are based on the information available in the provided knowledge sources and may not cover all possible issues causing the error you're seeing. If the problem persists, it would be best to seek further assistance from the Wasp community or Docker support. Sources: - Discord support thread: Cant start database docker is not working on wsl properly > Answers Part 1 (https://discord.com/channels/686873244791210014/1194876839911510046) - Discord support thread: Cant start database docker is not working on wsl properly > Answers Part 3 (https://discord.com/channels/686873244791210014/1194876839911510046) - Github Issue (open): Have wasp start db produce nice warning message if docker daemon is not running > Original post (https://github.com/wasp-lang/wasp/issues/1135) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speechballoon: ---------------------- Sorry @themayhem, 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?
themayhem_
themayhem_3mo ago
I was able to run it manually at least. How can I allow it to be ran using wasp from vsCode?
MEE6
MEE63mo ago
Wohooo @themayhem_, you just became a Waspeteer level 1!
miho
miho3mo ago
Does Docker work for you in general? Have you used it successfully for running some other things?
themayhem_
themayhem_3mo ago
yeah- I was able to run the docker DB successfully, but Manually via WSL not with wasp that's fine I've been struggling to connect to the db via pg admin , that is on the parent OS
Want results from more Discord servers?
Add your server