Unable to Access http://localhost/install completely and Initialize Admin Account due to Docker Postgres Container Restart Issue #2993

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

Originally created by @Sumi41 on GitHub (May 7, 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

13cd409575

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Environment:

  • Windows Subsystem for Linux 2
  • Docker Desktop for Windows (version 4.10.1 (82475))

Issue:
I am unable to access http://localhost/install and set up an admin account. The docker-db-1 postgres:15-alpine container is restarting and not booting up. The other seven containers are starting up normally.

Error Message:

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data/pgdata ... 2024-05-06T21:59:46.361945407Z chmod: /var/lib/postgresql/data/pgdata: Operation not permitted
initdb: error: could not change permissions of directory "/var/lib/postgresql/data/pgdata": Operation not permitted
chmod: /var/lib/postgresql/data/pgdata: Operation not permitted 

Temporary Solution:
I commented out the volume mount for the Postgres data directory in the Docker Compose file, which resolved the issue. However, this is a temporary solution. When I run docker compose down, the admin account is reset, so a different solution is likely needed.

# The postgres database.
db:
  image: postgres:15-alpine
  restart: always
  environment:
    PGUSER: postgres
    # The password for the default postgres user.
    POSTGRES_PASSWORD: difyai123456
    # The name of the default postgres database.
    POSTGRES_DB: dify
    # postgres data directory
    PGDATA: /var/lib/postgresql/data/pgdata
  # Commented out the volume mount for the Postgres data directory
  # volumes:
    # - ./volumes/db/data:/var/lib/postgresql/data
  # uncomment to expose db(postgresql) port to host
  # ports:
  #   - "5432:5432"

✔️ Expected Behavior

The http://localhost/install should start up normally, allowing me to set up an admin account. Even after running docker compose down followed by docker compose up -d, the admin account should persist and not be reset.

Actual Behavior

Currently, I am unable to access http://localhost/install and set up an admin account. The docker-db-1 postgres:15-alpine container is restarting and not booting up. The other seven containers are starting up normally. Moreover, when I run docker compose down followed by docker compose up -d, the admin account is reset.

Originally created by @Sumi41 on GitHub (May 7, 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 13cd4095756bffbb8903bf599901e296eb571b9e ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce **Environment:** - Windows Subsystem for Linux 2 - Docker Desktop for Windows (version 4.10.1 (82475)) **Issue:** I am unable to access `http://localhost/install` and set up an admin account. The `docker-db-1 postgres:15-alpine` container is restarting and not booting up. The other seven containers are starting up normally. **Error Message:** ``` The database cluster will be initialized with locale "en_US.utf8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are disabled. fixing permissions on existing directory /var/lib/postgresql/data/pgdata ... 2024-05-06T21:59:46.361945407Z chmod: /var/lib/postgresql/data/pgdata: Operation not permitted initdb: error: could not change permissions of directory "/var/lib/postgresql/data/pgdata": Operation not permitted chmod: /var/lib/postgresql/data/pgdata: Operation not permitted ``` **Temporary Solution:** I commented out the volume mount for the Postgres data directory in the Docker Compose file, which resolved the issue. However, this is a temporary solution. When I run `docker compose down`, the admin account is reset, so a different solution is likely needed. ```yaml # The postgres database. db: image: postgres:15-alpine restart: always environment: PGUSER: postgres # The password for the default postgres user. POSTGRES_PASSWORD: difyai123456 # The name of the default postgres database. POSTGRES_DB: dify # postgres data directory PGDATA: /var/lib/postgresql/data/pgdata # Commented out the volume mount for the Postgres data directory # volumes: # - ./volumes/db/data:/var/lib/postgresql/data # uncomment to expose db(postgresql) port to host # ports: # - "5432:5432" ``` ### ✔️ Expected Behavior The `http://localhost/install` should start up normally, allowing me to set up an admin account. Even after running `docker compose down` followed by `docker compose up -d`, the admin account should persist and not be reset. ### ❌ Actual Behavior Currently, I am unable to access `http://localhost/install` and set up an admin account. The `docker-db-1 postgres:15-alpine` container is restarting and not booting up. The other seven containers are starting up normally. Moreover, when I run `docker compose down` followed by `docker compose up -d`, the admin account is reset.
yindo added the 🐞 bug label 2026-02-21 17:52:29 -05:00
yindo closed this issue 2026-02-21 17:52:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#2993