mautic / docker-mautic

Docker Image for Mautic
https://www.mautic.org
377 stars 280 forks source link

Mautic unusable after upgrade 3.1.1 -> 3.1.2 #181

Open jenslaufer opened 4 years ago

jenslaufer commented 4 years ago

Bug Description

I am running mautic with docker-compose with the following configuration

version: "3.3"

services:

  reverse-proxy:
    image: traefik:v2.2
    container_name: reverse-proxy
    ports:
      - '80:80'
      - '443:443'
    volumes:
      - ./traefik:/etc/traefik
      - /var/run/docker.sock:/var/run/docker.sock

  mautic-database:
    image: powertic/percona-docker
    container_name: mautic-database
    environment:
      MYSQL_ROOT_PASSWORD: $MAUTIC_DB_PASSWORD
    volumes:
      - database:/var/lib/mysql
    restart: always
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --sql-mode=""

  mautic-app:
    container_name: mautic-app
    image: mautic/mautic:v3
    volumes:
      - mautic_data:/var/www/html
    environment:
      - MAUTIC_DB_HOST=mautic-database
      - MAUTIC_DB_USER=$MAUTIC_DB_USER
      - MAUTIC_DB_PASSWORD=$MAUTIC_DB_PASSWORD
      - MAUTIC_DB_NAME=mautic3
    restart: always
    ports:
      - 80
    labels:
      - 'traefik.enable=true'
      - 'traefik.http.routers.mautic.rule=Host(`www.insights5.com`)'
      - 'traefik.http.routers.mautic.tls=true'
      - 'traefik.http.routers.mautic.tls.domains[0].main=www.insights5.com'
      - 'traefik.http.routers.mautic.tls.certresolver=lets-encrypt'

volumes:
  database:
    driver: local
  mautic_data:
    driver: local

traefik.toml:

[log]
  level = "WARN"

[providers]
  [providers.docker]
    exposedByDefault = false
  [providers.file]
    directory = "/etc/traefik/dynamic"

[entryPoints]
  [entryPoints.http]
    address = ":80"
  [entryPoints.https]
    address = ":443"

[certificatesResolvers.lets-encrypt.acme]
  storage = "/etc/traefik/acme.json"
  email = "jr@nn.com"
  [certificatesResolvers.lets-encrypt.acme.tlsChallenge]

traefik/dynamic/force-https.toml

[http.routers]
  [http.routers.force-https]
    entryPoints = ["http"]
    middlewares = ["force-https"]
    rule = "HostRegexp(`{any:.+}`)"
    service = "noop"

[http.middlewares]
  [http.middlewares.force-https.redirectScheme]
    scheme = "https"

[http.services]
  [http.services.noop.loadBalancer]

After the upgrade to 3.1.2 I am getting the error "too many requests" in the browser. Before everything was fine

Q A
Mautic version 3.1.1 ->3.1.2
PHP version unknown as in Docker container
Browser Firefox 82.0, Chrome 86.0.4240.111

Steps to reproduce

  1. Run docker-compose with container 3.1.1
  2. Confirm upgrade to 3.1.2

Log errors

Upgrade seemed successful. It seems there is a problem with the 301 redirects most probably in combination with https and a custom domain.


172.18.0.3 - - [31/Oct/2020:11:34:45 +0000] "GET / HTTP/1.1" 301 578 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

172.18.0.3 - - [31/Oct/2020:11:34:45 +0000] "GET / HTTP/1.1" 301 578 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

172.18.0.3 - - [31/Oct/2020:11:34:45 +0000] "GET / HTTP/1.1" 301 578 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

172.18.0.3 - - [31/Oct/2020:11:34:45 +0000] "GET / HTTP/1.1" 301 578 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

172.18.0.3 - - [31/Oct/2020:11:34:45 +0000] "GET / HTTP/1.1" 301 578 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

172.18.0.3 - - [31/Oct/2020:11:34:45 +0000] "GET / HTTP/1.1" 301 578 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

172.18.0.3 - - [31/Oct/2020:11:34:45 +0000] "GET / HTTP/1.1" 301 578 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

172.18.0.3 - - [31/Oct/2020:11:34:45 +0000] "GET / HTTP/1.1" 301 578 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

172.18.0.3 - - [31/Oct/2020:11:34:45 +0000] "GET / HTTP/1.1" 301 578 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

172.18.0.3 - - [31/Oct/2020:11:34:45 +0000] "GET / HTTP/1.1" 301 578 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

172.18.0.3 - - [31/Oct/2020:11:34:45 +0000] "GET / HTTP/1.1" 301 578 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

Any ideas to fix the problem quickly with a workaround without reinstalling everything? Thanks

[//]: # ( Invisible comment: Please check for related errors in the latest log file in [mautic root]/app/log/ and/or the web server's logs and post them here. Be sure to remove sensitive information if applicable. )

--- Want to back this issue? **[Post a bounty on it!](https://app.bountysource.com/issues/94905427-mautic-unusable-after-upgrade-3-1-1-3-1-2?utm_campaign=plugin&utm_content=tracker%2F20392502&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://app.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F20392502&utm_medium=issues&utm_source=github).
tnolle commented 3 years ago

Set the site_url in app/config/local.php to a domain without https like http://example.com and delete the cache (rm -rf var/cache/*. Afterwards, go to https://example.com and reset your site_url to https://example.com either through the configuration or in the config again. This should solve it.

andrew-dixon commented 3 years ago

@tnolle Thanks, this worked getting my newly installed Docker container from 3.0.2 to 3.1.2 and then again from 3.1.2 to 3.2.2 👍