Updated Coder version and now I’m getting database errors with Docker Compose

Earlier this week I got a message that Coder had a new version. I upgraded and now I’m getting an error when running the docker compose. It’s showing that the user authentication for the DB failed. Tried looking for existing discussions on this issue but could not find anything. How should I fix the DB connection?
No description
9 Replies
Codercord
Codercord5mo ago
<#1258984713385676850>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Atif
Atif5mo ago
Can you share your docker compose file? Have you made any changes?
feners4
feners4OP5mo ago
@Atif Here’s my docker compose. I’ve been trying to figure out how to solve an issue with getting vscode-web running with a wildcard url. It was working for me and stopped working so I have been changing the wildcard urls in the docker compose file. Besides that, I have not changed anything else.
version: "3.9" services: tailscale: image: tailscale/tailscale:latest hostname: tailscale ports: - "TAILSCALE_IP:7080:7080" - "TAILSCALE_IP:13338:13338" environment: - TS_AUTHKEY=tskey-auth-keygoeshere - TS_STATE_DIR=/var/lib/tailscale - TS_USERSPACE=false volumes: - ${PWD}/tailscale-nginx/state:/var/lib/tailscale - /dev/net/tun:/dev/net/tun cap_add: - net_admin - sys_module restart: unless-stopped coder: # This MUST be stable for our documentation and # other automations. image: ghcr.io/coder/coder:${CODER_VERSION:-latest} #ports: #- "TAILSCALE_IP:7080" environment: CODER_PG_CONNECTION_URL: "postgresql://${POSTGRES_USER:-username}:${POSTGRES_PASSWORD:-password}@database/${POSTGRES_DB:-coder}?sslmode=disable" CODER_HTTP_ADDRESS: "0.0.0.0:7080" # You'll need to set CODER_ACCESS_URL to an IP or domain # that workspaces can reach. This cannot be localhost # or 127.0.0.1 for non-Docker templates! CODER_ACCESS_URL: "${CODER_ACCESS_URL}" CODER_WILDCARD_ACCESS_URL: "*.coder.myserver.com" # If the coder user does not have write permissions on # the docker socket, you can uncomment the following # lines and set the group ID to one that has write # permissions on the docker socket. group_add: - "999" # docker group on host volumes: - /var/run/docker.sock:/var/run/docker.sock depends_on: database: condition: service_healthy
Phorcys
Phorcys5mo ago
hey did you figure this out? otherwise reset the password for the databse user and update the CODER_PG_CONNECTION_URL environment variable
feners4
feners4OP5mo ago
@Phorcys Hey, so I tried this and still seeing the error. I even deleted the container volume with docker volume rm coder_coder_data. To clarify, I set the env variables to new values for POSTGRES_USER and POSTGRES_PASSWORD and ran the container again. Are you saying I should change the variable names too?
Phorcys
Phorcys5mo ago
what did you do to change the password on the database instance ?
feners4
feners4OP5mo ago
Ah, sorry thought that removing the container volume would force the DB to initiate again with new creds. I was able to fix the issue running docker-compose exec database psql -U $POSTGRES_USER -d $POSTGRES_DB -c "ALTER USER $POSTGRES_USER WITH PASSWORD 'new_password';"
Phorcys
Phorcys5mo ago
yup! glad you got it figured out
Codercord
Codercord5mo ago
@Phorcys closed the thread.
Want results from more Discord servers?
Add your server