anonaddy / docker

AnonAddy Docker image
MIT License
511 stars 56 forks source link

Intermittent 504 Bad Gateway #48

Closed orolega closed 3 years ago

orolega commented 3 years ago

Behaviour

Random 504 errors when trying to navigate through the app/pages

Steps to reproduce this issue

  1. Create new folder and files from templates
  2. Edit with my info
  3. sudo docker-compose up -d
  4. Go to URL of app

Expected behaviour

App/pages should not 504 all the time and just work normally navigating through app/pages

Actual behaviour

Page might load correctly. Attempt to do something on page (login, register, etc), get a 504 error. Reload page. Get 504 now. Reload again, page loads. Try to do previous thing again and page might load or it might 504 again.

Configuration

docker-compose.yml


services:
  db:
    image: yobasystems/alpine-mariadb:latest
    container_name: anonaddy_db
    volumes:
      - "./db:/var/lib/mysql"
    environment:
      - "MYSQL_ALLOW_EMPTY_PASSWORD=yes"
      - "MYSQL_DATABASE"
      - "MYSQL_USER"
      - "MYSQL_PASSWORD"
    restart: always

  redis:
    image: redis:alpine
    container_name: anonaddy_redis
    restart: always

  anonaddy:
    image: anonaddy/anonaddy:latest
    container_name: anonaddy
    depends_on:
      - db
      - redis
    ports:
      - target: 25
        published: 25
        protocol: tcp
      - target: 8000
        published: 8000
        protocol: tcp
    volumes:
      - "./data:/data"
    env_file:
      - "./anonaddy.env"
    environment:
      - "DB_HOST=db"
      - "DB_DATABASE=${MYSQL_DATABASE}"
      - "DB_USERNAME=${MYSQL_USER}"
      - "DB_PASSWORD=${MYSQL_PASSWORD}"
      - "REDIS_HOST=redis"
    restart: always

anonaddy.env

TZ=Europe/Paris
PUID=1000
PGID=1000

MEMORY_LIMIT=256M
UPLOAD_MAX_SIZE=16M
OPCACHE_MEM_SIZE=128
REAL_IP_FROM=0.0.0.0/32
REAL_IP_HEADER=X-Forwarded-For
LOG_IP_VAR=remote_addr

APP_KEY=base64:generated val
APP_DEBUG=false
APP_URL=http://127.0.0.1:8000

ANONADDY_RETURN_PATH=bounces@example.com
ANONADDY_ADMIN_USERNAME=anonaddy
ANONADDY_ENABLE_REGISTRATION=true
ANONADDY_DOMAIN=example.com
ANONADDY_ALL_DOMAINS=example.com
ANONADDY_HOSTNAME=mail.example.com
ANONADDY_DNS_RESOLVER=127.0.0.1
ANONADDY_SECRET=random string
ANONADDY_LIMIT=200
ANONADDY_BANDWIDTH_LIMIT=104857600
ANONADDY_NEW_ALIAS_LIMIT=10
ANONADDY_ADDITIONAL_USERNAME_LIMIT=3

MAIL_FROM_NAME=AnonAddy
MAIL_FROM_ADDRESS=anonaddy@example.com

POSTFIX_DEBUG=false
POSTFIX_SMTPD_TLS=false
POSTFIX_SMTP_TLS=false

.env

MYSQL_DATABASE=anonaddy
MYSQL_USER=anonaddy
MYSQL_PASSWORD=anonaddy

Logs

This is constantly being outputted if I do sudo docker-compose logs -f

anonaddy_1   | s6-supervise nginx: warning: can't happen: timeout while the service is up!
anonaddy_1   | s6-supervise php-fpm: warning: can't happen: timeout while the service is up!
anonaddy_1   | s6-supervise socklog: warning: can't happen: timeout while the service is up!
anonaddy_1   | s6-supervise postfix: warning: can't happen: timeout while the service is up!
anonaddy_1   | s6-supervise cron: warning: can't happen: timeout while the service is up!
anonaddy_1   | s6-supervise socklog/log: warning: can't happen: timeout while the service is up!
crazy-max commented 3 years ago

Looks like an issue with s6. I will update the base image.

orolega commented 3 years ago

Hey tried pulling the latest and trying again yet still have the same issue. Logs still showing all the s6 errors though I see one near the beginning about the clock? Could that be a factor?

anonaddy_1 | s6-supervise socklog: warning: can't happen: timeout while the service is up! anonaddy_1 | s6-log: warning: unable to set monotonic clock and read current time - timestamps may be wrong for a while: Operation not permitted anonaddy_1 | s6-supervise socklog/log: warning: can't happen: timeout while the service is up! anonaddy_1 | s6-supervise cron: warning: can't happen: timeout while the service is up! anonaddy_1 | s6-supervise nginx: warning: can't happen: timeout while the service is up!

crazy-max commented 3 years ago

@orolega Looks like an issue that should be fixed on alpine:edge (https://gitlab.alpinelinux.org/alpine/aports/-/issues/12346#note_142857, skarnet/s6#26). Similar to mbentley/docker-timemachine#77.