routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: pq: password authentication failed for user "gitea" #11502

Closed
opened 2025-11-02 09:39:32 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @nick-ling on GitHub (Aug 21, 2023).

Description

version: '3'

networks:
  docker-vlan:
    external: true
    name: docker-vlan
    
services:

  prod-gitea:
    image: gitea/gitea:1.20.2
    container_name: prod-gitea
    #user: root
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - GITEA__database__DB_TYPE=postgres
      - GITEA__database__HOST=db:5432
      - GITEA__database__NAME=gitea
      - GITEA__database__USER=gitea
      - GITEA__database__PASSWD=gitea
      - TZ=Asia/Shanghai
    #restart: always
    networks:
      docker-vlan:
        ipv4_address: 10.10.10.151
    volumes:
      - ./gitea/data:/data:rw
      #- ./gitea/app:/app:rw
      #- ./gitea/config:/etc/s6/gitea:rw
      #- gitea-data:/etc/gitea
      - /etc/localtime:/etc/localtime
      #- /etc/timezone:/etc/timezone:ro
    ports:
      - "3000:3000"
      - "22:22"
    depends_on:
      - 'db'
      #- 'prod-redis'
  db:
    image: postgres:14.5
    container_name: 'prod-gitea-db'
    healthcheck:
      test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "postgres" ]
      timeout: 3s
      interval: 10s
      retries: 5
    ports:
      - "5432:5432"
    restart: always
    environment:
      POSTGRES_DB: postgres
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres123456.
      TZ: Asia/Shanghai
    #command: ["postgres", "-c", "logging_collector=on", "-c", "log_directory=/logs", "-c", "log_filename=postgresql.log", "-c", "log_statement=all"]
    volumes:
      - ./postgres/data:/var/lib/postgresql/data:rw
      #- ./postgres/opt:/opt:rw
      - /etc/localtime:/etc/localtime
      #- /etc/timezone:/etc/timezone:ro
      #- ./postgres/logs:/var/log/postgresql:rw
      #- ./postgres/hosts:/etc/hosts:rw
    networks:
        docker-vlan:
          ipv4_address: 10.10.10.150
      
2023/08/22 03:09:03 ...eful/manager_unix.go:208:handleSignals() [W] PID: 15. Background context for manager closed - context canceled - Shutting down...
2023/08/22 03:09:03 cmd/web.go:195:serveInstalled() [I] PID: 15 Gitea Web Finished
Server listening on :: port 22.
Server listening on 0.0.0.0 port 22.
2023/08/22 03:09:09 cmd/web.go:223:runWeb() [I] Starting Gitea on PID: 16
2023/08/22 03:09:09 cmd/web.go:148:serveInstalled() [I] Gitea version: 1.20.2 built with GNU Make 4.4.1, go1.20.6 : bindata, timetzdata, sqlite, sqlite_unlock_notify
2023/08/22 03:09:09 cmd/web.go:149:serveInstalled() [I] App path: /usr/local/bin/gitea
2023/08/22 03:09:09 cmd/web.go:150:serveInstalled() [I] Work path: /data/gitea
2023/08/22 03:09:09 cmd/web.go:151:serveInstalled() [I] Custom path: /data/gitea
2023/08/22 03:09:09 cmd/web.go:152:serveInstalled() [I] Config file: /data/gitea/conf/app.ini
2023/08/22 03:09:09 cmd/web.go:153:serveInstalled() [I] Run mode: prod
2023/08/22 03:09:09 cmd/web.go:154:serveInstalled() [I] Prepare to run web server
2023/08/22 03:09:09 routers/init.go:112:InitWebInstalled() [I] Git version: 2.40.1, Wire Protocol Version 2 Enabled (home: /data/gitea/home)
2023/08/22 03:09:09 ...g/config_provider.go:325:deprecatedSetting() [E] Deprecated config option `[log]` `ROUTER` present. Use `[log]` `logger.router.MODE` instead. This fallback will be/has been removed in 1.21
2023/08/22 03:09:09 ...les/setting/cache.go:75:loadCacheFrom() [I] Cache Service Enabled
2023/08/22 03:09:09 ...les/setting/cache.go:90:loadCacheFrom() [I] Last Commit Cache Service Enabled
2023/08/22 03:09:09 ...s/setting/session.go:74:loadSessionFrom() [I] Session Service Enabled
2023/08/22 03:09:09 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type: local
2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/attachments
2023/08/22 03:09:09 ...s/storage/storage.go:166:initAvatars() [I] Initialising Avatar storage with type: local
2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/avatars
2023/08/22 03:09:09 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local
2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-avatars
2023/08/22 03:09:09 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local
2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/git/lfs
2023/08/22 03:09:09 ...s/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local
2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-archive
2023/08/22 03:09:09 ...s/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local
2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/packages
2023/08/22 03:09:10 routers/init.go:130:InitWebInstalled() [I] SQLite3 support is enabled
2023/08/22 03:09:10 routers/common/db.go:21:InitDBEngine() [I] Beginning ORM engine initialization.
2023/08/22 03:09:10 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2023/08/22 03:09:10 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:10 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:10 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
2023/08/22 03:09:13 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #2/10...
2023/08/22 03:09:13 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:13 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:13 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
2023/08/22 03:09:16 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #3/10...
2023/08/22 03:09:16 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:16 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #3/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:16 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
2023/08/22 03:09:19 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #4/10...
2023/08/22 03:09:19 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:19 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #4/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:19 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
2023/08/22 03:09:22 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #5/10...
2023/08/22 03:09:22 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:22 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #5/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:22 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
2023/08/22 03:09:25 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #6/10...
2023/08/22 03:09:25 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:25 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #6/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:25 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
2023/08/22 03:09:28 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #7/10...
2023/08/22 03:09:28 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:28 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:28 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
^X^Z
[1]+  Stopped(SIGTSTP)        sudo docker logs -f prod-gitea

