Check for locale and throw better error if not UTF-8 during reconfigure
Summary
(Summarize the bug encountered concisely)
We can provision gitlab-ce 10.6 on a clean install of Ubuntu 14.04. But the same installation fails on a clean install of Ubuntu 16.04. I can install any version of gitlab 10.5 and earlier without any issue on 16.04. But things are failing on 16.04 starting with gitlab 10.6. (as background, we are installing gitlab-ce (omnibus) (via puppet)
Steps to reproduce
(How one can reproduce the issue - this is very important)
Spin up a clean install of Ubuntu 16.04. Attempt to install gitlab-ce 10.6 - 10.8 (I haven't tested beyond these versions) (edit. I just tried spinning up the latest version of gitlab-ce (omnibus) with Ubuntu 16.04. I'm getting the same result.)
(Installing a clean install of Ubuntu 14.04 works as expected. I can then upgrade Ubuntu to 16.04 and it still works. But a clean install of 16.04 with gitlab 10.6 fails. Of note, I can install gitlab-ce 10.5 on Ubuntu 16.04 without any issues.
We're provisioning gitlab-ce via Puppet. Once the puppet script gets to the reconfigure (gitlab-ctl reconfigure), I get encoding errors.
STDERR: initdb: encoding mismatch ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: The encoding you selected (UTF8) and the encoding that the ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: selected locale uses (LATIN1) do not match. This would lead to ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: misbehavior in various character string processing functions. ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Rerun initdb and either do not specify an encoding explicitly, ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: or choose a matching combination. ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ---- End output of /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 ---- ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Ran /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 returned 1 ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Resource Declaration: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: --------------------- ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/postgresql/recipes/enable.rb ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: 80: execute "/opt/gitlab/embedded/bin/initdb -D #{postgresql_data_dir} -E UTF8" do ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: 81: user postgresql_username ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: 82: not_if { pg_helper.bootstrapped? } ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: 83: end ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: 84:
What is the expected correct behavior?
It should provision puppet and successfully run the reconfigure command.
Relevant logs and/or screenshots
The full error:
* execute[/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8] action run ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: [execute] The files belonging to this database system will be owned by user "gitlab-psql". ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: This user must also own the server process. ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: The database cluster will be initialized with locale "en_US". ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: initdb: encoding mismatch ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: The encoding you selected (UTF8) and the encoding that the ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: selected locale uses (LATIN1) do not match. This would lead to ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: misbehavior in various character string processing functions. ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Rerun initdb and either do not specify an encoding explicitly, ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: or choose a matching combination. ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ================================================================================ ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Error executing action `run` on resource 'execute[/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8]' ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ================================================================================ ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Mixlib::ShellOut::ShellCommandFailed ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ------------------------------------ ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Expected process to exit with [0], but received '1' ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ---- Begin output of /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 ---- ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: STDOUT: The files belonging to this database system will be owned by user "gitlab-psql". ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: This user must also own the server process. ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: The database cluster will be initialized with locale "en_US". ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: STDERR: initdb: encoding mismatch ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: The encoding you selected (UTF8) and the encoding that the ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: selected locale uses (LATIN1) do not match. This would lead to ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: misbehavior in various character string processing functions. ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Rerun initdb and either do not specify an encoding explicitly, ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: or choose a matching combination. ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ---- End output of /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 ---- ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Ran /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 returned 1 ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Resource Declaration: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: --------------------- ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/postgresql/recipes/enable.rb ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: 80: execute "/opt/gitlab/embedded/bin/initdb -D #{postgresql_data_dir} -E UTF8" do ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: 81: user postgresql_username ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: 82: not_if { pg_helper.bootstrapped? } ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: 83: end ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: 84: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Compiled Resource: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ------------------ ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/postgresql/recipes/enable.rb:80:in `from_file' ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: execute("/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8") do ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: action [:run] ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: default_guard_interpreter :execute ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: command "/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8" ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: backup 5 ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: returns 0 ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: user "gitlab-psql" ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: declared_type :execute ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: cookbook_name "postgresql" ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: recipe_name "enable" ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: domain nil ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: not_if { #code block } ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: end ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: System Info: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ------------ ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: chef_version=13.6.4 ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: platform=ubuntu ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: platform_version=16.04 ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ruby=ruby 2.3.7p456 (2018-03-28 revision 63024) [x86_64-linux] ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: program_name=/opt/gitlab/embedded/bin/chef-client ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: executable=/opt/gitlab/embedded/bin/chef-client ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Running handlers: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: There was an error running gitlab-ctl reconfigure: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: execute[/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8] (postgresql::enable line 80) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ---- Begin output of /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 ---- ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: STDOUT: The files belonging to this database system will be owned by user "gitlab-psql". ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: This user must also own the server process. ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: The database cluster will be initialized with locale "en_US". ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: STDERR: initdb: encoding mismatch ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: The encoding you selected (UTF8) and the encoding that the ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: selected locale uses (LATIN1) do not match. This would lead to ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: misbehavior in various character string processing functions. ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Rerun initdb and either do not specify an encoding explicitly, ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: or choose a matching combination. ==> admin01: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ---- End output of /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 ---- ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Ran /opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8 returned 1 ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Running handlers complete ==> admin01: Notice: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]/returns: Chef Client failed. 3 resources updated in 06 seconds ==> admin01: Error: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]: Failed to call refresh: '/usr/bin/gitlab-ctl reconfigure' returned 1 instead of one of [0] ==> admin01: Error: /Stage[main]/Gitlab::Config/Exec[gitlab_reconfigure]: '/usr/bin/gitlab-ctl reconfigure' returned 1 instead of one of [0] ==> admin01: Info: Class[Gitlab::Config]: Unscheduling all events on Class[Gitlab::Config] ==> admin01: Notice: /Stage[main]/Gitlab::Service/Service[gitlab-runsvdir]: Dependency Exec[gitlab_reconfigure] has failures: true
Results of GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:env:info
)
(Run with --trace flag)
sudo gitlab-rake gitlab:env:info --trace ** Invoke gitlab:env:info (first_time) ** Invoke gitlab_environment (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute gitlab_environment ** Execute gitlab:env:info System information System: Ubuntu 16.04 Current User: git Using RVM: no Ruby Version: 2.3.7p456 Gem Version: 2.6.14 Bundler Version:1.13.7 Rake Version: 12.3.1 Redis Version: 3.2.11 Git Version: 2.16.4 Sidekiq Version:5.0.5 Go Version: unknown rake aborted! PG::ConnectionBad: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"? /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout' /opt/gitlab/embedded/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection' /opt/gitlab/embedded/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_handling.rb:113:in `retrieve_connection' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activerecord-4.2.10/lib/active_record/connection_handling.rb:87:in `connection' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/info.rake:38:in `block (3 levels) in ' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `block in execute' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `each' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:271:in `execute' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:213:in `block in invoke_with_call_chain' /opt/gitlab/embedded/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:193:in `invoke_with_call_chain' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/task.rb:182:in `invoke' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:160:in `invoke_task' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block (2 levels) in top_level' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `each' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:116:in `block in top_level' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:125:in `run_with_threads' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:110:in `top_level' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:83:in `block in run' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:186:in `standard_exception_handling' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/lib/rake/application.rb:80:in `run' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/rake-12.3.1/exe/rake:27:in `' /opt/gitlab/embedded/bin/rake:23:in `load' /opt/gitlab/embedded/bin/rake:23:in `' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `load' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:74:in `kernel_load' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli/exec.rb:27:in `run' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:332:in `exec' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:20:in `dispatch' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/cli.rb:11:in `start' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/exe/bundle:34:in `block in ' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/lib/bundler/friendly_errors.rb:100:in `with_friendly_errors' /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/bundler-1.13.7/exe/bundle:26:in `' /opt/gitlab/embedded/bin/bundle:23:in `load' /opt/gitlab/embedded/bin/bundle:23:in `' Tasks: TOP => gitlab:env:info
Results of GitLab application Check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)
sudo gitlab-rake gitlab:check SANITIZE=true Checking GitLab Shell ... GitLab Shell version >= 7.1.2 ? ... OK (7.1.2) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:root, or git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... rake aborted! PG::ConnectionBad: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"? /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:175:in `check_repos_hooks_directory_is_link' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/check.rake:51:in `block (3 levels) in ' /opt/gitlab/embedded/bin/bundle:23:in `load' /opt/gitlab/embedded/bin/bundle:23:in `' Tasks: TOP => gitlab:check => gitlab:gitlab_shell:check (See full trace by running task with --trace)
Possible fixes
Manually adding environment variables seems to get things working again. But ideally this would be included in the start script. For devops reasons, we would like to avoid having to modify the server configs to get this working. (our team uses puppet both for instantaneously spinning up VMs on demand, but also to allow developers to spin up a local copy in Vagrant/Virtualbox). Up until this version of gitlab, things worked flawlessly in that regard.
We're trying to move to HEAD. But we need to deal with this issue before moving forward. Ideally, this would be handled in the start scripts. I do notice that fresh installs of Ubuntu 16.04 don't include the language environment variables.
LANG="en_US.UTF-8"
LANGUAGE="en_US:"
This issue has also been reported to the developer's of the puppet-gitlab module (Which is used to install gitlab-ce)
https://github.com/voxpupuli/puppet-gitlab/issues/318
It also seems related (but not identical) to