Docker release candidate image fails to configure
Summary
When using the gitlab/gitlab-ce:rc image, the container fails to start with the error Couldn't find an alternative telinit implementation to spawn.
Steps to reproduce
I've been able to consistently reproduce this in a kubernetes environment by simply trying to bring up a container with that image. I am also able to reproduce this on a local docker only environment just by bringing up the image, however on retry it works. The current gitlab/gitlab-ce:latest image CAN run init q and thus does not fail.
Docker version: 1.11.0
Kubernetes version: v1.2.4
Expected behavior
I would expect no errors and the container to configure itself.
Relevant logs
[2016-06-14T18:45:10+00:00] INFO: execute[echo 'CS:123456:respawn:/opt/gitlab/embedded/bin/runsvdir-start' >> /etc/inittab] ran successfully
[2016-06-14T18:45:10+00:00] INFO: execute[echo 'CS:123456:respawn:/opt/gitlab/embedded/bin/runsvdir-start' >> /etc/inittab] sending run action to execute[init q] (immediate)
[2016-06-14T18:45:10+00:00] INFO: Running queued delayed notifications before re-raising exception
[2016-06-14T18:45:10+00:00] ERROR: Running exception handlers
[2016-06-14T18:45:10+00:00] ERROR: Exception handlers complete
[2016-06-14T18:45:10+00:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out
[2016-06-14T18:45:10+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-06-14T18:45:10+00:00] ERROR: execute[init q] (runit::sysvinit line 28) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of init q ----
STDOUT:
STDERR: Couldn't find an alternative telinit implementation to spawn.
---- End output of init q ----
Ran init q returned 1
[2016-06-14T18:45:12+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Stacktrace
Generated at 2016-06-14 18:45:32 +0000
Mixlib::ShellOut::ShellCommandFailed: execute[init q] (runit::sysvinit line 28) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of init q ----
STDOUT:
STDERR: Couldn't find an alternative telinit implementation to spawn.
---- End output of init q ----
Ran init q returned 1
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.6/lib/mixlib/shellout.rb:289:in `invalid!'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.2.6/lib/mixlib/shellout.rb:276:in `error!'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/mixin/shell_out.rb:56:in `shell_out!'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/provider/execute.rb:62:in `block in action_run'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/mixin/why_run.rb:52:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/provider.rb:175:in `converge_by'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/provider/execute.rb:60:in `action_run'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/provider.rb:144:in `run_action'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource.rb:596:in `run_action'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:74:in `run_action'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:82:in `block in run_action'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:80:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:80:in `run_action'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:106:in `block (2 levels) in converge'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:106:in `each'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:106:in `block in converge'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/resource_list.rb:83:in `block in execute_each_resource'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/resource_collection/resource_list.rb:81:in `execute_each_resource'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/runner.rb:105:in `converge'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:658:in `block in converge'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:653:in `catch'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:653:in `converge'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:692:in `converge_and_save'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/client.rb:271:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:261:in `block in fork_chef_client'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:249:in `fork'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:249:in `fork_chef_client'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:215:in `block in run_chef_client'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/local_mode.rb:44:in `with_server_connectivity'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:203:in `run_chef_client'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/client.rb:413:in `block in interval_run_chef_client'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/client.rb:403:in `loop'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/client.rb:403:in `interval_run_chef_client'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application/client.rb:393:in `run_application'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/lib/chef/application.rb:58:in `run'
/opt/gitlab/embedded/lib/ruby/gems/2.1.0/gems/chef-12.6.0/bin/chef-client:26:in `<top (required)>'
/opt/gitlab/embedded/bin/chef-client:23:in `load'
/opt/gitlab/embedded/bin/chef-client:23:in `<main>'
docker log output
================================================================================
Error executing action `run` on resource 'execute[init q]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of init q ----
STDOUT:
STDERR: Couldn't find an alternative telinit implementation to spawn.
---- End output of init q ----
Ran init q returned 1
Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/runit/recipes/sysvinit.rb
28: execute "init q" do
29: action :nothing
30: end
Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/runit/recipes/sysvinit.rb:28:in `from_file'
execute("init q") do
action [:nothing]
retries 0
retry_delay 2
default_guard_interpreter :execute
command "init q"
backup 5
returns 0
declared_type :execute
cookbook_name "runit"
recipe_name "sysvinit"
end
Output of checks
Results of GitLab Application Check
As I cannot get the release candidate to run at all, this is the output from the gitlab-ce:latest image that I am trying to update.
Checking GitLab Shell ...
GitLab Shell version >= 2.7.2 ? ... OK (2.7.2)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
hooks directories in repos are links: ...
3/1 ... ok
2/12 ... ok
5/13 ... ok
2/14 ... ok
4/15 ... ok
2/16 ... ok
8/18 ... ok
8/19 ... ok
8/20 ... ok
4/21 ... repository is empty
5/22 ... ok
2/23 ... ok
5/24 ... ok
4/25 ... ok
8/26 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Results of GitLab Environment Info
As above, this is from the gitlab-ce:latest image that I am attempting to update to the release candidate.
System information
System: Ubuntu 14.04
Current User: git
Using RVM: no
Ruby Version: 2.1.8p440
Gem Version: 2.5.1
Bundler Version:1.10.6
Rake Version: 10.5.0
Sidekiq Version:4.1.2
GitLab information
Version: 8.8.4
Revision: d4c3f17
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://gitlab.darkdna.net
HTTP Clone URL: https://gitlab.darkdna.net/some-group/some-project.git
SSH Clone URL: ssh://git@gitlab.darkdna.net:29419/some-group/some-project.git
Using LDAP: yes
Using Omniauth: no
GitLab Shell
Version: 2.7.2
Repositories: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git
Possible fixes
I believe this to be related to the way kubernetes handles containers. Every time a container fails to launch, a brand new container will be created on retry. With vanilla docker, the same container will be used each time and thus will have whatever data was stored during the first failed run.