Skip to content

Windows 10 is always FATAL: data directory "/var/lib/postgresql/data" has wrong ownership #435

@ayuthmang

Description

@ayuthmang

On Windows 10 Pro is always failed while docker-compose up, otherwise on mac is work perfectly.

Here are some my docker-compose file:

version: '2'
services:
.
.
.
.
  postgresql:
    image: postgres:93
    container_name: lnpp-postgresql
    restart: always
    environment:
      POSTGRES_PASSWORD: asdf
    volumes:
      - ./postgresql/data:/var/lib/postgresql/data
      - ./postgresql/conf:/etc/postgresql/
    ports:
      - "5432:5432"
    networks:
      lnpp-network:
        ipv4_address: ${lnpp_POSTGRES_IP}

networks:
  lnpp-network:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: ${lnpp_SUBNET}
          gateway: ${lnpp_GATEWAY}

and there are some logs.

lnpp-postgresql | FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
lnpp-postgresql | HINT:  The server must be started by the user that owns the data directory.
lnpp-postgresql exited with code 1
lnpp-postgresql | FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
lnpp-postgresql | HINT:  The server must be started by the user that owns the data directory.
lnpp-postgresql | FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
lnpp-postgresql | HINT:  The server must be started by the user that owns the data directory.
lnpp-postgresql | FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
lnpp-postgresql | HINT:  The server must be started by the user that owns the data directory.
lnpp-postgresql exited with code 1
lnpp-postgresql | FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
lnpp-postgresql | HINT:  The server must be started by the user that owns the data directory.
lnpp-postgresql | FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
lnpp-postgresql | HINT:  The server must be started by the user that owns the data directory.
lnpp-postgresql | FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
lnpp-postgresql | HINT:  The server must be started by the user that owns the data directory.
lnpp-postgresql | FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
lnpp-postgresql | HINT:  The server must be started by the user that owns the data directory.
lnpp-postgresql | FATAL:  data directory "/var/lib/postgresql/data" has wrong ownership
lnpp-postgresql | HINT:  The server must be started by the user that owns the data directory.
lnpp-postgresql exited with code 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions