PSQL Error: Locale not available, when Dockerizing Omnibus installation

Summary

When moving from a GitLab-Omnibus installation to a Dockerized installation, the PostgreSQL database may be introduced with an en_US.UTF-8 (or any other) encoding. This encoding is not available in the standard GitLab Docker containers, which are based on Ubuntu. Ubuntu already mention this in their Docker image.

Steps to reproduce

  1. Install GitLab Omnibus with
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8

set in the environment (may be unintentional)

  1. Replace the Omnibus installation with a Dockerized approach (i.e. using logs, data and config as volumes in GitLab Docker container)

  2. Try to start the Docker container, and get a PostgreSQL error, which prevents GitLab from starting

What is the current bug behavior?

GitLab in Docker does not start due to a PostgreSQL error. Error states, that the database is created with an unsupported locale.

What is the expected correct behavior?

GitLab should start without issues, even when coming from a different installation strategy.

Possible fixes

Different solutions:

  • Unify the database locale in PostgreSQL
  • Install common UTF-8 locales in docker container
  • Create a hint for developers in a migration guide
Assignee Loading
Time tracking Loading