Spinney
02/08/2022, 8:38 PMdocker-compose up
even though supabase-db
is successfully created and started.docker-compose -f docker-compose.yml -f ./dev/docker-compose.dev.yml up
using default .env details. Everything works great until one of the containers tries to query the database when I get the following:
prolog
supabase-rest | An error ocurred when trying to query database settings for the config parameters
supabase-rest | ConnectionError (Just "connection to server at \"db\" (172.19.0.4), port 5432 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?\n")
supabase-rest | Attempting to connect to the database...
supabase-rest | {"details":"connection to server at \"db\" (172.19.0.4), port 5432 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?\n"}
...
supabase-auth | level=fatal msg="running db migrations: Migrator: problem creating schema migrations: couldn't start a new transaction: could not create new transaction: failed to connect to `host=db user=postgres database=postgres`: dial error (dial tcp 172.19.0.4:5432: connect: connection refused)"
I'm pretty new to all of this (and especially docker) so I don't know what to try next. No error logs. I'm on Debian 11 on Digitalocean, but I also tried the one-click docker image on Ubuntu 20.04 and got the same issue. I don't think there are any firewall entries besides the ones docker has made. Don't see any relevant issues on Github, and can't find any good tutorials on how to properly self-host on a vps (besides the catch-all self-hosting docs). Any suggestions? I feel like I'm probably just missing something stupid 😦 Since I'm still using default .env so I shouldn't have to make any updates to docker-compose.yml right?jason-lynx
02/09/2022, 3:04 AMdocker-compose.yml
should be enough?Spinney
02/09/2022, 4:17 AMjason-lynx
02/09/2022, 6:38 AMSpinney
02/09/2022, 6:05 PMss -ltp
shows only docker processes with the exception of ssh, so nothing else is running on any ports as far as I can tell.
Here are the exact steps I took if anyone can point out something I'm doing wrong or wants to try to replicate the issue on DO's one-click docker image:
bash
# Install Docker Compose v2:
$mkdir -p /usr/local/lib/docker/cli-plugins
$curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose
$chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
# Install Supabase:
$git clone --depth 1 https://github.com/supabase/supabase /etc/supabase
$cd /etc/supabase/docker
$cp .env.example .env
$docker-compose up
Scott P
02/09/2022, 6:17 PM/docker/docker-compose.yml
.
Copy the contents of the .env file (https://github.com/supabase/supabase/blob/master/docker/.env.example) to a blank file, and update the values. At the very least, change the POSTGRES_PASSWORD
, JWT_SECRET
, ANON_KEY
and SERVICE_ROLE_KEY
. Back in the Portainer dashboard, paste them into environmental variables (click 'Advanced' and it'll let you paste all of them).
Click 'deploy' near the bottom, and after a few minutes it should be running. I did notice that some of the stacks didn't start properly when I did a recent deployment, and ultimately I think it was an issue with 1 or more of the containers not being on the correct network. At the very least, it's easier to view logs for each container in the stack and it should get you close enough that basic troubleshooting will help you get the final parts up and running.Spinney
02/09/2022, 7:19 PMtime="2022-02-09T19:13:52Z" level=fatal msg="running db migrations: Migrator: problem creating schema migrations: couldn't start a new transaction: could not create new transaction: failed to connect to 'host=db user=postgres database=postgres': dial error (dial tcp 172.18.0.4:5432: connect: connection refused)"
but you're right, it is easier to view logs and retry in Portainer. I will take another look when I have some more time and see if I can find anything I missed before.