Gitlab-Rails PG::ConnectionBad after update
Hello,
I cant update my gitlab from version 7.10 (ombnibus) to version 8.0 (ce).
After tons of research I managed to install the package without problems. My gitlab-ctl reconfigure
makes no errors.
Running handlers:
Running handlers complete
Chef Client finished, 6/191 resources updated in 8.098852989 seconds
gitlab Reconfigured!
For my Update I read the following Doc: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/6.x-or-7.x-to-7.14.md#L16
I did only Point #1 (closed) and updated my gitlab with this version: https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/precise/gitlab-ce_8.0.0-ce.1_amd64.deb
and I followed the answer of this topic: https://forum.gitlab.com/t/upgrading-gitlab-from-6-2-to-8-5/2423
My gitlab.rb:
# commented out
# gitlab_rails['db_adapter'] = "postgresql"
# gitlab_rails['db_encoding'] = "unicode"
# gitlab_rails['db_database'] = "gitlabhq_production"
# gitlab_rails['db_pool'] = 10
# gitlab_rails['db_username'] = "gitlab"
# gitlab_rails['db_password'] = nil
....
# postgresql['enable'] = true
# postgresql['listen_address'] = nil
# postgresql['port'] = 5432
# postgresql['data_dir'] = "/var/opt/gitlab/postgresql/data"
# postgresql['shared_buffers'] = "256MB" # recommend value is 1/4 of total RAM, up to 14GB.
sudo gitlab-rake gitlab:env:info --trace
output
System: Ubuntu 14.04
Current User: git
Using RVM: no
Ruby Version: 2.1.6p336
Gem Version: 2.2.5
Bundler Version:1.5.3
Rake Version: 10.4.2
Sidekiq Version:3.3.0
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 "/tmp/.s.PGSQL.5432"?
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `initialize'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `new'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `connect'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/postgresql_adapter.rb:568:in `initialize'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `new'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:435:in `new_connection'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:445:in `checkout_new_connection'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `acquire_connection'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:351:in `block in checkout'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:350:in `checkout'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_adapters/abstract/connection_pool.rb:541:in `retrieve_connection'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activerecord-4.1.12/lib/active_record/connection_handling.rb:87:in `connection'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/info.rake:31:in `block (3 levels) in <top (required)>'
Tasks: TOP => gitlab:env:info
`/var/log/gitlab/gitlab-rails/production`
PG::ConnectionBad (could not connect to server: Permission denied Is the server running locally and accepting connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"? ): activerecord (4.1.12) lib/active_record/connection_adapters/postgresql_adapter.rb:888:in initialize' activerecord (4.1.12) lib/active_record/connection_adapters/postgresql_adapter.rb:888:in new' activerecord (4.1.12) lib/active_record/connection_adapters/postgresql_adapter.rb:888:in connect' activerecord (4.1.12) lib/active_record/connection_adapters/postgresql_adapter.rb:568:in initialize' activerecord (4.1.12) lib/active_record/connection_adapters/postgresql_adapter.rb:41:in new' activerecord (4.1.12) lib/active_record/connection_adapters/postgresql_adapter.rb:41:in postgresql_connection' activerecord (4.1.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:435:in new_connection' activerecord (4.1.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:445:in checkout_new_connection' activerecord (4.1.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in acquire_connection' activerecord (4.1.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:351:in block in checkout' /opt/gitlab/embedded/lib/ruby/2.1.0/monitor.rb:211:in mon_synchronize' activerecord (4.1.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:350:in checkout' activerecord (4.1.12) lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in block in connection' /opt/gitlab/embedded/lib/ruby/2.1.0/monitor.rb:211:in mon_synchronize'
`/var/log/gitlab/postgresql/current`
2017-07-19_14:46:34.63864 LOG: database system is shut down 2017-07-19_14:46:34.83230 LOG: database system was shut down at 2017-07-19 14:46:34 GMT 2017-07-19_14:46:34.85156 LOG: database system is ready to accept connections 2017-07-19_14:46:34.85209 LOG: autovacuum launcher started
After 2 hours I found that in my `/var/opt/gitlab/gitlab-rails/etc/database.yml` my username was maybe wrong:
production: adapter: postgresql encoding: unicode database: gitlabhq_production pool: 10 username: 'gitlab' <-- not gitlab-psql ?? password: host: '/var/opt/gitlab/postgresql' port: 5432 socket: sslmode: sslrootcert: