Project

General

Profile

Bug #28514

Ldap refresh failed with "Validation failed: Adding would cause a cycle!"

Added by Hao Yu 9 months ago. Updated 8 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Authentication
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

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.

Foreman::CyclicGraphException
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'
<snip>

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.

group1
group2
group3
group4

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.

Associated revisions

Revision 2c36df3c (diff)
Added by Hao Yu 8 months ago

Fixes #28514 - Skip cycle validation for user type membership

History

#1 Updated by Tomer Brisker 9 months ago

  • Priority changed from Immediate to Normal
  • Category set to Authentication

#2 Updated by The Foreman Bot 8 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/7347 added

#3 Updated by The Foreman Bot 8 months ago

  • Fixed in Releases 2.0.0 added

#4 Updated by Hao Yu 8 months ago

  • Status changed from Ready For Testing to Closed

#5 Updated by Tomer Brisker 8 months ago

  • Assignee set to Hao Yu
  • Fixed in Releases 1.24.2 added

Also available in: Atom PDF