Skip to content

1.63.0-g migration fails on MariaDB 11.4 (blob_id bigint mismatch)Β #3774

@anthony-arnoux

Description

@anthony-arnoux

πŸ› Bug Report

pwpush fails on db:migrate with pglombardo/pwpush:1.63.0-g and mariadb:11.4.

βœ… Expected

Container pwpush starts with successful database migration.

❌ Actual

ActiveRecord migration fails on Active Storage foreign key (fresh install) :

ActiveRecord::MismatchedForeignKey: Column "blob_id" on table "active_storage_attachments"
does not match column "id" on "active_storage_blobs" (type bigint(20)).
To resolve: change "blob_id" to :bigint.
Original: Mysql2::Error: Can"t create table "db"."active_storage_attachments"
(errno: 150 "Foreign key constraint is incorrectly formed")

πŸ”¬ How To Reproduce (docker-compose.yml)

services:
  pwpush:
    container_name: pwpush
    image: pglombardo/pwpush:1.63.0-g
    restart: unless-stopped
    environment:
      - DATABASE_URL=mysql2://user:password@pwpush-db:3306/db
    depends_on:
      - pwpush-db
    volumes:
      - /data/pwpush/storage:/opt/PasswordPusher/storage

  pwpush-db:
    container_name: pwpush-db
    image: mariadb:11.4
    restart: unless-stopped
    environment:
      MARIADB_USER: "user"
      MARIADB_PASSWORD: "password"
      MARIADB_DATABASE: "db"
      MARIADB_RANDOM_ROOT_PASSWORD: "yes"
    volumes:
      - /data/pwpush/db:/var/lib/mysql

🧩 Environment

OS: Debian 13 amd64
Docker: 28.5.1
Images:

  • pwpush: pglombardo/pwpush:1.63.0-g
  • mariadb: mariadb:11.4

🧠 Hypothesis (IA)

active_storage_attachments.blob_id created as int(11) while active_storage_blobs.id is bigint(20), producing a type mismatch and preventing foreign key creation.

πŸ› οΈ Workarounds (IA)

ALTER TABLE active_storage_attachments MODIFY blob_id BIGINT(20) NOT NULL;

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions