Postgres Password Issue

Hello,

I’m running Gogs using docker with Postgres 10.3 as the DB which is also running in Docker. I’m using the latest Gogs docker image as of Sept 7th, 2020. The ImageID is 93198a4bd628.

As soon as I upgraded to this latest image, Gogs is not able to connect to the DB anymore. The Postgres logs show this,
2020-09-07 14:25:28.427 UTC [199] FATAL: password authentication failed for user “gogs”
2020-09-07 14:25:28.427 UTC [199] DETAIL: Password does not match for user “gogs”.
Connection matched pg_hba.conf line 95: “host all all all md5”

Using DBeaver I tested connecting to the DB as the gogs user and it works. I changed the password and reconfirmed connectivity using DBeaver but the Gogs docker container can’t connect. The same error appears in the Postgres logs.

Here’s the Gogs config portion for the DB
[database]
DB_TYPE = postgres
HOST = 192.168.0.10:5432
NAME = gogs
USER = gogs
PASSWD = secret123
SSL_MODE = disable
PATH = data/gogs.db

Any help and suggestions are appreciated.

I did some testing and pulled down an older 0.12.1 version (11 days old) of Gogs from Dockerhub and it connected to the DB without issue. Here’s the docker command I’m using to create the container

sudo docker create --name=gogs -p 8322:22 -p 8300:3000 -v /var/opt/docker/gogs:/data --link postgres:postgres --restart unless-stopped --dns=8.8.8.8 gogs/gogs:0.12.1

I deleted that 0.12.1 image and re-pulled the latest image and the DB password problem came back.

After checking out the Gogs release listing in Github (https://github.com/gogs/gogs/releases) I see that 0.12.1 is the latest official release. I’ll run that until there’s another release.

If the maintainer happens to see this, please let me know if there’s any info I can send your way in case this is a bug.

Looks like I found my answer in the release notes for 0.12.0

Configuration option [database] PASSWD is deprecated and will end support in 0.13.0, please start using [database] PASSWORD .