Getting 500 error after upgrading from 8.5
After I updated from GitLab 8.5 I am getting 500 error and cant do anything. Reboot did nothing.
Started GET "/users/sign_in" for 107.107.57.216 at 2016-03-23 07:23:36 -0400
Processing by SessionsController#new as HTML
Completed 500 Internal Server Error in 69ms (ActiveRecord: 8.6ms)
NoMethodError (undefined method `external=' for #<User:0x000000076376d8>):
app/controllers/sessions_controller.rb:21:in `new'
lib/gitlab/middleware/go.rb:16:in `call'
Started GET "/" for 107.107.57.216 at 2016-03-23 07:23:40 -0400
Processing by RootController#index as HTML
Completed 401 Unauthorized in 20ms (ActiveRecord: 3.7ms)
Started GET "/users/sign_in" for 107.107.57.216 at 2016-03-23 07:23:40 -0400
Processing by SessionsController#new as HTML
Completed 500 Internal Server Error in 68ms (ActiveRecord: 8.0ms)
NoMethodError (undefined method `external=' for #<User:0x000000072f00b0>):
app/controllers/sessions_controller.rb:21:in `new'
lib/gitlab/middleware/go.rb:16:in `call'
Digging Deeper Found Migration Error
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
== 20160226114608 AddTrigramIndexesForSearching: migrating ====================
-- execute("SELECT true AS enabled FROM pg_available_extensions WHERE name = 'pg_trgm' AND installed_version IS NOT NULL;")
-> 0.0039s
STDERR:
---- End output of "bash" "/tmp/chef-script20160323-15158-e5b67m" ----
Ran "bash" "/tmp/chef-script20160323-15158-e5b67m" returned 1
Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/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: notifies :run, "execute[clear the #{params[:name]} cache]", :immediately unless OmnibusHelper.not_listening?("redis")
30: params[:restarts].each do |svc|
31: notifies :restart, svc, :immediately
32: end
33: end
34: end
Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/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, :restarts=>[], :name=>"gitlab-rails"}
action [:nothing]
retries 0
retry_delay 2
default_guard_interpreter :default
command "migrate gitlab-rails database"
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"
declared_type :bash
cookbook_name "gitlab"
recipe_name "database_migrations"
end
Digging even deeper I see the database gitlab user now requires superuser access
ActiveRecord::StatementInvalid: PG::InsufficientPrivilege: ERROR: permission denied to create extension "pg_trgm"
HINT: Must be superuser to create this extension.
: CREATE EXTENSION IF NOT EXISTS "pg_trgm"