Hello, I need to change the GItea DB Password as I was using the default at first.
I am using gitea through docker. I docker exec-ed into the db container and changed the password of the postgres “gitea” user.
I then stopped the stack, replaced the DB password in the envrionment variables and started it again. After that the containers are complaining that they cant authenticates as user “gitea”.
I am confused because the password in the environment variable is 100% the one I changed it to. I re-tested this by again exec-ing into the container and logging into the db using that exact password.
Is there anything else that needs to be adjusted that I am unaware of? Thanks in advance for any help!
Here my docker compose file:
Summary
name: gitea
services:
gitea:
image: gitea/gitea:1.23
container_name: gitea
restart: unless-stopped
depends_on:
- db
volumes:
- /docker/gitea:/data:rw
- /etc/TZ:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
environment:
- GITEA__database__DB_TYPE=postgres
- GITEA__database__HOST=db:5432
- GITEA__database__NAME=gitea
- GITEA__database__USER=$GITEA_DB_USER
- GITEA__database__PASSWD=$GITEA_DB_PW
db:
container_name: gitea-postgres
image: postgres:14
restart: unless-stopped
networks:
- gitea
- traefik
volumes:
- /docker/gitea-postgres:/var/lib/postgresql/data:rw
environment:
- POSTGRES_DB=gitea
- POSTGRES_USER=$GITEA_DB_USER
- POSTGRES_PASSWORD=$GITEA_DB_PW
Here what the db containers keeps repeating:
Summary
gitea-postgres | 2025-01-26 23:42:56.696 UTC [206] DETAIL: Connection matched pg_hba.conf line 100: “host all all all scram-sha-256”
gitea-postgres | 2025-01-26 23:42:59.700 UTC [207] FATAL: password authentication failed for user “gitea”
gitea-postgres | 2025-01-26 23:42:59.700 UTC [207] DETAIL: Connection matched pg_hba.conf line 100: “host all all all scram-sha-256”
Here what the gitea container says:
Summary
gitea | 2025/01/27 00:43:09 routers/init.go:139:InitWebInstalled() [I] SQLite3 support is enabled
gitea | 2025/01/27 00:43:09 routers/common/db.go:23:InitDBEngine() [I] Beginning ORM engine initialization.
gitea | 2025/01/27 00:43:09 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #1/10…
gitea | 2025/01/27 00:43:09 cmd/web.go:205:serveInstalled() [I] PING DATABASE postgres
gitea | 2025/01/27 00:43:09 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: pq: password authentication failed for user “gitea”
gitea | 2025/01/27 00:43:09 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
gitea | 2025/01/27 00:43:12 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #2/10…
gitea | 2025/01/27 00:43:12 cmd/web.go:205:serveInstalled() [I] PING DATABASE postgres
gitea | 2025/01/27 00:43:12 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: pq: password authentication failed for user “gitea”
gitea | 2025/01/27 00:43:12 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
gitea | 2025/01/27 00:43:15 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #3/10…
gitea | 2025/01/27 00:43:15 cmd/web.go:205:serveInstalled() [I] PING DATABASE postgres
gitea | 2025/01/27 00:43:15 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #3/10 failed. Error: pq: password authentication failed for user “gitea”
gitea | 2025/01/27 00:43:15 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
gitea | 2025/01/27 00:43:18 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #4/10…
gitea | 2025/01/27 00:43:18 cmd/web.go:205:serveInstalled() [I] PING DATABASE postgres
gitea | 2025/01/27 00:43:18 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #4/10 failed. Error: pq: password authentication failed for user “gitea”
gitea | 2025/01/27 00:43:18 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
gitea | 2025/01/27 00:43:21 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #5/10…
gitea | 2025/01/27 00:43:21 cmd/web.go:205:serveInstalled() [I] PING DATABASE postgres
gitea | 2025/01/27 00:43:21 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #5/10 failed. Error: pq: password authentication failed for user “gitea”
gitea | 2025/01/27 00:43:21 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
gitea | 2025/01/27 00:43:24 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #6/10…
gitea | 2025/01/27 00:43:24 cmd/web.go:205:serveInstalled() [I] PING DATABASE postgres
gitea | 2025/01/27 00:43:24 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #6/10 failed. Error: pq: password authentication failed for user “gitea”
gitea | 2025/01/27 00:43:24 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
gitea | 2025/01/27 00:43:27 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #7/10…
gitea | 2025/01/27 00:43:27 cmd/web.go:205:serveInstalled() [I] PING DATABASE postgres
gitea | 2025/01/27 00:43:27 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: pq: password authentication failed for user “gitea”
gitea | 2025/01/27 00:43:27 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
gitea | 2025/01/27 00:43:30 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #8/10…
gitea | 2025/01/27 00:43:30 cmd/web.go:205:serveInstalled() [I] PING DATABASE postgres
gitea | 2025/01/27 00:43:30 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #8/10 failed. Error: pq: password authentication failed for user “gitea”
gitea | 2025/01/27 00:43:30 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
gitea | 2025/01/27 00:43:33 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #9/10…
gitea | 2025/01/27 00:43:33 cmd/web.go:205:serveInstalled() [I] PING DATABASE postgres
gitea | 2025/01/27 00:43:33 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #9/10 failed. Error: pq: password authentication failed for user “gitea”
gitea | 2025/01/27 00:43:33 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds