Bug 903719 - configuration management for Cinder fails
Summary: configuration management for Cinder fails
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-packstack
Version: 2.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: snapshot2
: 2.1
Assignee: Derek Higgins
QA Contact: Nir Magnezi
URL:
Whiteboard:
Depends On:
Blocks: 887804 903545
TreeView+ depends on / blocked
 
Reported: 2013-01-24 16:20 UTC by Eric Harney
Modified: 2016-04-26 22:08 UTC (History)
5 users (show)

Fixed In Version: openstack-packstack-2012.2.2-0.6.dev345.el6ost
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-14 18:25:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
packstack answer file (1.24 KB, text/plain)
2013-01-24 16:20 UTC, Eric Harney
no flags Details
screen output (19.68 KB, text/plain)
2013-01-24 19:55 UTC, Eric Harney
no flags Details
packstack log file (17.35 KB, text/plain)
2013-01-24 19:56 UTC, Eric Harney
no flags Details


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 20471 0 None None None Never
Red Hat Product Errata RHBA-2013:0260 0 normal SHIPPED_LIVE Red Hat OpenStack 2.0 (Folsom) Preview bug fix and enhancement update 2013-02-14 23:21:02 UTC

Description Eric Harney 2013-01-24 16:20:40 UTC
Created attachment 686849 [details]
packstack answer file

Description of problem:
I am trying to use packstack with updated Cinder packages, containing changes from bug 887804.  Packstack fails with the following errors using those packages:

http://pastebin.test.redhat.com/124287  (screen)
http://pastebin.test.redhat.com/124288  (log file) 

I ran the following test:
1. With no cinder packages installed, run packstack, with yum configured to point at a repo containing the updated cinder packages.  This fails.
2. Run packstack again with the same answer file.  This fails the same way.
3. Add asdf=asdf to the [DEFAULT] section of /etc/cinder/cinder.conf.  Run packstack with again with the same answer file -- This succeeds.

I think this indicates a problem in packstack/puppet -- it appears that it only fails if no values are present in [DEFAULT].

Version-Release number of selected component (if applicable):
openstack-packstack-2012.2.2-0.5.dev318.el6ost.noarch
openstack-cinder-2012.2.1-6.el6.noarch.rpm
openstack-cinder-doc-2012.2.1-6.el6.noarch.rpm
python-cinder-2012.2.1-6.el6.noarch.rpm

How reproducible:
Repeatedly once problem occurs

Additional info:

Comment 3 Alan Pevec 2013-01-24 19:41:34 UTC
It's not 100% reproducible, running following in a loop:

  rm -f /var/lib/puppet/state/*yaml
  cp cinder.conf.sample /etc/cinder/cinder.conf
  puppet apply --modulepath=/usr/lib/python2.6/site-packages/packstack/puppet/modules cinder-test.pp 

fails ~70% of the time, tried both in VM and on real HW.

Comment 4 Alan Pevec 2013-01-24 19:53:17 UTC
To define, failure is when puppet apply returns err like this:
err: /Stage[main]/Cinder::Base/Cinder_config[DEFAULT/sql_connection]/ensure: change from absent to present failed: Could not set 'present on ensure: no implicit conversion from nil to integer at /usr/lib/python2.6/site-packages/packstack/puppet/modules/cinder/manifests/base.pp:54

like in Eric's log.
BTW, Eric pastebin you used is internal please attach logfile here.

Comment 5 Eric Harney 2013-01-24 19:55:36 UTC
Created attachment 686940 [details]
screen output

Comment 6 Eric Harney 2013-01-24 19:56:43 UTC
Created attachment 686941 [details]
packstack log file

Comment 7 Alan Pevec 2013-01-24 20:13:18 UTC
The above loop never failed (~130 iterations) with empty cinder.conf
i.e. replacing cp cinder.conf.sample /etc/cinder/cinder.conf
with cat /dev/null > /etc/cinder/cinder.conf

Comment 8 Alan Pevec 2013-01-24 20:25:08 UTC
Getting closer, loop fails ~10% with 
printf "[DEFAULT]\n#sql_connection=somedef\n" > /etc/cinder/cinder.conf
i.e. initial cinder.conf with one actual parameter commented out:
[DEFAULT]
#sql_connection=somedef

Hopefully this can be a hint to someone who understands internals of puppetlabs-inifile ?

Comment 9 Derek Higgins 2013-01-25 03:06:01 UTC
Looks like a problem in the inifile puppet module, it has a default indentation level of nil, which doesn't seem to be getting changed to an int if a value being set has a commented out version and no uncommented version. This seems to fix it. But I got no idea if it breaks something else ...

diff --git a/lib/puppet/util/ini_file.rb b/lib/puppet/util/ini_file.rb
index 90b0c7b..b654d8c 100644
--- a/lib/puppet/util/ini_file.rb
+++ b/lib/puppet/util/ini_file.rb
@@ -175,7 +175,7 @@ module Util
     def read_section(name, start_line, line_iter)
       settings = {}
       end_line_num = nil
-      min_indentation = nil
+      min_indentation = 0
       while true
         line, line_num = line_iter.peek
         if (line_num.nil? or match = SECTION_REGEX.match(line))

Comment 10 Alan Pevec 2013-01-25 13:25:59 UTC
(In reply to comment #9)
> This seems to fix it.

Verified, loop in comment 3 never fails with that fix (~100 iterations)

Comment 11 Derek Higgins 2013-01-25 13:31:08 UTC
Potential fix posted upstream

https://review.openstack.org/#/c/20471/

Comment 13 Nir Magnezi 2013-02-14 13:42:37 UTC
Verified NVR openstack-packstack-2012.2.2-0.8.dev346.el6ost.noarch

cinder version: 
python-cinderclient-0.2.26-1.el6.noarch
python-cinder-2012.2.1-7.el6ost.noarch
openstack-cinder-2012.2.1-7.el6ost.noarch

Marking as verified since cinder works with no errors.

Verified the fix:
=================
1. Modified /usr/lib/python2.6/site-packages/packstack/puppet/modules/inifile/lib/puppet/util/ini_file.rb
   modified the param: min_indentation from 0 to nil

2. ran packstack with an answers file and got the following error: http://pastebin.test.redhat.com/127843

Comment 15 errata-xmlrpc 2013-02-14 18:25:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0260.html


Note You need to log in before you can comment on or make changes to this bug.