Bug 1783882 - Ldap refresh failed with "Validation failed: Adding would cause a cycle!"
Summary: Ldap refresh failed with "Validation failed: Adding would cause a cycle!"
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Authentication
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
medium vote
Target Milestone: 6.8.0
Assignee: satellite6-bugs
QA Contact: Akhil Jha
Depends On:
TreeView+ depends on / blocked
Reported: 2019-12-16 07:42 UTC by Hao Chang Yu
Modified: 2020-10-27 12:59 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1851138 (view as bug list)
Last Closed: 2020-10-27 12:59:35 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 28514 0 Normal Closed Ldap refresh failed with "Validation failed: Adding would cause a cycle!" 2021-01-29 14:00:53 UTC
Github theforeman foreman pull 7347 0 None closed Fixes #28514 - Skip cycle validation for user type membership 2021-01-29 14:00:53 UTC
Red Hat Product Errata RHSA-2020:4366 0 None None None 2020-10-27 12:59:51 UTC

Description Hao Chang Yu 2019-12-16 07:42:30 UTC
Description of problem:
Ldap refresh may fail with the following error when trying to add a user to a usergroups and the id of the user is conflicting with the a nested usergroup id.

Validation failed: Adding would cause a cycle!
/usr/share/foreman/lib/core_extensions.rb:97:in `detect_cycle'
/usr/share/foreman/lib/core_extensions.rb:84:in `ensure'
/usr/share/foreman/app/models/usergroup_member.rb:44:in `ensure_no_cycle'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:426:in `block in make_lambda'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:198:in `block (2 levels) in halting'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:606:in `block (2 levels) in default_terminator'
/opt/theforeman/tfm-ror52/root/usr/share/gems/gems/activesupport-5.2.1/lib/active_support/callbacks.rb:605:in `catch'

Due to this error, user can't login to the Satellite using his/her Ldap account because Satellite will attempt to sync the users and groups after authenticating the user.

How reproducible:
The issue can be reproduced with just the internal authentication. The following steps assume that you have a freshly installed Satellite 6.6.

Steps to Reproduce:
1. In the web ui -> Administer -> User Groups. Create 4 user groups. We expecting the id of the groups are 1,2,3 and 4.


2. Make the Id of the default "Admin User" is 4.
3. In this case, id of the "Admin User" and group4 are conflict.
4. Add group1 as sub-group for group3.
5. Add group3 as sub-group for group4.
6. Add the default "Admin user" to group3 and submit.

Actual results:
Adding would cause a cycle!

Expected results:
Should be able to add the user to group3.

Comment 7 Bryan Kearney 2020-01-14 15:01:39 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28514 has been resolved.

Comment 10 Akhil Jha 2020-06-21 16:29:03 UTC

Version Tested:  Satellite-6.8.0 Snap 5.0

Steps followed:
1. Login web UI-> Administer -> User Groups
2. Create 4 user groups(IDs: 1,2,3,4). Also ID of Admin User is 4.
3.1 Add group1 as sub-group for group3.
3.2 Add group3 as sub-group for group4.
3.3 Add the default "Admin user" to group3 and submit.


Admin user was added to group3.

Comment 13 errata-xmlrpc 2020-10-27 12:59:35 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 (Important: Satellite 6.8 release), 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.