Broken DB after Ghost upgraded to 4.4.0 - Docker

After you upgraded Docker image to 4.4.0 I can’t manage to fix the setup. I tried to follow this suggestion but I cant perform ghost update since ghost container is continuously crashing…

Steps I tried:

  1. exec into DB container and appended:
    init-connect='SET default_collation_for_utf8mb4=utf8mb4_general_ci'
    into /etc/mysql/conf.d/docker.cnf:
    [mysqld]
    skip-host-cache
    skip-name-resolve
    init-connect=SET default_collation_for_utf8mb4=utf8mb4_general_ci
    
  2. restarted the db: service mariadb restart:
    service mariadb restart
     * Stopping MariaDB database server mariadbd
     * Starting MariaDB database server mariadbd
    
  3. cant exec into ghost container since is continuously crashing:
    ghost.522  | [2021-05-08 10:58:42] ERROR alter table `members_products` add constraint `members_products_member_id_foreign` foreign key (`member_id`) references `members` (`id`) on delete CASCADE - ER_CANT_CREATE_TABLE: Can't create table `ghost`.`members_products` (errno: 150 "Foreign key constraint is incorrectly formed")
    ghost.522  |
    ghost.522  | alter table `members_products` add constraint `members_products_member_id_foreign` foreign key (`member_id`) references `members` (`id`) on delete CASCADE - ER_CANT_CREATE_TABLE: Can't create table `ghost`.`members_products` (errno: 150 "Foreign key constraint is incorrectly formed")
    ghost.522  |
    ghost.522  | {"config":{"transaction":false},"name":"02-add-members-products-table.js"}
    ghost.522  | "Error occurred while executing the following migration: 02-add-members-products-table.js"
    ghost.522  |
    ghost.522  | Error ID:
    ghost.522  |     300
    ghost.522  |
    ghost.522  | Error Code:
    ghost.522  |     ER_CANT_CREATE_TABLE
    ghost.522  |
    ghost.522  | ----------------------------------------
    ghost.522  |
    ghost.522  | MigrationScriptError: alter table `members_products` add constraint `members_products_member_id_foreign` foreign key (`member_id`) references `members` (`id`) on delete CASCADE - ER_CANT_CREATE_TABLE: Can't create table `ghost`.`members_products` (errno: 150 "Foreign key constraint is incorrectly formed")
    ghost.522  |     at MigrationScriptError.KnexMigrateError (/var/lib/ghost/versions/4.4.0/node_modules/knex-migrator/lib/errors.js:7:26)
    ghost.522  |     at new MigrationScriptError (/var/lib/ghost/versions/4.4.0/node_modules/knex-migrator/lib/errors.js:25:26)
    ghost.522  |     at /var/lib/ghost/versions/4.4.0/node_modules/knex-migrator/lib/index.js:1055:19
    ghost.522  |     at processTicksAndRejections (internal/process/task_queues.js:93:5)
    ghost.522  |
    ghost.522  | Error: ER_CANT_CREATE_TABLE: Can't create table `ghost`.`members_products` (errno: 150 "Foreign key constraint is incorrectly formed")
    ghost.522  |     at Query.Sequence._packetToError (/var/lib/ghost/versions/4.4.0/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
    ghost.522  |     at Query.ErrorPacket (/var/lib/ghost/versions/4.4.0/node_modules/mysql/lib/protocol/sequences/Query.js:79:18)
    ghost.522  |     at Protocol._parsePacket (/var/lib/ghost/versions/4.4.0/node_modules/mysql/lib/protocol/Protocol.js:291:23)
    ghost.522  |     at Parser._parsePacket (/var/lib/ghost/versions/4.4.0/node_modules/mysql/lib/protocol/Parser.js:433:10)
    ghost.522  |     at Parser.write (/var/lib/ghost/versions/4.4.0/node_modules/mysql/lib/protocol/Parser.js:43:10)
    ghost.522  |     at Protocol.write (/var/lib/ghost/versions/4.4.0/node_modules/mysql/lib/protocol/Protocol.js:38:16)
    ghost.522  |     at Socket.<anonymous> (/var/lib/ghost/versions/4.4.0/node_modules/mysql/lib/Connection.js:88:28)
    ghost.522  |     at Socket.<anonymous> (/var/lib/ghost/versions/4.4.0/node_modules/mysql/lib/Connection.js:526:10)
    ghost.522  |     at Socket.emit (events.js:315:20)
    ghost.522  |     at addChunk (internal/streams/readable.js:309:12)
    ghost.522  |     at readableAddChunk (internal/streams/readable.js:284:9)
    ghost.522  |     at Socket.Readable.push (internal/streams/readable.js:223:10)
    ghost.522  |     at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
    ghost.522  |     --------------------
    ghost.522  |     at Protocol._enqueue (/var/lib/ghost/versions/4.4.0/node_modules/mysql/lib/protocol/Protocol.js:144:48)
    ghost.522  |     at Connection.query (/var/lib/ghost/versions/4.4.0/node_modules/mysql/lib/Connection.js:198:25)
    ghost.522  |     at /var/lib/ghost/versions/4.4.0/node_modules/knex/lib/dialects/mysql/index.js:134:18
    ghost.522  |     at new Promise (<anonymous>)
    ghost.522  |     at Client_MySQL._query (/var/lib/ghost/versions/4.4.0/node_modules/knex/lib/dialects/mysql/index.js:128:12)
    ghost.522  |     at Client_MySQL.query (/var/lib/ghost/versions/4.4.0/node_modules/knex/lib/client.js:168:17)
    ghost.522  |     at Runner.query (/var/lib/ghost/versions/4.4.0/node_modules/knex/lib/runner.js:151:36)
    ghost.522  |     at Runner.queryArray (/var/lib/ghost/versions/4.4.0/node_modules/knex/lib/runner.js:248:31)
    ghost.522  |     at processTicksAndRejections (internal/process/task_queues.js:93:5)
    ghost.522  |     at async /var/lib/ghost/versions/4.4.0/node_modules/knex/lib/runner.js:277:18
    ghost.522  |     at async Object.up (/var/lib/ghost/versions/4.4.0/core/server/data/migrations/utils.js:239:13)
    

I am offline for more than a week now… Can somebody suggest how this can be put back to normal using docker setup please?

Thanks, Michal

Have you found a solution to this problem?