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 1261536 - ipa migrate-ds fails to migrate managed entries.
Summary: ipa migrate-ds fails to migrate managed entries.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: ipa
Version: 7.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: IPA Maintainers
QA Contact: Namita Soman
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-09 14:55 UTC by German Parente
Modified: 2019-08-15 05:22 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-17 11:58:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description German Parente 2015-09-09 14:55:22 UTC
Description of problem:

ipa migrate-ds is migrating users entries and also copying the attribute  mepmanagedentry. But the DN corresponding to this attribute is not migrated.

This makes that a delete of a user (by ldaptools) could fail. The internal operation done by "Managed Entries" plugin will fail.

In any case, db is inconsistent without the managed entry.


Version-Release number of selected component (if applicable): 
ipa-server-4.1.0-18.el7_1.3.x86_64


How reproducible: always.

Steps to Reproduce:


1. Add user in one ipa server:

[root@ipaserver ~]# ipa user-add nevermanaged
First name: Never
Last name: Managed
-------------------------
Added user "nevermanaged"
-------------------------
  User login: nevermanaged
...


2. Check the entry and the managed one are there:

[root@ipaserver ~]# ipa user-show nevermanaged --all --raw
  dn: uid=nevermanaged,cn=users,cn=accounts,dc=redhat,dc=com
  mepmanagedentry: cn=nevermanaged,cn=groups,cn=accounts,dc=redhat,dc=com

[root@ipaserver ~]# ldapsearch -xLLL -D "cn=directory manager" -w secret12 -b "cn=nevermanaged,cn=groups,cn=accounts,dc=redhat,dc=com" dn
dn: cn=nevermanaged,cn=groups,cn=accounts,dc=redhat,dc=com

3. ipa migrate-ds in another ipa server:

ipa migrate-ds ldap://10.13.211.213:389 --bind-dn="uid=admin,cn=users,cn=accounts,dc=redhat,dc=com" --user-container="cn=users,cn=accounts,dc=redhat,dc=com" --with-compat --group-container="cn=groups,cn=accounts,dc=redhat,dc=com"

migrate-ds:
-----------
Migrated:
  user: nevermanaged
Failed user:
  admin: This entry already exists

4. Check user and managed entry:

[root@idm-replica ~]# ipa user-show nevermanaged --all --raw
  dn: uid=nevermanaged,cn=users,cn=accounts,dc=example,dc=org
  ....
  mepManagedEntry: cn=nevermanaged,cn=groups,cn=accounts,dc=example,dc=org


  ldapsearch -xLLL -D "cn=directory manager" -w 'RedHat1!' -b "cn=nevermanaged,cn=groups,cn=accounts,dc=redhat,dc=com" dn
No such object (32)
[root@idm-replica ~]# 

5. user cannot be deleted anymore:

ipa user-del nevermanaged
ipa: ERROR: nevermanaged: user not found

6. 
[root@idm-replica ~]# ldapmodify -D "cn=directory manager" -w 'RedHat1!'
dn: uid=nevermanaged,cn=users,cn=accounts,dc=example,dc=org
changetype: modify
replace: mepManagedEntry 

7.  ipa user-del
User login: nevermanaged
---------------------------
Deleted user "nevermanaged"
---------------------------
[root@idm-replica ~]# 



Actual results:

the managed entry is not migrated and the user cannot be deleted any more.

Expected results:

the managed entry should be there.


Additional info:


The workaround is to delete attribute:

mepManagedEntry

Comment 2 German Parente 2015-09-09 15:56:45 UTC
A real workaround, more acceptable for customers has just been given by Rob (thanks a lot):

if they want to re-migrate, would be to blacklist that attribute and objectclass with --user-ignore-attribute=mepManagedEntry --user-ignore-objectclass=mepOriginEntry

Comment 3 Petr Vobornik 2015-09-09 15:57:57 UTC
ipa migrate-ds was not designed to migrate UPGs automatically. Actually it was not designed for IPA-IPA migration, but can be used.

The reason why the groups were not migrated is that ipa migrate-ds migrates groups with object classes: "groupOfUniqueNames, groupOfNames but UPGs have "ipaobject, mepManagedEntry, posixgroup, top" and therefore they were not migrated.

Another possibility is to ignore(not migrate) the mepManagedEntry attribute during migration - add it to --user-ignore-attribute options.

Comment 4 Petr Vobornik 2015-09-10 15:08:03 UTC
IPA-IPA migration is described at http://www.freeipa.org/page/Howto/Migration#Migrating_from_other_FreeIPA_to_FreeIPA

Comment 5 Martin Kosek 2015-09-17 11:58:33 UTC
The customer case was closed, closing the Bugzilla too. Long-term fix would a separate command for IPA-IPA migration tracked in

https://fedorahosted.org/freeipa/ticket/3656


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