Bug 903719 - configuration management for Cinder fails
configuration management for Cinder fails
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-packstack (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: snapshot2
: 2.1
Assigned To: Derek Higgins
Nir Magnezi
: Triaged
Depends On:
Blocks: 887804 903545
  Show dependency treegraph
Reported: 2013-01-24 11:20 EST by Eric Harney
Modified: 2016-04-26 18:08 EDT (History)
5 users (show)

See Also:
Fixed In Version: openstack-packstack-2012.2.2-0.6.dev345.el6ost
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-02-14 13:25:16 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

External Trackers
Tracker ID Priority Status Summary Last Updated
OpenStack gerrit 20471 None None None Never

  None (edit)
Description Eric Harney 2013-01-24 11:20:40 EST
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):

How reproducible:
Repeatedly once problem occurs

Additional info:
Comment 3 Alan Pevec 2013-01-24 14:41:34 EST
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 14:53:17 EST
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 14:55:36 EST
Created attachment 686940 [details]
screen output
Comment 6 Eric Harney 2013-01-24 14:56:43 EST
Created attachment 686941 [details]
packstack log file
Comment 7 Alan Pevec 2013-01-24 15:13:18 EST
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 15:25:08 EST
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:

Hopefully this can be a hint to someone who understands internals of puppetlabs-inifile ?
Comment 9 Derek Higgins 2013-01-24 22:06:01 EST
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 08:25:59 EST
(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 08:31:08 EST
Potential fix posted upstream

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

cinder version: 

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 13:25:16 EST
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.


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