gitlabgitlab-omnibus

Running gitlab version > 15, gives an error: [migrate gitlab-rails database] had an error: Mixlib::ShellOut::ShellCommandFailed


I using docker-compose to deploy a new gitlab instance but I get following error logs in gitlab_web container:

  ================================================================================
  Error executing action `run` on resource 'bash[migrate gitlab-rails database]'
  ================================================================================
FATAL: Mixlib::ShellOut::ShellCommandFailed: rails_migration[gitlab-rails] (gitlab::database_migrations line 51) had an error: Mixlib::ShellOut::ShellCommandFailed: bash[migrate gitlab-rails database] (gitlab::database_migrations line 18) had an error: Mixlib::ShellOut::ShellCommandFailed: Command execution failed. STDOUT/STDERR suppressed for sensitive resource

environment:

gitlab/gitlab-ce:15.3.3-ce.0

postgres:14.2

docker 20.10.17


Solution

  • Find the issue. it is related to the postgre database. Because I use previous version of postgre in my old docker compose i just change the version of that in new docker compose but the env vars need to be updated too.

    change these

    DB_USER 
    DB_PASS 
    DB_NAME
    

    to

    POSTGRES_USER
    POSTGRES_PASSWORD
    POSTGRES_DB