RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1303803 - rabbitmq resource-agents wipes too much data on recovery and kills additional users configuration
Summary: rabbitmq resource-agents wipes too much data on recovery and kills additional...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: resource-agents
Version: 7.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: pre-dev-freeze
: ---
Assignee: Peter Lemenkov
QA Contact: Leonid Natapov
URL: https://github.com/lemenkov/resource-...
Whiteboard:
: 1297859 (view as bug list)
Depends On:
Blocks: 1316633
TreeView+ depends on / blocked
 
Reported: 2016-02-02 02:46 UTC by Chris Lincoln
Modified: 2023-09-14 03:17 UTC (History)
17 users (show)

Fixed In Version: resource-agents-3.9.5-65.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1316633 (view as bug list)
Environment:
Last Closed: 2016-11-04 00:01:28 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Initial patch (1.56 KB, patch)
2016-03-01 10:47 UTC, Peter Lemenkov
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2374351 0 None None None 2016-10-14 08:37:48 UTC
Red Hat Product Errata RHBA-2016:2174 0 normal SHIPPED_LIVE resource-agents bug fix and enhancement update 2016-11-03 13:16:36 UTC

Description Chris Lincoln 2016-02-02 02:46:18 UTC
Description of problem:
Ability to create RabbitMQ users that sustain across resource restarts. Justification is for monitoring capabilities that don't use the RabbitMQ admin user, and not using the guest account with its randomized password (i.e., create a specific monitor user with a specific password).

Comment 2 John Eckersberg 2016-02-10 18:17:41 UTC
This should be a pretty simple fix if I understand what the problem
is.  What happens currently in the resource agent is roughly:

- Start node

- If it's the only one up so far, then do nothing and wait for other
  nodes.  If at least one other node is already up, join cluster with
  the other node.

- If the cluster join fails, then blow away mnesia (literally rm -rf
  /var/lib/rabbitmq/mnesia/*) and try again.  Unfortunately mnesia is
  also where the user config is stored, so this is where the users get
  lost.

So, we just need to be less heavy-handed when attempting to right the
cluster.  Some combination of the rabbitmqctl commands
forget_cluster_node [--offline] / update_cluster_nodes / force_boot
should let us patch things up without completely removing mnesia and
all of the users with it.

Comment 3 Peter Lemenkov 2016-02-23 14:59:43 UTC
Indeed we shouldn't remove so much data while restarting.

Comment 4 Peter Lemenkov 2016-02-24 16:36:57 UTC
Ok, we almost there. Thanks to the recently built resource-agents-3.9.5-54.el7_2.7.x86_64 it's much easy to fix the cluster now. No need to wipe out Mnesia entirely.

I'm going to propose a fix soon.

Comment 5 Peter Lemenkov 2016-02-29 11:19:34 UTC
Hello All!
I've got a patch which fixes that. I'm going to test it a little and provide a test build in a 4-6 hours.

This patch restores only "users" (rabbit_user) table. Other tables will be purged.

Comment 8 Peter Lemenkov 2016-03-01 10:47:42 UTC
Created attachment 1131859 [details]
Initial patch

A proposed solution

Comment 17 Leonid Natapov 2016-03-16 13:22:50 UTC
resource-agents-3.9.5-67.el7

tested according comment #7. User still exist after resource restart.

Comment 18 Peter Lemenkov 2016-04-11 09:03:50 UTC
*** Bug 1297859 has been marked as a duplicate of this bug. ***

Comment 19 adrianlzt 2016-05-10 15:38:33 UTC
We use to add a monitoring user like:

rabbitmqctl add_user nagios PASSWORD
rabbitmqctl set_user_tags nagios monitoring
rabbitmqctl set_permissions nagios ".*" ".*" ".*"

Every time RabbitMQ is restarted, permissions are lost for this user.

PR to backup also this perms:
https://github.com/lemenkov/resource-agents/pull/1

Comment 20 Peter Lemenkov 2016-05-18 12:59:42 UTC
(In reply to adrianlzt from comment #19)
> We use to add a monitoring user like:
> 
> rabbitmqctl add_user nagios PASSWORD
> rabbitmqctl set_user_tags nagios monitoring
> rabbitmqctl set_permissions nagios ".*" ".*" ".*"
> 
> Every time RabbitMQ is restarted, permissions are lost for this user.
> 
> PR to backup also this perms:
> https://github.com/lemenkov/resource-agents/pull/1

Thanks for the addition! I'll merge it shortly.

Comment 22 xiaoxwan 2016-08-31 09:21:57 UTC
(In reply to Peter Lemenkov from comment #20)
> (In reply to adrianlzt from comment #19)
> > We use to add a monitoring user like:
> > 
> > rabbitmqctl add_user nagios PASSWORD
> > rabbitmqctl set_user_tags nagios monitoring
> > rabbitmqctl set_permissions nagios ".*" ".*" ".*"
> > 
> > Every time RabbitMQ is restarted, permissions are lost for this user.
> > 
> > PR to backup also this perms:
> > https://github.com/lemenkov/resource-agents/pull/1
> 
> Thanks for the addition! I'll merge it shortly.

I didn't saw the code about userperm in: 
https://github.com/ClusterLabs/resource-agents/master . 
Did we solved this problem there?

Comment 23 Peter Lemenkov 2016-08-31 15:44:29 UTC
(In reply to xiaoxwan from comment #22)
 
> I didn't saw the code about userperm in: 
> https://github.com/ClusterLabs/resource-agents/master . 
> Did we solved this problem there?

No not yet.

Comment 26 errata-xmlrpc 2016-11-04 00:01:28 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.

https://rhn.redhat.com/errata/RHBA-2016-2174.html

Comment 27 Red Hat Bugzilla 2023-09-14 03:17:08 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


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