Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent 504 Bad Gateway #48

Closed
orolega opened this issue Apr 11, 2021 · 3 comments · Fixed by #54
Closed

Intermittent 504 Bad Gateway #48

orolega opened this issue Apr 11, 2021 · 3 comments · Fixed by #54
Labels

Comments

@orolega
Copy link

orolega commented Apr 11, 2021

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 version (type docker --version) : Docker version 19.03.8, build afacb8b7f0
  • Docker compose version if applicable (type docker-compose --version) : docker-compose version 1.25.0, build unknown
  • Platform (Debian 9, Ubuntu 18.04, ...) : Ubuntu 20.04.2 LTS
  • System info (type uname -a) : Linux sole 5.4.87-218 Url is set to http even though it should be https #1 SMP PREEMPT Wed Jan 6 16:24:35 EST 2021 armv7l armv7l armv7l GNU/Linux
  • Include all necessary configuration files : docker-compose.yml, .env, ...

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
Copy link
Member

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

@orolega
Copy link
Author

orolega commented Apr 19, 2021

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
Copy link
Member

crazy-max commented Apr 19, 2021

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants