Skip to content

Migrations failing with decomposed CI database

Summary

During a fresh install with a decomposed CI database, the migrations are failing with:

Running db:schema:load:main rake task
rake aborted!
TypeError: Invalid type for configuration. Expected Symbol, String, or Hash. Got nil

Steps to reproduce

  1. Setup a fresh DB instance

  2. Initialize a fresh DB for CI usage

  3. Deploy GitLab, e.g. using the Helm chart with the following values:

    global:
      psql:
        host: postgresql.namespace-datastore
        port: 5432
        username: gitlab
        applicationName:
        preparedStatements: false
        main:
          database: gitlabhq_production
        ci:
          enabled: true
          database: gitlabhq_production_ci
      extraEnv:
        GITLAB_ALLOW_SEPARATE_CI_DATABASE: "true"
  4. Observe the migrations failing with TypeError: Invalid type for configuration. Expected Symbol, String, or Hash. Got nil

What is the current bug behavior?

Migrations are failing with a decomposed DB because of a known rails bug: https://github.com/rails/rails/issues/50672

The fix is already available upstream https://github.com/rails/rails/pull/54853 but not present in the rails version used by GitLab.

What is the expected correct behavior?

Migrations pass with a decomposed DB.

Possible fixes

Port the rails fix to GitLab or upgrade rails to 7.1+.

Edited by 🤖 GitLab Bot 🤖