About locale problem, need help

I am using gitlab 8.14.1
When I install gitlab, my operating system locale set to “en_US.UTF-8”. I don’t know when, my command line always prompts warnings, en_US.UTF-8 no such file or directory. I use the command “locale -a”, I just see “en_US.utf8”, has no “en_US.UTF-8”. When i restart gitlab, I got an error show me:
2020-12-18_07:25:25.45758 DETAIL: The database was initialized with LC_COLLATE “en_US.UTF-8”, which is not recognized by setlocale().
2020-12-18_07:25:25.45759 HINT: Recreate the database with another locale or install the missing locale.
2020-12-18_07:25:25.46884 FATAL: database locale is incompatible with operating system
I don’t know how to change “en_US.utf8” to “en_US.UTF-8”, or how to migrate the database from “en_US.UTF-8” to “en_US.utf8”.
I try the command “localedef -i en_US -f UTF-8 en_US.UTF-8” and “localedef -c -f UTF-8 -i en_US en_US.UTF-8”, but command “locale -a” result only contains “en_US.utf8”, has no “en_US.UTF-8”.

On the off-chance you use macOS Terminal.app when SSH-ing to your server, please follow this article and disable the forced set of locale variables by the app.