Non quoted var in RabbitMQ OCF script leads to script failure

Bug #1527518 reported by Dmitry Mescheryakov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Invalid
Medium
Dmitry Mescheryakov
6.1.x
Won't Fix
Medium
Rodion Tikunov
7.0.x
Fix Released
Medium
Rodion Tikunov
8.0.x
Invalid
Medium
Dmitry Mescheryakov

Bug Description

On the 7.0 release the following error was observed in pacemaker logs:

Dec 16 22:49:09 [9351] node-1 pacemaker_remoted: notice: operation_finished: p_rabbitmq-server_notify_0:24211:stderr [ /usr/lib/ocf/resource.d/fuel/rabbitmq-server: line 1485: [: node-1: binary operator expected ]

here line 1485 corresponds to line 1530 in the current version of the script:
https://github.com/openstack/fuel-library/blob/ba38e4116c23a4b76c826221872d8bd614ea455b/files/fuel-ha-utils/ocf/rabbitmq#L1530

The issue happens when OCF_RESKEY_CRM_meta_notify_stop_uname contains name of more than one node. Which is a valid input according to Pacemaker docs, see Example 10.6 in
http://clusterlabs.org/doc/en-US/Pacemaker/1.1/html-single/Pacemaker_Explained/#_clone_resource_agent_requirements

There is no impact from that error at the moment: the if statement is just skipped and by chance that is the desired behaviour when several hosts are stopped. Report from user also indicates that the error does not cause any issue with RabbitMQ. Still, the importance is set to medium because the error might become dangerous after some change later.

Revision history for this message
Dmitry Mescheryakov (dmitrymex) wrote :

The issue is already fixed in 8.0, we just need to port the fix to 7.0

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (stable/7.0)

Fix proposed to branch: stable/7.0
Review: https://review.openstack.org/259363

Maciej Relewicz (rlu)
tags: added: area-mos
Revision history for this message
Dmitry Mescheryakov (dmitrymex) wrote :

Lowering importance to medium because there is no user impact for now.

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (stable/6.1)

Fix proposed to branch: stable/6.1
Review: https://review.openstack.org/273474

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-library (stable/6.1)

Change abandoned by Rodion Tikunov (<email address hidden>) on branch: stable/6.1
Review: https://review.openstack.org/273474
Reason: Will do for this cherry-pick a new commit

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-library (stable/6.1)

Fix proposed to branch: stable/6.1
Review: https://review.openstack.org/275189

tags: added: area-library rabbitmq
removed: area-mos
Revision history for this message
Rodion Tikunov (rtikunov) wrote :

Won't Fix for 6.1-updates because of Medium importance

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-library (stable/6.1)

Change abandoned by Fuel DevOps Robot (<email address hidden>) on branch: stable/6.1
Review: https://review.openstack.org/275189
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-library (stable/7.0)

Reviewed: https://review.openstack.org/259363
Committed: https://git.openstack.org/cgit/openstack/fuel-library/commit/?id=97d36d0bea8f22ab5029a2ddff0f5a49d0d28d23
Submitter: Jenkins
Branch: stable/7.0

commit 97d36d0bea8f22ab5029a2ddff0f5a49d0d28d23
Author: Dmitry Mescheryakov <email address hidden>
Date: Fri Dec 18 13:09:23 2015 +0300

    Quote vars when checking them on emptiness

    Not doing so leads to bash errors when string contains spaces.
    Specifically, variable OCF_RESKEY_CRM_meta_notify_stop_uname can
    contain spaces when several nodes are stopped simultaneously and
    that leads to error described in the bug referenced below.

    Regarding other variables quoted in this change "...promote_uname",
    "...master_uname" and "...demote_uname" - in our case they never
    should be empty, since we can have only one master. But better safe
    than sorry.

    Change-Id: I1447f58e897cc1fe6b9884c3b4cd4f950dd9cecb
    Closes-Bug: #1527518

tags: added: on-verification
Revision history for this message
TatyanaGladysheva (tgladysheva) wrote :

Verified on MOS 7.0 + MU4 updates.

Steps to verify:
1. Deploy 3 controllers+2 computes env
2. Open pacemaker log on every controller:
tail -f /var/log/pacemaker.log | grep p_rabbitmq-server_notify_0
3. Kill rabbitmq process (ps axuf | grep rabbitmq) one by one on different controllers and see output in logs from step 2. Repeat several times.

Actual result:
No errors like the following had been found in pacemaker logs after applying MU4 patch:
Jun 02 08:10:13 [18513] node-1.test.domain.local pacemaker_remoted: notice: operation_finished: p_rabbitmq-server_notify_0:25472:stderr [ /usr/lib/ocf/resource.d/fuel/rabbitmq-server: line 1543: [: node-3.test.domain.local: binary operator expected ]

tags: removed: on-verification
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.