Gitlab is down after upgrade to 13.9.4-ee.0 Unable to load application: I18n::InvalidLocale: :en is not a valid locale

Hi last update crash my local server.

I am using gitlab-ee from many years , now is on Ubuntu 20.04 LTS .

After Upgrade to gitlab-ee / 13.9.4-ee.0 Puma and sidekiq crash with same errors
I google and try to find solution past 2 days but now I am desperate because nothing helps and I can’t start the server again and all my code is there

Any Idea is welcome.

Kind REgards

2021-03-21_10:51:11.63880 {“timestamp”:“2021-03-21T10:51:11.638Z”,“pid”:11818,“message”:"! Unable to load application: I18n::InvalidLocale: :en is not a valid locale"}
2021-03-21_10:51:11.63893 bundler: failed to load command: puma (/opt/gitlab/embedded/bin/puma)
2021-03-21_10:51:11.63897 I18n::InvalidLocale: :en is not a valid locale
2021-03-21_10:51:11.63899 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/i18n-1.8.7/lib/i18n.rb:342:in enforce_available_locales!' 2021-03-21_10:51:11.63901 /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/i18n-1.8.7/lib/i18n.rb:198:in translate’

==> /var/log/gitlab/sidekiq/current <==
:en is not a valid locale
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/i18n-1.8.7/lib/i18n.rb:342:in enforce_available_locales!' /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/i18n-1.8.7/lib/i18n.rb:198:in translate’
/opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activemodel- human' /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/activemodel- generate_message’

Hi @eterziev

Try doing this, either at root or with sudo, so:

dpkg-reconfigure locales

check to ensure you have appropriate locales generated, and try stopping and starting gitlab after this. As an example, you can check/verify /etc/locale.gen:

cat /etc/locale.gen | grep -v "#"
en_GB.UTF-8 UTF-8
en_US.UTF-8 UTF-8

I only have those locales generated, this is on my system with Debian, and it’s enough for my system, 13.9.4 works perfectly fine, although I am using CE and not EE version, but that shouldn’t be an issue.

Usually though Ubuntu has sufficiently enough generated locales, so shouldn’t need these commands to be ran, but it doesn’t cause any problems to redo it, and enable/disable any locales that you want or don’t want. When you run the dpkg-reconfigure command, you can go down the list, and enable at least en_US.UTF-8 if it’s not already enabled to have at least one English-based locale generated in addition to your local language if non-english.

Also, check/verify against this command:

root@gitlab:/home/ian# locale -a

will also ensure you have some valid locales configured.