mautic / docker-mautic

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

Tables Not Getting Created When Using the docker-compose.yml in the Readme #177

Open CodeBradley opened 4 years ago

CodeBradley commented 4 years ago

When using the default docker-compose.yml in the readme:

version: '2'

services:

  mauticdb:
    image: percona/percona-server:5.7
    container_name: mauticdb
    volumes:
      - mysql_data:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=mysecret
    command:
      --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci
    networks:
      - mautic-net

  mautic:
    image: mautic/mautic:latest
    container_name: mautic
    links:
      - mauticdb:mysql
    depends_on:
      - mauticdb
    ports:
      - 8080:80
    volumes:
      - mautic_data:/var/www/html
    environment:
      - MAUTIC_DB_HOST=mauticdb
      - MYSQL_PORT_3306_TCP=3306
      - MAUTIC_DB_USER=root
      - MAUTIC_DB_PASSWORD=mysecret
      - MAUTIC_DB_NAME=mautic
      - MAUTIC_RUN_CRON_JOBS=true
    networks:
      - mautic-net

volumes:
  mysql_data:
    driver: local
  mautic_data:
    driver: local
networks:
  mautic-net:
    driver: bridge

With the following version of docker-compose: docker-compose version 1.26.0, build d4451659

I get the following errors where tables are not being created which can also be found mentioned in issue https://github.com/mautic/docker-mautic/issues/142

