Postgresql doesnt start after server restart (omnibus install)
Hey,
after a restart or my server, postgresql doesnt start up anymore... I had this problem before, and did a complete re-install of gitlab. After that it worked for a while, but now i get this when i run
sudo gitlab-ctl reconfiguere
Running handlers:
[2015-12-23T11:58:26+01:00] ERROR: Running exception handlers
Running handlers complete
[2015-12-23T11:58:26+01:00] ERROR: Exception handlers complete
Chef Client failed. 3 resources updated in 59 seconds
[2015-12-23T11:58:26+01:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out
[2015-12-23T11:58:26+01:00] ERROR: execute[create gitlab database user] (gitlab::postgresql line 153) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
---- Begin output of /opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d template1 -c "CREATE USER gitlab" ----
STDOUT:
STDERR: psql: 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"?
---- End output of /opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d template1 -c "CREATE USER gitlab" ----
Ran /opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d template1 -c "CREATE USER gitlab" returned 2
[2015-12-23T11:58:28+01:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
The stacktrace.out shows me this:
Generated at 2015-12-23 11:58:26 +0100
Mixlib::ShellOut::ShellCommandFailed: execute[create gitlab database user] (gitlab::postgresql line 153) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
---- Begin output of /opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d template1 -c "CREATE USER gitlab" ----
STDOUT:
STDERR: psql: 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"?
---- End output of /opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d template1 -c "CREATE USER gitlab" ----
Ran /opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d template1 -c "CREATE USER gitlab" returned 2
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.5/lib/mixlib/shellout.rb:289:in `invalid!'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.5/lib/mixlib/shellout.rb:276:in `error!'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/mixin/shell_out.rb:56:in `shell_out!'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/provider/execute.rb:61:in `block in action_run'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/mixin/why_run.rb:52:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/provider.rb:175:in `converge_by'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/provider/execute.rb:60:in `action_run'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/provider.rb:144:in `run_action'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/resource.rb:585:in `run_action'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/runner.rb:49:in `run_action'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/runner.rb:81:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/runner.rb:81:in `block in converge'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1/lib/chef/resource_collection/resource_list.rb:83:in `block in execute_each_resource'
"/opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out" [noeol] 50L, 5202C
A
sudo gitlab-ctl status
shows, that postgresql is down:
run: gitlab-workhorse: (pid 676) 408s; run: log: (pid 671) 408s
run: logrotate: (pid 677) 408s; run: log: (pid 668) 408s
down: postgresql: 1s, normally up, want up; run: log: (pid 672) 408s
run: redis: (pid 675) 408s; run: log: (pid 674) 408s
run: sidekiq: (pid 3070) 11s; run: log: (pid 669) 408s
run: unicorn: (pid 683) 408s; run: log: (pid 682) 408s
What can i do to let postgresql work as it should? As i said, this happened after i did a server restart.
Thx to all