第一次部署成功,登录页面也正常,
但是不能重启,重启就出现问题,试了好几次了
数据库使用的是postgres14.5,配置大部分都是默认选项

Gitea Version

1.20.2

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

2023/08/22 03:09:03 ...eful/manager_unix.go:208:handleSignals() [W] PID: 15. Background context for manager closed - context canceled - Shutting down...
2023/08/22 03:09:03 cmd/web.go:195:serveInstalled() [I] PID: 15 Gitea Web Finished
Server listening on :: port 22.
Server listening on 0.0.0.0 port 22.
2023/08/22 03:09:09 cmd/web.go:223:runWeb() [I] Starting Gitea on PID: 16
2023/08/22 03:09:09 cmd/web.go:148:serveInstalled() [I] Gitea version: 1.20.2 built with GNU Make 4.4.1, go1.20.6 : bindata, timetzdata, sqlite, sqlite_unlock_notify
2023/08/22 03:09:09 cmd/web.go:149:serveInstalled() [I] App path: /usr/local/bin/gitea
2023/08/22 03:09:09 cmd/web.go:150:serveInstalled() [I] Work path: /data/gitea
2023/08/22 03:09:09 cmd/web.go:151:serveInstalled() [I] Custom path: /data/gitea
2023/08/22 03:09:09 cmd/web.go:152:serveInstalled() [I] Config file: /data/gitea/conf/app.ini
2023/08/22 03:09:09 cmd/web.go:153:serveInstalled() [I] Run mode: prod
2023/08/22 03:09:09 cmd/web.go:154:serveInstalled() [I] Prepare to run web server
2023/08/22 03:09:09 routers/init.go:112:InitWebInstalled() [I] Git version: 2.40.1, Wire Protocol Version 2 Enabled (home: /data/gitea/home)
2023/08/22 03:09:09 ...g/config_provider.go:325:deprecatedSetting() [E] Deprecated config option `[log]` `ROUTER` present. Use `[log]` `logger.router.MODE` instead. This fallback will be/has been removed in 1.21
2023/08/22 03:09:09 ...les/setting/cache.go:75:loadCacheFrom() [I] Cache Service Enabled
2023/08/22 03:09:09 ...les/setting/cache.go:90:loadCacheFrom() [I] Last Commit Cache Service Enabled
2023/08/22 03:09:09 ...s/setting/session.go:74:loadSessionFrom() [I] Session Service Enabled
2023/08/22 03:09:09 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type: local
2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/attachments
2023/08/22 03:09:09 ...s/storage/storage.go:166:initAvatars() [I] Initialising Avatar storage with type: local
2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/avatars
2023/08/22 03:09:09 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local
2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-avatars
2023/08/22 03:09:09 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local
2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/git/lfs
2023/08/22 03:09:09 ...s/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local
2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-archive
2023/08/22 03:09:09 ...s/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local
2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/packages
2023/08/22 03:09:10 routers/init.go:130:InitWebInstalled() [I] SQLite3 support is enabled
2023/08/22 03:09:10 routers/common/db.go:21:InitDBEngine() [I] Beginning ORM engine initialization.
2023/08/22 03:09:10 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2023/08/22 03:09:10 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:10 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:10 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
2023/08/22 03:09:13 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #2/10...
2023/08/22 03:09:13 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:13 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:13 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
2023/08/22 03:09:16 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #3/10...
2023/08/22 03:09:16 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:16 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #3/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:16 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
2023/08/22 03:09:19 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #4/10...
2023/08/22 03:09:19 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:19 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #4/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:19 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
2023/08/22 03:09:22 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #5/10...
2023/08/22 03:09:22 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:22 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #5/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:22 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
2023/08/22 03:09:25 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #6/10...
2023/08/22 03:09:25 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:25 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #6/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:25 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
2023/08/22 03:09:28 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #7/10...
2023/08/22 03:09:28 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres
2023/08/22 03:09:28 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: pq: password authentication failed for user "gitea"
2023/08/22 03:09:28 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds
^X^Z
[1]+  Stopped(SIGTSTP)        sudo docker logs -f prod-gitea

Git Version

No response

Operating System

No response

How are you running Gitea?

docker compose

第一次配置成功,登录成功
重启容器就出现这个问题

Database

PostgreSQL

Originally created by @nick-ling on GitHub (Aug 21, 2023). ### Description ```yml version: '3' networks: docker-vlan: external: true name: docker-vlan services: prod-gitea: image: gitea/gitea:1.20.2 container_name: prod-gitea #user: root environment: - USER_UID=1000 - USER_GID=1000 - GITEA__database__DB_TYPE=postgres - GITEA__database__HOST=db:5432 - GITEA__database__NAME=gitea - GITEA__database__USER=gitea - GITEA__database__PASSWD=gitea - TZ=Asia/Shanghai #restart: always networks: docker-vlan: ipv4_address: 10.10.10.151 volumes: - ./gitea/data:/data:rw #- ./gitea/app:/app:rw #- ./gitea/config:/etc/s6/gitea:rw #- gitea-data:/etc/gitea - /etc/localtime:/etc/localtime #- /etc/timezone:/etc/timezone:ro ports: - "3000:3000" - "22:22" depends_on: - 'db' #- 'prod-redis' db: image: postgres:14.5 container_name: 'prod-gitea-db' healthcheck: test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "postgres" ] timeout: 3s interval: 10s retries: 5 ports: - "5432:5432" restart: always environment: POSTGRES_DB: postgres POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres123456. TZ: Asia/Shanghai #command: ["postgres", "-c", "logging_collector=on", "-c", "log_directory=/logs", "-c", "log_filename=postgresql.log", "-c", "log_statement=all"] volumes: - ./postgres/data:/var/lib/postgresql/data:rw #- ./postgres/opt:/opt:rw - /etc/localtime:/etc/localtime #- /etc/timezone:/etc/timezone:ro #- ./postgres/logs:/var/log/postgresql:rw #- ./postgres/hosts:/etc/hosts:rw networks: docker-vlan: ipv4_address: 10.10.10.150 ``` ```shell 2023/08/22 03:09:03 ...eful/manager_unix.go:208:handleSignals() [W] PID: 15. Background context for manager closed - context canceled - Shutting down... 2023/08/22 03:09:03 cmd/web.go:195:serveInstalled() [I] PID: 15 Gitea Web Finished Server listening on :: port 22. Server listening on 0.0.0.0 port 22. 2023/08/22 03:09:09 cmd/web.go:223:runWeb() [I] Starting Gitea on PID: 16 2023/08/22 03:09:09 cmd/web.go:148:serveInstalled() [I] Gitea version: 1.20.2 built with GNU Make 4.4.1, go1.20.6 : bindata, timetzdata, sqlite, sqlite_unlock_notify 2023/08/22 03:09:09 cmd/web.go:149:serveInstalled() [I] App path: /usr/local/bin/gitea 2023/08/22 03:09:09 cmd/web.go:150:serveInstalled() [I] Work path: /data/gitea 2023/08/22 03:09:09 cmd/web.go:151:serveInstalled() [I] Custom path: /data/gitea 2023/08/22 03:09:09 cmd/web.go:152:serveInstalled() [I] Config file: /data/gitea/conf/app.ini 2023/08/22 03:09:09 cmd/web.go:153:serveInstalled() [I] Run mode: prod 2023/08/22 03:09:09 cmd/web.go:154:serveInstalled() [I] Prepare to run web server 2023/08/22 03:09:09 routers/init.go:112:InitWebInstalled() [I] Git version: 2.40.1, Wire Protocol Version 2 Enabled (home: /data/gitea/home) 2023/08/22 03:09:09 ...g/config_provider.go:325:deprecatedSetting() [E] Deprecated config option `[log]` `ROUTER` present. Use `[log]` `logger.router.MODE` instead. This fallback will be/has been removed in 1.21 2023/08/22 03:09:09 ...les/setting/cache.go:75:loadCacheFrom() [I] Cache Service Enabled 2023/08/22 03:09:09 ...les/setting/cache.go:90:loadCacheFrom() [I] Last Commit Cache Service Enabled 2023/08/22 03:09:09 ...s/setting/session.go:74:loadSessionFrom() [I] Session Service Enabled 2023/08/22 03:09:09 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type: local 2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/attachments 2023/08/22 03:09:09 ...s/storage/storage.go:166:initAvatars() [I] Initialising Avatar storage with type: local 2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/avatars 2023/08/22 03:09:09 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local 2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-avatars 2023/08/22 03:09:09 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local 2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/git/lfs 2023/08/22 03:09:09 ...s/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local 2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-archive 2023/08/22 03:09:09 ...s/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local 2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/packages 2023/08/22 03:09:10 routers/init.go:130:InitWebInstalled() [I] SQLite3 support is enabled 2023/08/22 03:09:10 routers/common/db.go:21:InitDBEngine() [I] Beginning ORM engine initialization. 2023/08/22 03:09:10 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #1/10... 2023/08/22 03:09:10 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:10 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:10 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds 2023/08/22 03:09:13 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #2/10... 2023/08/22 03:09:13 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:13 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:13 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds 2023/08/22 03:09:16 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #3/10... 2023/08/22 03:09:16 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:16 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #3/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:16 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds 2023/08/22 03:09:19 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #4/10... 2023/08/22 03:09:19 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:19 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #4/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:19 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds 2023/08/22 03:09:22 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #5/10... 2023/08/22 03:09:22 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:22 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #5/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:22 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds 2023/08/22 03:09:25 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #6/10... 2023/08/22 03:09:25 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:25 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #6/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:25 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds 2023/08/22 03:09:28 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #7/10... 2023/08/22 03:09:28 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:28 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:28 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds ^X^Z [1]+ Stopped(SIGTSTP) sudo docker logs -f prod-gitea ``` 第一次部署成功,登录页面也正常, 但是不能重启,重启就出现问题,试了好几次了 数据库使用的是postgres14.5,配置大部分都是默认选项 ### Gitea Version 1.20.2 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots ```shell 2023/08/22 03:09:03 ...eful/manager_unix.go:208:handleSignals() [W] PID: 15. Background context for manager closed - context canceled - Shutting down... 2023/08/22 03:09:03 cmd/web.go:195:serveInstalled() [I] PID: 15 Gitea Web Finished Server listening on :: port 22. Server listening on 0.0.0.0 port 22. 2023/08/22 03:09:09 cmd/web.go:223:runWeb() [I] Starting Gitea on PID: 16 2023/08/22 03:09:09 cmd/web.go:148:serveInstalled() [I] Gitea version: 1.20.2 built with GNU Make 4.4.1, go1.20.6 : bindata, timetzdata, sqlite, sqlite_unlock_notify 2023/08/22 03:09:09 cmd/web.go:149:serveInstalled() [I] App path: /usr/local/bin/gitea 2023/08/22 03:09:09 cmd/web.go:150:serveInstalled() [I] Work path: /data/gitea 2023/08/22 03:09:09 cmd/web.go:151:serveInstalled() [I] Custom path: /data/gitea 2023/08/22 03:09:09 cmd/web.go:152:serveInstalled() [I] Config file: /data/gitea/conf/app.ini 2023/08/22 03:09:09 cmd/web.go:153:serveInstalled() [I] Run mode: prod 2023/08/22 03:09:09 cmd/web.go:154:serveInstalled() [I] Prepare to run web server 2023/08/22 03:09:09 routers/init.go:112:InitWebInstalled() [I] Git version: 2.40.1, Wire Protocol Version 2 Enabled (home: /data/gitea/home) 2023/08/22 03:09:09 ...g/config_provider.go:325:deprecatedSetting() [E] Deprecated config option `[log]` `ROUTER` present. Use `[log]` `logger.router.MODE` instead. This fallback will be/has been removed in 1.21 2023/08/22 03:09:09 ...les/setting/cache.go:75:loadCacheFrom() [I] Cache Service Enabled 2023/08/22 03:09:09 ...les/setting/cache.go:90:loadCacheFrom() [I] Last Commit Cache Service Enabled 2023/08/22 03:09:09 ...s/setting/session.go:74:loadSessionFrom() [I] Session Service Enabled 2023/08/22 03:09:09 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type: local 2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/attachments 2023/08/22 03:09:09 ...s/storage/storage.go:166:initAvatars() [I] Initialising Avatar storage with type: local 2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/avatars 2023/08/22 03:09:09 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local 2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-avatars 2023/08/22 03:09:09 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local 2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/git/lfs 2023/08/22 03:09:09 ...s/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local 2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-archive 2023/08/22 03:09:09 ...s/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local 2023/08/22 03:09:09 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/packages 2023/08/22 03:09:10 routers/init.go:130:InitWebInstalled() [I] SQLite3 support is enabled 2023/08/22 03:09:10 routers/common/db.go:21:InitDBEngine() [I] Beginning ORM engine initialization. 2023/08/22 03:09:10 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #1/10... 2023/08/22 03:09:10 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:10 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:10 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds 2023/08/22 03:09:13 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #2/10... 2023/08/22 03:09:13 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:13 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:13 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds 2023/08/22 03:09:16 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #3/10... 2023/08/22 03:09:16 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:16 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #3/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:16 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds 2023/08/22 03:09:19 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #4/10... 2023/08/22 03:09:19 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:19 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #4/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:19 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds 2023/08/22 03:09:22 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #5/10... 2023/08/22 03:09:22 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:22 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #5/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:22 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds 2023/08/22 03:09:25 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #6/10... 2023/08/22 03:09:25 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:25 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #6/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:25 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds 2023/08/22 03:09:28 routers/common/db.go:28:InitDBEngine() [I] ORM engine initialization attempt #7/10... 2023/08/22 03:09:28 cmd/web.go:175:serveInstalled() [I] PING DATABASE postgres 2023/08/22 03:09:28 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: pq: password authentication failed for user "gitea" 2023/08/22 03:09:28 routers/common/db.go:35:InitDBEngine() [I] Backing off for 3 seconds ^X^Z [1]+ Stopped(SIGTSTP) sudo docker logs -f prod-gitea ``` ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? docker compose 第一次配置成功,登录成功 重启容器就出现这个问题 ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 09:39:32 -06:00
Author
Owner

@delvh commented on GitHub (Aug 21, 2023):

That is not a gitea issue.
The message means you try to authenticate to the database with the wrong password.
Please change the connection password in your app.ini.

@delvh commented on GitHub (Aug 21, 2023): That is not a gitea issue. The message means you try to authenticate to the database with the wrong password. Please change the connection password in your `app.ini`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11502