gitlab-ctl reconfigure reconfigure fails after removing the logs files
On gitlab-ce 7.11.4-omnibus try this:
gitlab-ctl stop
rm -rf /var/log/gitlab/*
gitlab-ctl reconfigure
You will endup with a broken configuraiton because gitlab-ctl is not able to run properly.
If seems that the reconfigure does the right job for most components but not for ci-redis and gitlab-ci
Recipe: gitlab::ci-redis
* ruby_block[reload ci-redis svlogd configuration] action create
================================================================================
Error executing action `create` on resource 'ruby_block[reload ci-redis svlogd configuration]'
================================================================================
Errno::ENOENT
-------------
No such file or directory @ rb_sysopen - /opt/gitlab/sv/ci-redis/log/supervise/control
Cookbook Trace:
---------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/runit/definitions/runit_service.rb:91:in `initialize'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/runit/definitions/runit_service.rb:91:in `open'
/opt/gitlab/embedded/cookbooks/cache/cookbooks/runit/definitions/runit_service.rb:91:in `block (3 levels) in from_file'
Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/runit/definitions/runit_service.rb
89: ruby_block "reload #{params[:name]} svlogd configuration" do
90: block do
91: File.open(File.join(sv_dir_name, "log/supervise/control"), "w") do |control|
92: control.print "h"
93: end
94: end
95: action :nothing
96: end
97:
Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/runit/definitions/runit_service.rb:89:in `block in from_file'
ruby_block("reload ci-redis svlogd configuration") do
params {:directory=>"/opt/gitlab/sv", :only_if=>false, :finish_script=>false, :control=>[], :run_restart=>true, :active_directory=>"/opt/gitlab/service", :init_script_template=>nil, :owner=>"root", :group=>"root", :template_name=>"redis", :start_command=>"start", :stop_command=>"stop", :restart_command=>"restart", :status_command=>"status", :options=>{:service=>"ci-redis", :log_directory=>"/var/log/gitlab/ci-redis", :directory=>nil, :only_if=>false, :finish_script=>false, :control=>[], :run_restart=>true, :active_directory=>nil, :init_script_template=>nil, :owner=>"root", :group=>"root", :template_name=>"redis", :start_command=>"start", :stop_command=>"stop", :restart_command=>"restart", :status_command=>"status", :options=>{}, :log_options=>{}, :env=>{}, :action=>:enable, :down=>false}, :log_options=>{"svlogd_size"=>209715200, "svlogd_num"=>30, "svlogd_timeout"=>86400, "svlogd_filter"=>"gzip", "svlogd_udp"=>nil, "svlogd_prefix"=>nil, "udp_log_shipping_host"=>nil, "udp_log_shippi
ng_port"=>514, "logrotate_frequency"=>"daily", "logrotate_size"=>nil, "logrotate_rotate"=>30, "logrotate_compress"=>"compress", "logrotate_method"=>"copytruncate", "logrotate_postrotate"=>nil, "enable
"=>true, "ha"=>false, "dir"=>"/var/opt/gitlab/ci-redis", "log_directory"=>"/var/log/gitlab/ci-redis", "username"=>"gitlab-redis", "uid"=>nil, "gid"=>nil, "shell"=>"/bin/nologin", "home"=>"/var/opt/git
lab/redis", "bind"=>"127.0.0.1", "port"=>0, "unixsocket"=>"/var/opt/gitlab/ci-redis/redis.socket", "unixsocketperm"=>"777"}, :env=>{}, :action=>:enable, :down=>false, :name=>"ci-redis"}
action [:nothing]
retries 0
retry_delay 2
guard_interpreter :default
block_name "reload ci-redis svlogd configuration"
cookbook_name "gitlab"
recipe_name "ci-redis"
block #<Proc:0x000000041974a0@/opt/gitlab/embedded/cookbooks/cache/cookbooks/runit/definitions/runit_service.rb:90>
end
Recipe: gitlab::postgresql
* ruby_block[reload postgresql svlogd configuration] action create
- execute the ruby block reload postgresql svlogd configuration
Recipe: gitlab::unicorn
* ruby_block[reload unicorn svlogd configuration] action create
- execute the ruby block reload unicorn svlogd configuration
Recipe: gitlab::ci-unicorn
* ruby_block[reload ci-unicorn svlogd configuration] action create
- execute the ruby block reload ci-unicorn svlogd configuration
Recipe: gitlab::sidekiq
* ruby_block[reload sidekiq svlogd configuration] action create
- execute the ruby block reload sidekiq svlogd configuration
Recipe: gitlab::ci-sidekiq
* ruby_block[reload ci-sidekiq svlogd configuration] action create
- execute the ruby block reload ci-sidekiq svlogd configuration
Recipe: gitlab::nginx
* ruby_block[reload nginx svlogd configuration] action create
- execute the ruby block reload nginx svlogd configuration
Recipe: gitlab::logrotate
* ruby_block[reload logrotate svlogd configuration] action create
- execute the ruby block reload logrotate svlogd configuration
Running handlers:
[2015-05-29T21:08:55+01:00] ERROR: Running exception handlers
Running handlers complete
[2015-05-29T21:08:55+01:00] ERROR: Exception handlers complete
[2015-05-29T21:08:55+01:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out
Chef Client failed. 31 resources updated in 5.637841108 seconds
[2015-05-29T21:08:55+01:00] ERROR: ruby_block[reload ci-redis svlogd configuration] (gitlab::ci-redis line 89) had an error: Errno::ENOENT: No such file or directory @ rb_sysopen - /opt/gitlab/sv/ci-redis/log/supervise/control
[2015-05-29T21:08:55+01:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)