Omnibus upgrade from 6.7.5 to 7.7.2 fails

Hello,

I am trying to upgrade 6…7.5 to 7.7.2 running on CentOS 6.6 and upgrade fails.

firs it failed trying to delete symlink to /opt/gitlab/embedded/service/gitlab-rails/config/initializers/smtp_settings.rb. It was an actual file in my case so it just failed. I moved the file to /var/opt/gitlab/gitlab-rails/etc/smtp_settings.rb and created a symlink instead and it went further. now it fails on postgress update. I am not familiar with postgress and ruby (I am a java guy :smiley:) so I am not sure how to fix it. Yout help will be greatly appreciated

  * template[/opt/gitlab/sv/postgresql/log/run] action create (up to date)
  * template[/var/log/gitlab/postgresql/config] action create
    - create new file /var/log/gitlab/postgresql/config
    - update content in file /var/log/gitlab/postgresql/config from none to 623c00
        --- /var/log/gitlab/postgresql/config   2015-02-04 07:48:13.821298016 -0500
        +++ /tmp/chef-rendered-template20150204-1991-teyfx2     2015-02-04 07:48:13.822298016 -0500
        @@ -1 +1,7 @@
        +s209715200
        +n30
        +t86400
        +!gzip
        +
        +
    - change owner from '' to 'root'
    - change group from '' to 'root'
    - restore selinux security context

  * ruby_block[reload postgresql svlogd configuration] action nothing (skipped due to action :nothing)
  * file[/opt/gitlab/sv/postgresql/down] action delete (up to date)
  * directory[/opt/gitlab/sv/postgresql/control] action create (up to date)
  * template[/opt/gitlab/sv/postgresql/control/t] action create (up to date)
  * link[/opt/gitlab/init/postgresql] action create (up to date)
  * link[/opt/gitlab/service/postgresql] action create (up to date)
  * ruby_block[supervise_postgresql_sleep] action run (skipped due to not_if)
  * service[postgresql] action nothing (skipped due to action :nothing)
  * execute[create gitlab database user] action run
================================================================================
Error executing action `run` on resource 'execute[create gitlab database user]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '2'
---- Begin output of /opt/gitlab/embedded/bin/psql --port 5432 -d template1 -c "CREATE USER gitlab" ----
STDOUT: 
STDERR: psql: FATAL:  Peer authentication failed for user "gitlab-psql"
---- End output of /opt/gitlab/embedded/bin/psql --port 5432 -d template1 -c "CREATE USER gitlab" ----
Ran /opt/gitlab/embedded/bin/psql --port 5432 -d template1 -c "CREATE USER gitlab" returned 2


Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/gitlab/recipes/postgresql.rb

160:   execute "create #{sql_user} database user" do
161:     command "#{bin_dir}/psql --port #{pg_port} -d template1 -c \"CREATE USER #{sql_user}\""
162:     user pg_user
163:     not_if { !pg_helper.is_running? || pg_helper.user_exists?(sql_user) }
164:   end
165: 



Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/gitlab/recipes/postgresql.rb:160:in `block in from_file'

execute("create gitlab database user") do
  action "run"
  retries 0
  retry_delay 2
  guard_interpreter :default
  command "/opt/gitlab/embedded/bin/psql --port 5432 -d template1 -c \"CREATE USER gitlab\""
  backup 5
  returns 0
  user "gitlab-psql"
  cookbook_name :gitlab
  recipe_name "postgresql"
  not_if { #code block }
end



Recipe: gitlab::gitlab-rails
  * execute[clear the gitlab-rails cache] action run
    - execute /opt/gitlab/bin/gitlab-rake cache:clear

Recipe: gitlab::database_migrations
  * bash[migrate gitlab-rails database] action run
================================================================================
Error executing action `run` on resource 'bash[migrate gitlab-rails database]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of "bash"  "/tmp/chef-script20150204-1991-6c34kz" ----
STDOUT: rake aborted!
PG::Error: FATAL:  Peer authentication failed for user "gitlab"

Tasks: TOP => db:migrate
(See full trace by running task with --trace)
STDERR: 
---- End output of "bash"  "/tmp/chef-script20150204-1991-6c34kz" ----
Ran "bash"  "/tmp/chef-script20150204-1991-6c34kz" returned 1


Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/gitlab/definitions/migrate_database.rb

 19:   bash "migrate #{params[:name]} database" do
 20:     code <<-EOH
 21:       set -e
 22:       log_file="/tmp/#{params[:name]}-db-migrate-$(date +%s)-$$/output.log"
 23:       umask 077
 24:       mkdir $(dirname ${log_file})
 25:       #{params[:command]} 2>& 1 | tee ${log_file}
 26:       exit ${PIPESTATUS[0]}
 27:     EOH
 28:     action params[:action]
 29:   end
 30: end



Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/gitlab/definitions/migrate_database.rb:19:in `block in from_file'

bash("migrate gitlab-rails database") do
  params {:command=>"/opt/gitlab/bin/gitlab-rake db:migrate", :action=>:nothing, :name=>"gitlab-rails"}
  action [:nothing]
  retries 0
  retry_delay 2
  guard_interpreter :default
  command "\"bash\"  \"/tmp/chef-script20150204-1991-6c34kz\""
  backup 5
  returns 0
  code "      set -e\n      log_file=\"/tmp/gitlab-rails-db-migrate-$(date +%s)-$$/output.log\"\n      umask 077\n      mkdir $(dirname ${log_file})\n      /opt/gitlab/bin/gitlab-rake db:migrate 2>& 1 | tee ${log_file}\n      exit ${PIPESTATUS[0]}\n"
  interpreter "bash"
  cookbook_name :gitlab
  recipe_name "database_migrations"
end



Recipe: gitlab::redis
  * service[redis] action restart
    - restart service service[redis]

  * ruby_block[reload redis svlogd configuration] action create
    - execute the ruby block reload redis svlogd configuration

Recipe: gitlab::postgresql
  * service[postgresql] action restart
    - restart service service[postgresql]

  * ruby_block[reload postgresql svlogd configuration] action create
    - execute the ruby block reload postgresql svlogd configuration


Running handlers:
[2015-02-04T07:48:23-05:00] ERROR: Running exception handlers
Running handlers complete

[2015-02-04T07:48:23-05:00] ERROR: Exception handlers complete
[2015-02-04T07:48:23-05:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out
Chef Client failed. 37 resources updated in 22.649381613 seconds
[2015-02-04T07:48:23-05:00] ERROR: Chef::Exceptions::MultipleFailures
[2015-02-04T07:48:23-05:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
[

rightly or wrongly I added
“gitlab git-psql gitlab” line
to /var/opt/gitlab/postgresql/data/pg_ident.conf

and reconfig finished successfully but now when I hit web site I get

“No authentication methods configured” and no login prompt

checking database migration status and running migrate solved the issue
gitlab-rake db:migrate:status
gitlab-rake db:migrate

2 Likes

Solved my problem , thanks

Thanks a lot. It helped me to upgrade from 6.8.2 to 8.2.2 !