Ubuntu LTS using docker compose, pgsql pod cannot start and log says not pgsql user. #2622

Closed
opened 2026-02-21 17:47:59 -05:00 by yindo · 0 comments
Owner

Originally created by @MapleEve on GitHub (Apr 25, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a quesion, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Pleas do not modify this template :) and fill in all the required fields.

Dify version

0.6.5

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Run a ubuntu LTS 20 ~ 22
use apt or aptitude install docker and docker compose
using docker compose command

BTW, following is the fix:

  1. change the pgsql volume with an external volume, not created "root" volume
    volumes:
      - pgdata:/var/lib/postgresql/data
  1. register this volume
volumes:
  pgdata:
    external: true
  1. create a volume outside before run compose
    docker volume create --name=pgdata

✔️ Expected Behavior

automatic this by default.

Actual Behavior

2024-04-25 11:53:41.887 UTC [52] FATAL: data directory "/var/lib/postgresql/data/pgdata" has wrong ownership
2024-04-25 11:53:41.887 UTC [52] HINT: The server must be started by the user that owns the data directory.

Originally created by @MapleEve on GitHub (Apr 25, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a quesion, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] Pleas do not modify this template :) and fill in all the required fields. ### Dify version 0.6.5 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Run a ubuntu LTS 20 ~ 22 use apt or aptitude install docker and docker compose using docker compose command BTW, following is the fix: 1. change the pgsql volume with an external volume, not created "root" volume ```yaml volumes: - pgdata:/var/lib/postgresql/data ``` 2. register this volume ```yaml volumes: pgdata: external: true ``` 3. create a volume outside before run compose `docker volume create --name=pgdata` ### ✔️ Expected Behavior automatic this by default. ### ❌ Actual Behavior 2024-04-25 11:53:41.887 UTC [52] FATAL: data directory "/var/lib/postgresql/data/pgdata" has wrong ownership 2024-04-25 11:53:41.887 UTC [52] HINT: The server must be started by the user that owns the data directory.
yindo added the 🐞 bug label 2026-02-21 17:47:59 -05:00
yindo closed this issue 2026-02-21 17:47:59 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#2622