Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 9,361
    • Issues 9,361
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Jira
    • Jira
  • Merge requests 139
    • Merge requests 139
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Do not update/delete: Banner broadcast message test data

Do not update/delete: Notification broadcast message test data

  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #2728
Closed
Open
Issue created Jun 23, 2017 by username-removed-99381@rbmh

Upgrade to 9.3.0 - Issue in DB-Migration: collation mix between utf8_unicode_ci and utf8_unicode_ci

Dear all,

I updated the gitlab instance to 9.3.0 and had the following issue.

Looks like the name column of the ci_stages table uses utf8_unicode_ci and the stage_id column of the ci_builds table uses utf8_general_ci

I could fix it by changing collation of ci_stages.name to utf8_general_gi - which only works as there is normal ascii text content. Maybe you can have a look if others have this too or where this table declaration comes from.

Recipe: gitlab::database_migrations
  * bash[migrate gitlab-rails database] action run
    [execute] rake aborted!
              StandardError: An error has occurred, all later migrations canceled:
              
              Mysql2::Error: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=': UPDATE `ci_builds` SET `stage_id` = (SELECT id FROM ci_stages
                 WHERE ci_stages.pipeline_id = ci_builds.commit_id
                   AND ci_stages.name = ci_builds.stage)
               WHERE `ci_builds`.`id` >= 1 AND `ci_builds`.`id` < 1022 AND `ci_builds`.`stage_id` IS NULL/opt/gitlab/embedded/service/gitlab-rails/config/initializers/connection_fix.rb:20:in `execute'
              /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:231:in `block in update_column_in_batches'
              /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:208:in `loop'
              /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:208:in `update_column_in_batches'
              /opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20170526190000_migrate_build_stage_reference_again.rb:17:in `up'
              /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:50:in `block (3 levels) in <main>'
              /opt/gitlab/embedded/bin/bundle:22:in `load'
              /opt/gitlab/embedded/bin/bundle:22:in `<main>'
              ActiveRecord::StatementInvalid: Mysql2::Error: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=': UPDATE `ci_builds` SET `stage_id` = (SELECT id FROM ci_stages
                 WHERE ci_stages.pipeline_id = ci_builds.commit_id
                   AND ci_stages.name = ci_builds.stage)
               WHERE `ci_builds`.`id` >= 1 AND `ci_builds`.`id` < 1022 AND `ci_builds`.`stage_id` IS NULL
              /opt/gitlab/embedded/service/gitlab-rails/config/initializers/connection_fix.rb:20:in `execute'
              /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:231:in `block in update_column_in_batches'
              /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:208:in `loop'
              /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:208:in `update_column_in_batches'
              /opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20170526190000_migrate_build_stage_reference_again.rb:17:in `up'
              /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:50:in `block (3 levels) in <main>'
              /opt/gitlab/embedded/bin/bundle:22:in `load'
              /opt/gitlab/embedded/bin/bundle:22:in `<main>'
              Mysql2::Error: Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '='
              /opt/gitlab/embedded/service/gitlab-rails/config/initializers/connection_fix.rb:20:in `execute'
              /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:231:in `block in update_column_in_batches'
              /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:208:in `loop'
              /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:208:in `update_column_in_batches'
              /opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20170526190000_migrate_build_stage_reference_again.rb:17:in `up'
              /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:50:in `block (3 levels) in <main>'
              /opt/gitlab/embedded/bin/bundle:22:in `load'
              /opt/gitlab/embedded/bin/bundle:22:in `<main>'
              Tasks: TOP => db:migrate
              (See full trace by running task with --trace)
              == 20170526190000 MigrateBuildStageReferenceAgain: migrating ==================
              -- exec_query("SELECT COUNT(*) AS count FROM `ci_builds` WHERE `ci_builds`.`stage_id` IS NULL")
                 -> 0.0011s
              -- exec_query("SELECT  `ci_builds`.`id` FROM `ci_builds` WHERE `ci_builds`.`stage_id` IS NULL  ORDER BY `ci_builds`.`id` ASC LIMIT 1")
                 -> 0.0008s
              -- exec_query("SELECT  `ci_builds`.`id` FROM `ci_builds` WHERE `ci_builds`.`id` >= 1 AND `ci_builds`.`stage_id` IS NULL  ORDER BY `ci_builds`.`id` ASC LIMIT 1 OFFSET 1013")
                 -> 0.0008s
              -- execute("UPDATE `ci_builds` SET `stage_id` = (SELECT id FROM ci_stages\n   WHERE ci_stages.pipeline_id = ci_builds.commit_id\n     AND ci_stages.name = ci_builds.stage)\n WHERE `ci_builds`.`id` >= 1 AND `ci_builds`.`id` < 1022 AND `ci_builds`.`stage_id` IS NULL")
    
    ================================================================================
    Error executing action `run` on resource 'bash[migrate gitlab-rails database]'
    ================================================================================
Assignee
Assign to
Time tracking