root@ubuntu-s-1vcpu-1gb-nyc3-01:~/mautic# docker-compose up
Creating mauticdb ... done
Creating mautic   ... done
Attaching to mauticdb, mautic
mauticdb    | 2020-10-22T22:57:24.431581Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mauticdb    | 2020-10-22T22:57:24.433796Z 0 [Note] mysqld (mysqld 5.7.31-34) starting as process 1 ...
mauticdb    | 2020-10-22T22:57:24.446763Z 0 [Note] InnoDB: PUNCH HOLE support available
mauticdb    | 2020-10-22T22:57:24.446806Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mauticdb    | 2020-10-22T22:57:24.446810Z 0 [Note] InnoDB: Uses event mutexes
mauticdb    | 2020-10-22T22:57:24.446815Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
mauticdb    | 2020-10-22T22:57:24.446818Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.7
mauticdb    | 2020-10-22T22:57:24.446820Z 0 [Note] InnoDB: Using Linux native AIO
mauticdb    | 2020-10-22T22:57:24.447777Z 0 [Note] InnoDB: Number of pools: 1
mauticdb    | 2020-10-22T22:57:24.450184Z 0 [Note] InnoDB: Using CPU crc32 instructions
mauticdb    | 2020-10-22T22:57:24.452844Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
mauticdb    | 2020-10-22T22:57:24.468551Z 0 [Note] InnoDB: Completed initialization of buffer pool
mauticdb    | 2020-10-22T22:57:24.480647Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
mauticdb    | 2020-10-22T22:57:24.497378Z 0 [Note] InnoDB: Recovering partial pages from the parallel doublewrite buffer at /var/lib/mysql/xb_doublewrite
mauticdb    | 2020-10-22T22:57:24.508119Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
mauticdb    | 2020-10-22T22:57:24.512366Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 12079952
mauticdb    | 2020-10-22T22:57:24.512395Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 12079961
mauticdb    | 2020-10-22T22:57:24.512400Z 0 [Note] InnoDB: Database was not shutdown normally!
mauticdb    | 2020-10-22T22:57:24.512403Z 0 [Note] InnoDB: Starting crash recovery.
mauticdb    | 2020-10-22T22:57:24.540792Z 0 [Note] InnoDB: Created parallel doublewrite buffer at /var/lib/mysql/xb_doublewrite, size 3932160 bytes
mauticdb    | 2020-10-22T22:57:24.583231Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
mauticdb    | 2020-10-22T22:57:24.583266Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
mauticdb    | 2020-10-22T22:57:24.583331Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
mauticdb    | 2020-10-22T22:57:24.629006Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
mauticdb    | 2020-10-22T22:57:24.630461Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
mauticdb    | 2020-10-22T22:57:24.630509Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
mauticdb    | 2020-10-22T22:57:24.630866Z 0 [Note] InnoDB: Waiting for purge to start
mauticdb    | 2020-10-22T22:57:24.681141Z 0 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.7.31-34 started; log sequence number 12079961
mauticdb    | 2020-10-22T22:57:24.682983Z 0 [Note] Plugin 'FEDERATED' is disabled.
mauticdb    | 2020-10-22T22:57:24.683344Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
mauticdb    | 2020-10-22T22:57:24.706192Z 0 [Note] InnoDB: Buffer pool(s) load completed at 201022 22:57:24
mauticdb    | 2020-10-22T22:57:24.724045Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
mauticdb    | 2020-10-22T22:57:24.724271Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
mauticdb    | 2020-10-22T22:57:24.727040Z 0 [Warning] CA certificate ca.pem is self signed.
mauticdb    | 2020-10-22T22:57:24.727307Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
mauticdb    | 2020-10-22T22:57:24.728861Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
mautic      | warning: both MAUTIC_DB_HOST and MYSQL_PORT_3306_TCP found
mautic      |   Connecting to MAUTIC_DB_HOST (mauticdb)
mautic      |   instead of the linked mysql container
mauticdb    | 2020-10-22T22:57:24.733810Z 0 [Note] IPv6 is available.
mauticdb    | 2020-10-22T22:57:24.733851Z 0 [Note]   - '::' resolves to '::';
mauticdb    | 2020-10-22T22:57:24.733905Z 0 [Note] Server socket created on IP: '::'.
mauticdb    | 2020-10-22T22:57:24.792829Z 0 [Note] Event Scheduler: Loaded 0 events
mauticdb    | 2020-10-22T22:57:24.793017Z 0 [Note] mysqld: ready for connections.
mauticdb    | Version: '5.7.31-34'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Percona Server (GPL), Release 34, Revision 2e68637
mautic      | 
mautic      | Ensuring Mautic database is present
mautic      | 
mautic      | MySQL Database Created
mautic      | ========================================================================
mautic      | 
mautic      | This server is now configured to run Mautic!
mautic      | The following information will be prefilled into the installer (keep password field empty):
mautic      | Host Name: mauticdb
mautic      | Database Name: mautic
mautic      | Database Username: root
mautic      | Database Password: mysecret
mautic      | 
mautic      | ========================================================================
mautic      | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message
mautic      | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.3. Set the 'ServerName' directive globally to suppress this message
mautic      | [Thu Oct 22 22:57:25.613341 2020] [mpm_prefork:notice] [pid 12] AH00163: Apache/2.4.38 (Debian) PHP/7.1.33 configured -- resuming normal operations
mautic      | [Thu Oct 22 22:57:25.629263 2020] [core:notice] [pid 12] AH00094: Command line: 'apache2 -D FOREGROUND'
mautic      | [CRON] 
mautic      | [CRON] Warning: substr_compare(): The start position cannot exceed initial string length in /var/www/html/app/bundles/CoreBundle/IpLookup/AbstractLocalDataLookup.php on line 212
mautic      | [CRON] Automatically fetching IP lookup data failed.
mautic      | [CRON] Mautic is not set to queue email.
mautic      | [CRON] Processing message queue
mautic      | [CRON] Webhook Bundle is in immediate process mode. To use the command function change to command mode.
mautic      | [CRON] No mailboxes are configured.
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [DoctrineDBALExceptionTableNotFoundException]
mautic      | [CRON] An exception occurred while executing 'SELECT m0_.id AS id_0, m0_.channel AS channel_1, m0_.channel_id AS channel_id_2, m0_.priority AS priority_3, m0_.max_attempts AS max_attempts_4, m0_.attempts AS attempts_5, m0_.success AS success_6, m0_.status AS status_7, m0_.date_published AS date_published_8, m0_.scheduled_date AS scheduled_date_9, m0_.last_attempt AS last_attempt_10, m0_.date_sent AS date_sent_11, m0_.options AS options_12, m0_.event_id AS event_id_13, m0_.lead_id AS lead_id_14 FROM message_queue m0_ WHERE m0_.success = ? AND m0_.attempts < m0_.max_attempts AND (m0_.last_attempt IS NULL OR m0_.last_attempt < ?) AND m0_.scheduled_date <= ? ORDER BY m0_.priority ASC, m0_.scheduled_date ASC LIMIT 50' with params [0, "2020-10-22 23:00:07", "2020-10-22 23:00:07"]:
mautic      | [CRON] 
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.message_queue' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [DoctrineDBALExceptionTableNotFoundException]
mautic      | [CRON] An exception occurred while executing 'SELECT i0_.is_published AS is_published_0, i0_.date_added AS date_added_1, i0_.created_by AS created_by_2, i0_.created_by_user AS created_by_user_3, i0_.date_modified AS date_modified_4, i0_.modified_by AS modified_by_5, i0_.modified_by_user AS modified_by_user_6, i0_.checked_out AS checked_out_7, i0_.checked_out_by AS checked_out_by_8, i0_.checked_out_by_user AS checked_out_by_user_9, i0_.id AS id_10, i0_.dir AS dir_11, i0_.file AS file_12, i0_.original_file AS original_file_13, i0_.line_count AS line_count_14, i0_.inserted_count AS inserted_count_15, i0_.updated_count AS updated_count_16, i0_.ignored_count AS ignored_count_17, i0_.priority AS priority_18, i0_.status AS status_19, i0_.date_started AS date_started_20, i0_.date_ended AS date_ended_21, i0_.object AS object_22, i0_.properties AS properties_23 FROM imports i0_ WHERE i0_.status IN (1, 7) ORDER BY i0_.priority ASC, i0_.date_added DESC LIMIT 1 OFFSET 0':
mautic      | [CRON] 
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.imports' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [DoctrineDBALExceptionTableNotFoundException]
mautic      | [CRON] An exception occurred while executing 'SELECT COUNT(*) AS dctrn_count FROM (SELECT DISTINCT id_10 FROM (SELECT m0_.is_published AS is_published_0, m0_.date_added AS date_added_1, m0_.created_by AS created_by_2, m0_.created_by_user AS created_by_user_3, m0_.date_modified AS date_modified_4, m0_.modified_by AS modified_by_5, m0_.modified_by_user AS modified_by_user_6, m0_.checked_out AS checked_out_7, m0_.checked_out_by AS checked_out_by_8, m0_.checked_out_by_user AS checked_out_by_user_9, m0_.id AS id_10, m0_.title AS title_11, m0_.description AS description_12, m0_.lists AS lists_13, m0_.network_type AS network_type_14, m0_.revision AS revision_15, m0_.stats AS stats_16, m0_.properties AS properties_17, m0_.publish_up AS publish_up_18, m0_.publish_down AS publish_down_19 FROM monitoring m0_ WHERE m0_.is_published = ? AND (m0_.publish_down IS NULL OR m0_.publish_down >= ?) AND (m0_.publish_up IS NULL OR m0_.publish_up <= ?)) dctrn_result) dctrn_table' with params [1, "2020-10-22 23:00:07", "2020-10-22 23:00:07"]:
mautic      | [CRON] 
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.monitoring' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [DoctrineDBALExceptionTableNotFoundException]
mautic      | [CRON] An exception occurred while executing 'SELECT r0_.id AS id_0, r0_.schedule_date AS schedule_date_1, r1_.is_published AS is_published_2, r1_.date_added AS date_added_3, r1_.created_by AS created_by_4, r1_.created_by_user AS created_by_user_5, r1_.date_modified AS date_modified_6, r1_.modified_by AS modified_by_7, r1_.modified_by_user AS modified_by_user_8, r1_.checked_out AS checked_out_9, r1_.checked_out_by AS checked_out_by_10, r1_.checked_out_by_user AS checked_out_by_user_11, r1_.id AS id_12, r1_.name AS name_13, r1_.description AS description_14, r1_.`system` AS system_15, r1_.source AS source_16, r1_.columns AS columns_17, r1_.filters AS filters_18, r1_.table_order AS table_order_19, r1_.graphs AS graphs_20, r1_.group_by AS group_by_21, r1_.aggregators AS aggregators_22, r1_.settings AS settings_23, r1_.is_scheduled AS is_scheduled_24, r1_.schedule_unit AS schedule_unit_25, r1_.to_address AS to_address_26, r1_.schedule_day AS schedule_day_27, r1_.schedule_month_frequency AS schedule_month_frequency_28, r0_.report_id AS report_id_29 FROM reports_schedulers r0_ LEFT JOIN reports r1_ ON r0_.report_id = r1_.id WHERE r0_.schedule_date <= ?' with params ["2020-10-22 23:00:07"]:
mautic      | [CRON] 
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.reports_schedulers' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [DoctrineDBALDriverPDOException]
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.message_queue' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [DoctrineDBALDriverPDOException]
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.imports' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [DoctrineDBALDriverPDOException]
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.monitoring' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [PDOException]
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.message_queue' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] mautic:messages:send [-c|--channel [CHANNEL]] [-i|--channel-id CHANNEL-ID] [-m|--message-id MESSAGE-ID] [-f|--force] [--bypass-locking] [-t|--timeout TIMEOUT] [-x|--lock_mode LOCK_MODE] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--] <command>
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [DoctrineDBALDriverPDOException]
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.reports_schedulers' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [PDOException]
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.imports' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [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] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--] <command>
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [PDOException]
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.monitoring' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] mautic:social:monitoring [-i|--mid [MID]] [--batch-size BATCH-SIZE] [--query-count [QUERY-COUNT]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--] <command>
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [PDOException]
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.reports_schedulers' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] mautic:reports:scheduler [-report|--report [REPORT]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--] <command>
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [DoctrineDBALExceptionTableNotFoundException]
mautic      | [CRON] An exception occurred while executing 'SELECT e0_.is_published AS is_published_0, e0_.date_added AS date_added_1, e0_.created_by AS created_by_2, e0_.created_by_user AS created_by_user_3, e0_.date_modified AS date_modified_4, e0_.modified_by AS modified_by_5, e0_.modified_by_user AS modified_by_user_6, e0_.checked_out AS checked_out_7, e0_.checked_out_by AS checked_out_by_8, e0_.checked_out_by_user AS checked_out_by_user_9, e0_.id AS id_10, e0_.name AS name_11, e0_.description AS description_12, e0_.subject AS subject_13, e0_.from_address AS from_address_14, e0_.from_name AS from_name_15, e0_.reply_to_address AS reply_to_address_16, e0_.bcc_address AS bcc_address_17, e0_.template AS template_18, e0_.content AS content_19, e0_.utm_tags AS utm_tags_20, e0_.plain_text AS plain_text_21, e0_.custom_html AS custom_html_22, e0_.email_type AS email_type_23, e0_.publish_up AS publish_up_24, e0_.publish_down AS publish_down_25, e0_.read_count AS read_count_26, e0_.sent_count AS sent_count_27, e0_.variant_sent_count AS variant_sent_count_28, e0_.variant_read_count AS variant_read_count_29, e0_.revision AS revision_30, e0_.lang AS lang_31, e0_.variant_settings AS variant_settings_32, e0_.variant_start_date AS variant_start_date_33, e0_.dynamic_content AS dynamic_content_34, e0_.headers AS headers_35, e0_.public_preview AS public_preview_36, e0_.category_id AS category_id_37, e0_.translation_parent_id AS translation_parent_id_38, e0_.variant_parent_id AS variant_parent_id_39, e0_.unsubscribeform_id AS unsubscribeform_id_40, e0_.preference_center_id AS preference_center_id_41 FROM emails e0_ WHERE e0_.is_published = ? AND (e0_.publish_down IS NULL OR e0_.publish_down >= ?) AND (e0_.publish_up IS NOT NULL AND e0_.publish_up <= ?) AND e0_.email_type = 'list'' with params [1, "2020-10-22 23:00:08", "2020-10-22 23:00:08"]:
mautic      | [CRON] 
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.emails' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [DoctrineDBALDriverPDOException]
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.emails' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] [PDOException]
mautic      | [CRON] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mautic.emails' doesn't exist
mautic      | [CRON] 
mautic      | [CRON] 
mautic      | [CRON] mautic:broadcasts:send [-c|--channel [CHANNEL]] [-i|--id [ID]] [--min-contact-id [MIN-CONTACT-ID]] [--max-contact-id [MAX-CONTACT-ID]] [-l|--limit [LIMIT]] [-b|--batch [BATCH]] [-f|--force] [--bypass-locking] [-t|--timeout TIMEOUT] [-x|--lock_mode LOCK_MODE] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--] <command>
mautic      | [CRON] 

I couldn't figure out the solution to this problem, so I took the docker-compose.yml from here: https://github.com/mautic/docker-mautic/issues/142#issuecomment-565384835

This actually got me to the point where I can install Mautic and access the configuration steps, but when I try and enter the MySQL information used in the mysql config that's in the second docker-compose file it gives me the following error:

Screen Shot 2020-10-22 at 5 52 34 PM

How do I fix either one of these issues? I don't care which, I just want a working instance of mautic lol. I'm using a standard Digital Ocean droplet, the $5 plan.

--- Want to back this issue? **[Post a bounty on it!](https://app.bountysource.com/issues/93570763-tables-not-getting-created-when-using-the-docker-compose-yml-in-the-readme?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).
CodeBradley commented 3 years ago

Can anyone help me figure this out?