URI::InvalidURIError: bad URI(is not URI?): {"url"=>"unix:/var/opt/gitlab/redis/redis.socket"}
I'm building a custom package based off https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5554 and the recent builds fail to reconfigure. I see errors of migrations and something related to Redis. I've been updating it multiple times a day by downloading the new package and using dpkg
.
Locally it works, so I suspect there is a deeper issue and not related to migrations. Could it be due to upgrading chef? c930fbd4
gitlab.rb
contains only these lines:
external_url 'http://issueboard.gitlap.com'
gitlab_rails['omniauth_enabled'] = true
gitlab_rails['omniauth_allow_single_sign_on'] = ['gitlab']
gitlab_rails['omniauth_block_auto_created_users'] = false
gitlab_rails['omniauth_providers'] = [
{
"name" => "gitlab",
"app_id" => "id",
"app_secret" => "secret",
"args" => { "scope" => "api" }
}
]
Compare the packages (notice their difference in names, probably due to chef upgrade):
The error I get is:
* bash[migrate gitlab-rails database] action run
[execute] rake aborted!
URI::InvalidURIError: bad URI(is not URI?): {"url"=>"unix:/var/opt/gitlab/redis/redis.socket"}
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/redis-store-1.1.7/lib/redis/store/factory.rb:65:in `extract_host_options_from_uri'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/redis.rb:31:in `redis_store_options'
/opt/gitlab/embedded/service/gitlab-rails/config/application.rb:112:in `<class:Application>'
/opt/gitlab/embedded/service/gitlab-rails/config/application.rb:8:in `<module:Gitlab>'
/opt/gitlab/embedded/service/gitlab-rails/config/application.rb:7:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/Rakefile:5:in `require'
/opt/gitlab/embedded/service/gitlab-rails/Rakefile:5:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:22:in `load'
/opt/gitlab/embedded/bin/bundle:22:in `<main>'
(See full trace by running task with --trace)
D, [2016-08-11T09:47:11.546939 #28910] DEBUG -- : ** [Raven] Event not sent due to excluded environment: production
================================================================================
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-script20160811-28585-aioyi8" ----
STDOUT: rake aborted!
URI::InvalidURIError: bad URI(is not URI?): {"url"=>"unix:/var/opt/gitlab/redis/redis.socket"}
/opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/redis-store-1.1.7/lib/redis/store/factory.rb:65:in `extract_host_options_from_uri'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/redis.rb:31:in `redis_store_options'
/opt/gitlab/embedded/service/gitlab-rails/config/application.rb:112:in `<class:Application>'
/opt/gitlab/embedded/service/gitlab-rails/config/application.rb:8:in `<module:Gitlab>'
/opt/gitlab/embedded/service/gitlab-rails/config/application.rb:7:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/Rakefile:5:in `require'
/opt/gitlab/embedded/service/gitlab-rails/Rakefile:5:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:22:in `load'
/opt/gitlab/embedded/bin/bundle:22:in `<main>'
(See full trace by running task with --trace)
D, [2016-08-11T09:47:11.546939 #28910] DEBUG -- : ** [Raven] Event not sent due to excluded environment: production
STDERR:
---- End output of "bash" "/tmp/chef-script20160811-28585-aioyi8" ----
Ran "bash" "/tmp/chef-script20160811-28585-aioyi8" returned 1
Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb
44: bash "migrate gitlab-rails database" do
45: code <<-EOH
46: set -e
47: log_file="/tmp/gitlab-rails-db-migrate-$(date +%s)-$$/output.log"
48: umask 077
49: mkdir $(dirname ${log_file})
50: /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}
51: STATUS=${PIPESTATUS[0]}
52: echo $STATUS > #{db_migrate_status_file}
53: exit $STATUS
54: EOH
55: environment ({'GITLAB_ROOT_PASSWORD' => initial_root_password }) if initial_root_password
56: notifies :run, 'execute[enable pg_trgm extension]', :before unless OmnibusHelper.not_listening?("postgresql") || !node['gitlab']['postgresql']['enable']
57: notifies :run, "execute[clear the gitlab-rails cache]", :immediately unless OmnibusHelper.not_listening?("redis")
58: dependent_services.each do |svc|
59: notifies :restart, svc, :immediately
60: end
61: not_if "(test -f #{db_migrate_status_file}) && (cat #{db_migrate_status_file} | grep -Fx 0)"
62: only_if { node['gitlab']['gitlab-rails']['auto_migrate'] }
63: end
Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb:44:in `from_file'
bash("migrate gitlab-rails database") do
action [:run]
updated true
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 gitlab:db:configure 2>& 1 | tee $
{log_file}\n STATUS=${PIPESTATUS[0]}\n echo $STATUS > /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-5f5c353\n exit $STATUS\n"
interpreter "bash"
declared_type :bash
cookbook_name "gitlab"
recipe_name "database_migrations"
not_if "(test -f /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-5f5c353) && (cat /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a163
5803-5f5c353 | grep -Fx 0)"
only_if { #code block }
end
Platform:
---------
x86_64-linux
cc @marin