mautic / docker-mautic

Docker Image for Mautic
https://www.mautic.org
362 stars 274 forks source link

Tables not being created in v4 using docker-compose #219

Closed SanderVanhove closed 2 years ago

SanderVanhove commented 2 years ago

I'm using docker-compose to run Mautic version 4, but I'm not able to get the tables to be created. I have tried a bunch of different docker-compose files, but none of them seem to work.

My current docker-compose.yaml:

version: "3"

services:
  database:
    image: percona/percona-server:5.7
    container_name: database
    environment:
      MYSQL_ROOT_PASSWORD: mypassword
    ports:
      - 3306:3306
    volumes:
      - database:/var/lib/mysql
    restart: always
    networks:
      - mauticnet
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci

  mautic:
    container_name: mautic
    image: mautic/mautic:v4
    depends_on:
      - database
    volumes:
      - mautic_data:/var/www/html
    environment:
      - MAUTIC_DB_HOST=database
      - MAUTIC_DB_USER=root
      - MAUTIC_DB_PASSWORD=mypassword
      - MAUTIC_DB_NAME=mautic
      - MAUTIC_RUN_CRON_JOBS=true
    restart: always
    networks:
      - mauticnet
    ports:
      - 8080:80

volumes:
  database:
    driver: local
  mautic_data:
    driver: local
networks:
  mauticnet:
    driver: bridge

The logs of the mautic container:

Mautic not found in /var/www/html - copying now...
Complete! Mautic has been successfully copied to /var/www/html

Ensuring Mautic database is present

MySQL Connection Error: (2002) Connection refused

Warning: mysqli::__construct(): (HY000/2002): Connection refused in /makedb.php on line 20

MySQL Connection Error: (2002) Connection refused

Warning: mysqli::__construct(): (HY000/2002): Connection refused in /makedb.php on line 20

MySQL Connection Error: (2002) Connection refused

Warning: mysqli::__construct(): (HY000/2002): Connection refused in /makedb.php on line 20

MySQL Connection Error: (2002) Connection refused

Warning: mysqli::__construct(): (HY000/2002): Connection refused in /makedb.php on line 20

MySQL Connection Error: (2002) Connection refused

Warning: mysqli::__construct(): (HY000/2002): Connection refused in /makedb.php on line 20

Warning: mysqli::__construct(): (HY000/2002): Connection refused in /makedb.php on line 20

MySQL Connection Error: (2002) Connection refused

Warning: mysqli::__construct(): (HY000/2002): Connection refused in /makedb.php on line 20

MySQL Connection Error: (2002) Connection refused

MySQL Database Created
========================================================================
This server is now configured to run Mautic!
The following information will be prefilled into the installer (keep password field empty):
Host Name: database
Database Name: mautic
Database Username: root
Database Password: mypassword
========================================================================

========================================================================
Creating new existing mautic config
========================================================================

========================================================================
Mautic not currently installed (no secret_key in local.php)

URL & Admin credentials not supplied, please install mautic manually.
========================================================================

========================================================================
Activating cron
========================================================================

========================================================================
Starting mautic
========================================================================

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.30.0.3. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.30.0.3. Set the 'ServerName' directive globally to suppress this message
[Wed Jan 19 11:49:45.683063 2022] [mpm_prefork:notice] [pid 36] AH00163: Apache/2.4.51 (Debian) PHP/7.4.27 configured -- resuming normal operations
[Wed Jan 19 11:49:45.683395 2022] [core:notice] [pid 36] AH00094: Command line: 'apache2 -D FOREGROUND'
[CRON]
[CRON] In AbstractMySQLDriver.php line 61:
[CRON]
[CRON] An exception occurred while executing 'SELECT i0_.is_published AS is_publis
[CRON] hed_0, i0_.date_added AS date_added_1, i0_.created_by AS created_by_2, i0_.
[CRON] created_by_user AS created_by_user_3, i0_.date_modified AS date_modified_4,
[CRON] i0_.modified_by AS modified_by_5, i0_.modified_by_user AS modified_by_user
[CRON] _6, i0_.checked_out AS checked_out_7, i0_.checked_out_by AS checked_out_by_
[CRON] 8, i0_.checked_out_by_user AS checked_out_by_user_9, i0_.id AS id_10, i0_.d
[CRON] ir AS dir_11, i0_.file AS file_12, i0_.original_file AS original_file_13, i
[CRON] 0_.line_count AS line_count_14, i0_.inserted_count AS inserted_count_15, i0
[CRON] _.updated_count AS updated_count_16, i0_.ignored_count AS ignored_count_17,
[CRON] i0_.priority AS priority_18, i0_.status AS status_19, i0_.date_started AS
[CRON] date_started_20, i0_.date_ended AS date_ended_21, i0_.object AS object_22,
[CRON] i0_.properties AS properties_23 FROM imports i0_ WHERE i0_.status IN (1, 7)
[CRON] ORDER BY i0_.priority ASC, i0_.date_added DESC LIMIT 1':
[CRON]
[CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.imports'
[CRON] doesn't exist
[CRON]
[CRON]
[CRON] In Exception.php line 18:
[CRON]
[CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.imports'
[CRON] doesn't exist
[CRON]
[CRON]
[CRON] In PDOConnection.php line 132:
[CRON]
[CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.imports'
[CRON] doesn't exist
[CRON]
[CRON]
[CRON] mautic:import [-i|--id [ID]] [-l|--limit [LIMIT]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
[CRON]
[CRON]
[CRON]
[CRON] In AbstractMySQLDriver.php line 61:
[CRON]
[CRON] An exception occurred while executing 'SELECT c0_.is_published AS is_publis
[CRON] hed_0, c0_.date_added AS date_added_1, c0_.created_by AS created_by_2, c0_.
[CRON] created_by_user AS created_by_user_3, c0_.date_modified AS date_modified_4,
[CRON] c0_.modified_by AS modified_by_5, c0_.modified_by_user AS modified_by_user
[CRON] _6, c0_.checked_out AS checked_out_7, c0_.checked_out_by AS checked_out_by_
[CRON] 8, c0_.checked_out_by_user AS checked_out_by_user_9, c0_.id AS id_10, c0_.n
[CRON] ame AS name_11, c0_.description AS description_12, c0_.publish_up AS publis
[CRON] h_up_13, c0_.publish_down AS publish_down_14, c0_.canvas_settings AS canvas
[CRON] _settings_15, c0_.allow_restart AS allow_restart_16, c1_.is_published AS is
[CRON] _published_17, c1_.date_added AS date_added_18, c1_.created_by AS created_b
[CRON] y_19, c1_.created_by_user AS created_by_user_20, c1_.date_modified AS date_
[CRON] modified_21, c1_.modified_by AS modified_by_22, c1_.modified_by_user AS mod
[CRON] ified_by_user_23, c1_.checked_out AS checked_out_24, c1_.checked_out_by AS
[CRON] checked_out_by_25, c1_.checked_out_by_user AS checked_out_by_user_26, c1_.i
[CRON] d AS id_27, c1_.title AS title_28, c1_.description AS description_29, c1_.a
[CRON] lias AS alias_30, c1_.color AS color_31, c1_.bundle AS bundle_32, c0_.categ
[CRON] ory_id AS category_id_33 FROM campaigns c0_ LEFT JOIN categories c1_ ON c0_
[CRON] .category_id = c1_.id':
[CRON]
[CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.campaigns
[CRON] ' doesn't exist
[CRON]
[CRON]
[CRON] In Exception.php line 18:
[CRON]
[CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.campaigns
[CRON] ' doesn't exist
[CRON]
[CRON]
[CRON] In PDOConnection.php line 132:
[CRON]
[CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.campaigns
[CRON] ' doesn't exist
[CRON]
[CRON]
[CRON] mautic:campaigns:rebuild [-l|--batch-limit [BATCH-LIMIT]] [-m|--max-contacts [MAX-CONTACTS]] [-i|--campaign-id [CAMPAIGN-ID]] [--contact-id [CONTACT-ID]] [--contact-ids [CONTACT-IDS]] [--min-contact-id [MIN-CONTACT-ID]] [--max-contact-id [MAX-CONTACT-ID]] [--thread-id [THREAD-ID]] [--max-threads [MAX-THREADS]] [--bypass-locking] [-t|--timeout TIMEOUT] [-x|--lock_mode LOCK_MODE] [-f|--force] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
[CRON]
[CRON] In AbstractMySQLDriver.php line 61:
[CRON]
[CRON] An exception occurred while executing 'SELECT r0_.id AS id_0, r0_.schedule_
[CRON] date AS schedule_date_1, r1_.is_published AS is_published_2, r1_.date_added
[CRON] AS date_added_3, r1_.created_by AS created_by_4, r1_.created_by_user AS cr
[CRON] eated_by_user_5, r1_.date_modified AS date_modified_6, r1_.modified_by AS m
[CRON] odified_by_7, r1_.modified_by_user AS modified_by_user_8, r1_.checked_out A
[CRON] S checked_out_9, r1_.checked_out_by AS checked_out_by_10, r1_.checked_out_b
[CRON] y_user AS checked_out_by_user_11, r1_.id AS id_12, r1_.name AS name_13, r1_
[CRON] .description AS description_14, r1_.`system` AS system_15, r1_.source AS so
[CRON] urce_16, r1_.columns AS columns_17, r1_.filters AS filters_18, r1_.table_or
[CRON] der AS table_order_19, r1_.graphs AS graphs_20, r1_.group_by AS group_by_21
[CRON] , r1_.aggregators AS aggregators_22, r1_.settings AS settings_23, r1_.is_sc
[CRON] heduled AS is_scheduled_24, r1_.schedule_unit AS schedule_unit_25, r1_.to_a
[CRON] ddress AS to_address_26, r1_.schedule_day AS schedule_day_27, r1_.schedule_
[CRON] month_frequency AS schedule_month_frequency_28, r0_.report_id AS report_id_
[CRON] 29 FROM reports_schedulers r0_ LEFT JOIN reports r1_ ON r0_.report_id = r1_
[CRON] .id WHERE r0_.schedule_date <= ?' with params ["2022-01-19 11:50:02"]:
[CRON]
[CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.reports_s
[CRON] chedulers' doesn't exist
[CRON]
[CRON]
[CRON] In Exception.php line 18:
[CRON]
[CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.reports_s
[CRON] chedulers' doesn't exist
[CRON]
[CRON]
[CRON] In PDOStatement.php line 112:
[CRON]
[CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.reports_s
[CRON] chedulers' doesn't exist
[CRON]
[CRON]
[CRON] mautic:reports:scheduler [-report|--report [REPORT]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
[CRON]
[CRON]
[CRON] In AbstractMySQLDriver.php line 61:
[CRON]
[CRON] An exception occurred while executing 'SELECT l0_.is_published AS is_publis
[CRON] hed_0, l0_.date_added AS date_added_1, l0_.created_by AS created_by_2, l0_.
[CRON] created_by_user AS created_by_user_3, l0_.date_modified AS date_modified_4,
[CRON] l0_.modified_by AS modified_by_5, l0_.modified_by_user AS modified_by_user
[CRON] _6, l0_.checked_out AS checked_out_7, l0_.checked_out_by AS checked_out_by_
[CRON] 8, l0_.checked_out_by_user AS checked_out_by_user_9, l0_.id AS id_10, l0_.n
[CRON] ame AS name_11, l0_.description AS description_12, l0_.alias AS alias_13, l
[CRON] 0_.public_name AS public_name_14, l0_.filters AS filters_15, l0_.is_global
[CRON] AS is_global_16, l0_.is_preference_center AS is_preference_center_17, l0_.c
[CRON] ategory_id AS category_id_18 FROM lead_lists l0_ LEFT JOIN categories c1_ O
[CRON] N l0_.category_id = c1_.id ORDER BY l0_.name ASC':
[CRON]
[CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.lead_list
[CRON] s' doesn't exist
[CRON]
[CRON]
[CRON] In Exception.php line 18:
[CRON]
[CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.lead_list
[CRON] s' doesn't exist
[CRON]
[CRON]
[CRON] In PDOConnection.php line 132:
[CRON]
[CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.lead_list
[CRON] s' doesn't exist
[CRON]
[CRON]
[CRON] mautic:segments:update [-b|--batch-limit [BATCH-LIMIT]] [-m|--max-contacts [MAX-CONTACTS]] [-i|--list-id [LIST-ID]] [-tm|--timing [TIMING]] [--bypass-locking] [-t|--timeout TIMEOUT] [-x|--lock_mode LOCK_MODE] [-f|--force] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
[CRON]

Help would be very much appreciated! 😁

SanderVanhove commented 2 years ago

Ok this was something from my end. I tried connecting over https instead of http. The fact that the tables were not yet there was because I hadden't run through the instal yet.