NathanVaughn / webtrees-docker

Up-to-date Docker image for webtrees with all the bells and whistles.
https://hub.docker.com/r/nathanvaughn/webtrees
MIT License
64 stars 15 forks source link

The username or password is incorrect. #142

Open WildeTechSolutions opened 7 months ago

WildeTechSolutions commented 7 months ago

I've set up the docker compose just as you had it and setting the image to the latest. I also get the username or password is incorrect when using the wt_user and wt_pass parameters in docker-compose.yml.

version: "3"

services:
  app:
    depends_on:
      - db
    environment:
      PRETTY_URLS: "1"
      HTTPS: "0"
      HTTPS_REDIRECT: "0"
      LANG: "en-US"
      BASE_URL: "http://localhost:4080"
      DB_TYPE: "mysql"
      DB_HOST: "db"
      DB_PORT: "3306"
      DB_USER: "webtrees"
      DB_PASS: "badpassword"
      DB_NAME: "webtrees"
      DB_PREFIX: "wt_"
      WT_USER: "username"
      WT_NAME: "Full Name"
      WT_PASS: "mybadpassword"
      WT_EMAIL: "me@example.com"
      PUID: "1000"
      PGID: "1000"
    image: ghcr.io/nathanvaughn/webtrees:latest
    ports:
      - 4080:80
      # - 443:443
    restart: unless-stopped
    volumes:
      # - ~/certs:/certs/
      - /mnt/md0/webtrees/data:/var/www/webtrees/data/

  db:
    environment:
      MARIADB_DATABASE: "webtrees"
      MARIADB_USER: "webtrees"
      MARIADB_ROOT_PASSWORD: "badpassword"
      MARIADB_PASSWORD: "badpassword"
    image: docker.io/library/mariadb:latest
    restart: unless-stopped
    volumes:
      - db_data:/var/lib/mysql

  # db:
  #   environment:
  #     POSTGRES_DB: "webtrees"
  #     POSTGRES_USER: "webtrees"
  #     POSTGRES_PASSWORD: "badpassword"
  #   image: docker.io/library/postgres:latest
  #   restart: unless-stopped
  #   volumes:
  #     - db_data:/var/lib/postgresql/data

volumes:
  db_data:
    driver: local
  app_data:
    driver: local
NathanVaughn commented 7 months ago

I'm not sure what's going on. I copied your compose file above exactly, other than changing the application volume to be a local path, and it worked fine for me

image

Did you let the setup wizard get through everything? It does take a little bit the first time to set up all the database tables.

WildeTechSolutions commented 7 months ago

Hey Nathan, I appreciate your prompt response.

I was actually mounting the database volume to - /mnt/md0/webtrees/data. It indeed does work when mounted to db_data, but when I try to mount it to another location I see the following error in the database container logs Access denied for userroot@xxx.xx.x.e(user password: NO).

NathanVaughn commented 7 months ago

Mounting the data directories to a local file path should be fine, I do that with my personal installation. Example docker compose:

version: "3"

services:
  app:
    depends_on:
      - db
    environment:
      PRETTY_URLS: "1"
      HTTPS: "0"
      HTTPS_REDIRECT: "0"
      LANG: "en-US"
      BASE_URL: "http://localhost:4080"
      DB_TYPE: "mysql"
      DB_HOST: "db"
      DB_PORT: "3306"
      DB_USER: "webtrees"
      DB_PASS: "badpassword"
      DB_NAME: "webtrees"
      DB_PREFIX: "wt_"
      WT_USER: "username"
      WT_NAME: "Full Name"
      WT_PASS: "mybadpassword"
      WT_EMAIL: "me@example.com"
      PUID: "1000"
      PGID: "1000"
    image: ghcr.io/nathanvaughn/webtrees:latest
    ports:
      - 4080:80
    restart: unless-stopped
    volumes:
      - /tmp/webtrees_app_data:/var/www/webtrees/data/

  db:
    environment:
      MARIADB_DATABASE: "webtrees"
      MARIADB_USER: "webtrees"
      MARIADB_ROOT_PASSWORD: "badpassword"
      MARIADB_PASSWORD: "badpassword"
    image: docker.io/library/mariadb:latest
    restart: unless-stopped
    volumes:
      - /tmp/webtrees_db_data:/var/lib/mysql

If you had both Webtrees and the Database pointing to /mnt/md0/webtrees/data, I could see how this would cause problems, they shouldn't be sharing a directory.

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.