tchapi / davis

🗓 A simple, fully translatable admin interface for sabre/dav based on Symfony 5 and Bootstrap 5, initially inspired by Baïkal.
https://github.com/users/tchapi/projects/1/views/1
MIT License
377 stars 20 forks source link

500 error upon login with `docker-compose-standalone` #159

Open RCdeWit opened 3 months ago

RCdeWit commented 3 months ago

I am trying to get Davis to run on my Synology NAS. I use Portainer to manage my Docker stacks.

I have a reverse proxy hosted elsewhere that connects to my NAS over Tailscale, so I think I need to use the standalone version.

I have adapted the docker-compose-standalone to the following:

version: "3.7"
name: "davis"

services:

  mysql:
    image: mariadb:10.6.10
    container_name: mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
      - MYSQL_DATABASE=${DB_DATABASE}
      - MYSQL_USER=${DB_USER}
      - MYSQL_PASSWORD=${DB_PASSWORD}
    volumes:
      - /volume1/docker/davis/database:/var/lib/mysql

  davis:
    build:
      context: ../
      dockerfile: ./docker/Dockerfile-standalone
    # image: davis:latest
    # If you want to use a prebuilt image from Github
    image: ghcr.io/tchapi/davis-standalone:edge
    container_name: davis-standalone
    environment:
      - APP_ENV=prod
      - DATABASE_DRIVER=mysql
      - DATABASE_URL=mysql://${DB_USER}:${DB_PASSWORD}@mysql:3306/${DB_DATABASE}?serverVersion=mariadb-10.6.10&charset=utf8mb4
      - MAILER_DSN=smtp://${MAIL_USERNAME}:${MAIL_PASSWORD}@${MAIL_HOST}:${MAIL_PORT}
      - ADMIN_LOGIN=${ADMIN_LOGIN}
      - ADMIN_PASSWORD=${ADMIN_PASSWORD}
      - AUTH_REALM=${AUTH_REALM}
      - AUTH_METHOD=${AUTH_METHOD}
      - CALDAV_ENABLED=${CALDAV_ENABLED}
      - CARDDAV_ENABLED=${CARDDAV_ENABLED}
      - WEBDAV_ENABLED=${WEBDAV_ENABLED}
      - WEBDAV_TMP_DIR=${WEBDAV_TMP_DIR}
      - WEBDAV_PUBLIC_DIR=${WEBDAV_PUBLIC_DIR}
      - INVITE_FROM_ADDRESS=${INVITE_FROM_ADDRESS}
      - APP_TIMEZONE=${TIMEZONE}
    depends_on:
      - mysql
    ports:
      - 8444:9000

volumes:
  database:
    name: database

Basically, I have changed the port because Portainer uses :9000 and the volume to match a directory on my NAS. I have also executed bin/console doctrine:migrations:migrate through the console of the docker-standalone container, although I can't see whether it succeeded.

I can access :8444/dashboard and get a login page. Whenever I try to log in with the ADMIN_LOGIN/ADMIN_PASSWORD credentials, I am redirected to a 500 page.

The logs of the davis-standalone container don't show anything off, although Portainer does give it the Unhealthy label.

Any help would be much appreciated!

tchapi commented 3 months ago

Hi @RCdeWit 👋🏼

Keep me posted!

lambolighting commented 3 months ago

I believe i'm getting the same error on fresh install of the standalone version. It returns an HTTP 500 Internal Server Error. Screenshot 2024-06-14 124230

tchapi commented 3 months ago

@lambolighting this is very likely different — you seem to be missing the APP_ENV=prod variable?

paul-m-koch commented 3 months ago

I get the same error with the ghcr.io/tchapi/davis:latest image. bin/console doctrine:migrations:migrate produces:

In StreamHandler.php line 149:

  The stream or file "/var/www/davis/var/log/prod.log" could not be opened in
   append mode: Failed to open stream: Permission denied
  The exception occurred while attempting to log: Error thrown while running
  command "doctrine:migrations:migrate". Message: "An exception occurred in t
  he driver: SQLSTATE[HY000] [2002] Connection refused"
  Context: {"exception":{},"command":"doctrine:migrations:migrate","message":
  "An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection ref
  used"}

And in /var/www/davis/var/log are no logs, but the folder is owned by root

tchapi commented 3 months ago

Interesting @paul-m-koch, thanks for the details