Ask Your Question
0

Issues with ubuntu docker image and puppetlabs-mysql

asked 2014-06-25 08:43:02 -0500

Luke gravatar image

Hi,

I am using the latest version of the docker ubuntu14.04 image and am trying to get the puppetlabs-mysql working with it. Currently using 0.6.1 of mysql module. ( I know it is old however it has to stick around for now due to some unrelated issues). I have confirmed that my manifests work fine on another non-docker ubuntu14.04 image. I am having a hard time making out what the error means:

--debug --trace

Error: /Stage[main]/Mysql::Server/Service[mysqld]: Could not evaluate: undefined method `[]' for nil:NilClass
/usr/lib/ruby/vendor_ruby/puppet/provider/service/upstart.rb:75:in `upstart_version'
/usr/lib/ruby/vendor_ruby/puppet/provider/service/upstart.rb:170:in `version_is_pre_0_6_7'
/usr/lib/ruby/vendor_ruby/puppet/provider/service/upstart.rb:104:in `enabled?'
/usr/lib/ruby/vendor_ruby/puppet/type/service.rb:64:in `retrieve'
/usr/lib/ruby/vendor_ruby/puppet/type.rb:1045:in `block in retrieve'
/usr/lib/ruby/vendor_ruby/puppet/type.rb:1040:in `each'
/usr/lib/ruby/vendor_ruby/puppet/type.rb:1040:in `retrieve'
/usr/lib/ruby/vendor_ruby/puppet/type.rb:1063:in `retrieve_resource'
/usr/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:223:in `from_resource'
/usr/lib/ruby/vendor_ruby/puppet/transaction/resource_harness.rb:19:in `evaluate'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:174:in `apply'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:187:in `eval_resource'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:117:in `call'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:117:in `block (2 levels) in evaluate'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:327:in `block in thinmark'
/usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:326:in `thinmark'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:117:in `block in evaluate'
/usr/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:118:in `traverse'
/usr/lib/ruby/vendor_ruby/puppet/transaction.rb:108:in `evaluate'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:167:in `block in apply'
/usr/lib/ruby/vendor_ruby/puppet/util/log.rb:149:in `with_destination'
/usr/lib/ruby/vendor_ruby/puppet/transaction/report.rb:112:in `as_logging_destination'
/usr/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:166:in `apply'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:117:in `block in apply_catalog'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:161:in `block in benchmark'
/usr/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
/usr/lib/ruby/vendor_ruby/puppet/util.rb:160:in `benchmark'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:116:in `apply_catalog'
/usr/lib/ruby/vendor_ruby/puppet/configurer.rb:191:in `run'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:47:in `block (4 levels) in run'
/usr/lib/ruby/vendor_ruby/puppet/agent/locker.rb:20:in `lock'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:47:in `block (3 levels) in run'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:117:in `with_client'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:44:in `block (2 levels) in run'
/usr/lib/ruby/vendor_ruby/puppet/agent.rb:82:in `run_in_fork'
/usr/lib/ruby ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2014-06-25 09:12:45 -0500

Luke gravatar image

The problem appears to be this.

/usr/lib/ruby/vendorruby/puppet/provider/service/upstart.rb:75:in `upstartversion'

on a regular ubuntu 14.04 box it returns

initctl (upstart 1.12.1) Copyright (C) 2006-2014 Canonical Ltd., 2011 Scott James Remnant

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

On the docker ubuntu box it returns

true (GNU coreutils) 8.21 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

It doesn't even mention upstart which is causing it to fail.

fix would be not to use the official ubuntu image instead use ubuntu-upstart which has the proper upstart stuff

edit flag offensive delete link more

Comments

@Luke. Did you actually use the ubuntu-upstart image and get rid of the error. I just tried and still not it so am wondering if I'm missing something?

vang gravatar imagevang ( 2014-09-08 11:16:34 -0500 )edit
1

answered 2015-01-20 12:11:17 -0500

robert.vargason gravatar image

updated 2015-01-21 05:17:40 -0500

I get the same error with the phusion/baseimage:0.9.15 ( https://github.com/phusion/baseimage-... ).

If you know what you are doing you can use the following trick to proceed beyond this error. Execute in the docker container:

mv /sbin/initctl /sbin/oldinitctl
echo -e '#!/bin/bash\nif [ $1 == "--version" ]\nthen\n  echo "initctl (upstart 1.12.1)"\nfi\n/sbin/oldinitctl "$@"' > /sbin/initctl
chmod 755 /sbin/initctl

which wraps initctl --version with an echo "initctl (upstart 1.12.1)":

#!/bin/bash
if [ $1 == "--version" ]
then
  echo "initctl (upstart 1.12.1)"
fi
/sbin/oldinitctl "$@"

before:

# /sbin/initctl --version
true (GNU coreutils) 8.21
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jim Meyering.

after:

# /sbin/initctl --version
initctl (upstart 1.12.1)
true (GNU coreutils) 8.21
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jim Meyering.

have fun!

PS: to have the mysql module working be sure to have /usr/sbin/policy-rc.d return zero. so that mysqld can be started by the module. execute in the docker container:

echo -e '#!/bin/sh\nexit 0' > /usr/sbin/policy-rc.d
edit flag offensive delete link more

Comments

Thanks for sharing!

Luke gravatar imageLuke ( 2015-01-21 12:06:56 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2014-06-25 08:43:02 -0500

Seen: 1,045 times

Last updated: Jan 21 '15