Bug 709994 - multiple_occurrences in /etc/qpidd.conf file while installing rhua config rpm
Summary: multiple_occurrences in /etc/qpidd.conf file while installing rhua config rpm
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 2.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Jay Dobies
QA Contact: wes hayutin
URL:
Whiteboard:
Depends On:
Blocks: rhui-20
TreeView+ depends on / blocked
 
Reported: 2011-06-02 08:16 UTC by Sachin Ghai
Modified: 2012-05-31 12:56 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-31 12:56:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sachin Ghai 2011-06-02 08:16:41 UTC
Description of problem:
Upgraded the pulp/RHUI setup from

pulp 0.181 to pulp 0.185
rhui-tools 2.0.25 to 2.0.26

I generated all config rpm after updating the new answer file (cause new naswer file has ca_cert entry ). Since I was uusing the existing setup, i removed all previously generated config rpms using "rpm -e <rpm_name>".

When I installed new config rpm, I got following:
[root@dhcp193-79 ~]# rpm -ivh rh-rhua-config-2.0-2.el6.noarch.rpm 
Preparing...                ########################################### [100%]
   1:rh-rhua-config         ########################################### [100%]
Updating RHUA Server Configuration
Updating RHUA Repository Authentication Configuration
Updating Apache SSL Configuration
data model in use matches the current version
database migration to version 14 complete
Stopping httpd: [FAILED]
Stopping Qpid AMQP daemon: [  OK  ]
Stopping mongod: [  OK  ]
Starting mongod: [  OK  ]
Starting Qpid AMQP daemon: 2011-06-02 12:58:18 critical Unexpected error: Error in configuration file /etc/qpidd.conf: multiple_occurrences
Use --help to see valid options

[FAILED]
warning: %post(rh-rhua-config-2.0-2.el6.noarch) scriptlet failed, exit status 1
[root@dhcp193-79 ~]# 


This is because qpidd.conf file was already updated with certs. And when I installed new rhua config rpm, this rpm has appended one more entry of ssl certs.

This should be a clean process.

Version-Release number of selected component (if applicable):
pulp 0.185
rhui-tools 2.0.26

How reproducible:
always

Steps to Reproduce:
1. Generated new config rpms using rhui-installer
2. Remove the existing config rpm from rhua node
3. Install newly generated config rpm
  
Actual results:
Starting Qpid AMQP daemon: 2011-06-02 12:58:18 critical Unexpected error: Error in configuration file /etc/qpidd.conf: multiple_occurrences
Use --help to see valid options


Expected results:
should be a clean process; Instead of appending qpidd.conf, it should be overwrite with new ssl certs entries. 

Additional info:

Comment 1 Jay Dobies 2011-06-02 12:22:08 UTC
Good pickup. The qpid configuration is different than pulp's in that it appends to the conf file instead of using sed, which means it's not upgrade safe. I'll take a look.

Comment 2 Jay Dobies 2011-06-02 13:30:42 UTC
commit d17be92861244f30c320e5dbe8b18ef5ce37a1e5
Author: Jay Dobies <jason.dobies>
Date:   Thu Jun 2 09:24:46 2011 -0400

    709994 - Need to clean up from a previous RHUA config RPM so we don't
    get duplicate entries on an upgrade.

rhui-2.0/tools/etc/rhui/templates/rh-rhua-config.spec


One thing to note, this will _not_ work with existing installs from RHUI Tools 2.0.26 or earlier. Here's why:

In order to be able to easily clean up the entries we add, I added a comment to the end of each of them to flag them for a simple sed script. That comment won't be present in configuration generated from 2.0.26 and earlier, so the cleanup won't work.

You can simulate it by manually adding those comments to your current qpidd.conf file. Then when you upgrade to the version of RHUI Tools that this fix is included in, it will perform the cleanup.

Below is a sample of qpidd.conf with the comments in place:

# SSL - Added by RHUI Installer
require-encryption=yes # RHUI
ssl-require-client-authentication=yes # RHUI
ssl-cert-db=/etc/pki/rhua/qpid-nss # RHUI
ssl-cert-password-file=/etc/pki/rhua/qpid-nss/password # RHUI
ssl-cert-name=broker # RHUI
ssl-port=5674 # RHUI

Note the "# RHUI" comment at the end of each line. The RHUA config RPM now runs:

sed -i -e "s/.*RHUI.*//g" /etc/qpidd.conf

Before appending the configuration to qpidd.conf. That way, if those lines are present, they are removed first. If they aren't, nothing happens.

Comment 3 wes hayutin 2011-06-06 21:15:26 UTC
added to rhui-20 tracker

Comment 4 Kedar Bidarkar 2011-06-29 12:29:36 UTC
Upgrade is now a clean process. it overwrites instead of appending


Examining rh-rhua-config-2.0-2.el6.noarch.rpm: rh-rhua-config-2.0-2.el6.noarch
rh-rhua-config-2.0-2.el6.noarch.rpm: does not update installed package.
error: not an rpm package
Cannot open: rh-rhua-config-2.2. Skipping.
Examining rh-rhua-config-2.2-2.el6.noarch.rpm: rh-rhua-config-2.2-2.el6.noarch
Marking rh-rhua-config-2.2-2.el6.noarch.rpm as an update to rh-rhua-config-2.0-2.el6.noarch
Resolving Dependencies
--> Running transaction check
---> Package rh-rhua-config.noarch 0:2.2-2.el6 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================
 Package                                  Arch                             Version                              Repository                                                  Size
=================================================================================================================================================================================
Updating:
 rh-rhua-config                           noarch                           2.2-2.el6                            /rh-rhua-config-2.2-2.el6.noarch                           111 k

Transaction Summary
=================================================================================================================================================================================
Install       0 Package(s)
Upgrade       1 Package(s)

Total size: 111 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating       : rh-rhua-config-2.2-2.el6.noarch                                                                                                                           1/2 
Updating RHUA Server Configuration
Updating RHUA Repository Authentication Configuration
Updating Apache SSL Configuration
data model in use matches the current version
database migration to version 19 complete
Stopping httpd: [  OK  ]
Stopping Qpid AMQP daemon: [  OK  ]
Stopping mongod: [  OK  ]
Starting mongod: [  OK  ]
Starting Qpid AMQP daemon: [  OK  ]
Starting httpd: [  OK  ]
  Cleanup        : rh-rhua-config-2.0-2.el6.noarch                                                                                                                           2/2 
Consumer Id could not be found. Cannot update consumer profile.

Updated:
  rh-rhua-config.noarch 0:2.2-2.el6                                                                                                                                              

Complete!

Comment 5 wes hayutin 2011-08-01 21:40:10 UTC
moving to release pending

Comment 6 wes hayutin 2012-05-31 12:56:00 UTC
closing out, product released


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