Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing an LDIF from locations other than the LDIF directory fails #4280

Open
389-ds-bot opened this issue Sep 13, 2020 · 9 comments
Open
Labels
closed: duplicate Migration flag - Issue

Comments

@389-ds-bot
Copy link

Cloned from Pagure issue: https://pagure.io/389-ds-base/issue/51227

  • Created at 2020-08-03 11:32:48 by mmuehlfeldrh
  • Closed at 2020-08-06 17:49:11 as duplicate
  • Assigned to nobody

Issue Description

If you try to import an LDIF from a directory other than /var/lib/dirsrv/slapd-instance_name/ldif/, the import fails with "No such file or directory".

Package Version and Platform

389-ds-base-1.4.3.10-1.module+el8dsrv+7006+9b1e3ef3.x86_64

Steps to reproduce

  1. Create an LDIF file, for example, /tmp/example.ldif
  2. Make sure that dirsrv is able to read the file (chown dirsrv /tmp/example.ldif ; chmod 644 /tmp/example.ldif)
  3. Try to import the file.

Actual results

dsconf -D "cn=Directory Manager" ldap://server.example.com backend import userRoot  /tmp/example.ldif 
Enter password for cn=Directory Manager on ldap://server.example.com: 
Error: Import task failed
-------------------------
Beginning import job...
Index buffering enabled with bucket size 17
Could not open LDIF file "/tmp/example.ldif", errno 2 (No such file or directory)
Thread monitoring returned: -23

Aborting all Import threads...
Import threads aborted.
Closing files...
Import failed.

Expected results

Import should succeed.

Additional information

The same works on RHEL 8.2 (389-ds-base-1.4.2.12-2.module+el8dsrv+6428+6e54c518.x86_64).

@389-ds-bot 389-ds-bot added the closed: duplicate Migration flag - Issue label Sep 13, 2020
@389-ds-bot
Copy link
Author

389-ds-bot commented Sep 13, 2020

Comment from mreynolds (@mreynolds389) at 2020-08-06 17:49:12

Duplicate of #4049

@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2020-08-06 17:49:15

Metadata Update from @mreynolds389:

  • Custom field origin adjusted to None
  • Custom field reviewstatus adjusted to None
  • Issue close_status updated to: duplicate
  • Issue status updated to: Closed (was: Open)

@alanorth
Copy link

Can confirm this is still an issue with 389-ds-base-2.0.15-1.module_el8+14185+adb3f555.x86_64 on CentOS Stream 8. If I move my LDIF file to /var/lib/dirsrv/slapd-instance_name/ldif/ then it imports successfully.

@mreynolds389
Copy link
Contributor

Can confirm this is still an issue with 389-ds-base-2.0.15-1.module_el8+14185+adb3f555.x86_64 on CentOS Stream 8. If I move my LDIF file to /var/lib/dirsrv/slapd-instance_name/ldif/ then it imports successfully.

This is still how it works. This was by design because of issues with FS permissions, selinux, and other OS related restrictions that always seem to get in the way of LDIF imports. We will probably still look into changing some of this to be more flexible, but unfortunately it's not a priority at the moment.

@Firstyear
Copy link
Contributor

@mreynolds389 It could be worth documenting examples where the ldif is moved to that location first in all the guides to at least show that. Perhaps even a warning if it's outside of ldif_dir that it may fail and to try that?

@mreynolds389
Copy link
Contributor

@mreynolds389 It could be worth documenting examples where the ldif is moved to that location first in all the guides to at least show that. Perhaps even a warning if it's outside of ldif_dir that it may fail and to try that?

Pretty sure the admin guide explains that the export/import is always set to the server's ldif dir, but I'll confirm tomorrow...

@alanorth
Copy link

OK I got it now. Makes sense! The Red Hat Directory Server 11 migration docs explicitly tell you to import your LDIF from /tmp:

# dsconf -D 'cn=Directory Manager' ldap://server.example.com backend import userRoot /tmp/migration.ldif

And the dsconf man page mentions importing LDIFs with no caveat that the path must be relative to the instance directory. The only reason I figured out this mysterious "No such file or directory" error was because of this GitHub issue!

@Firstyear
Copy link
Contributor

@mreynolds389 If the rh docs are saying to use /tmp, that's a bug, and this needs to be fixed IMO.

@Firstyear Firstyear reopened this Apr 28, 2022
@sgouvern
Copy link
Contributor

sgouvern commented May 3, 2022

Bug 2081352 opened against RH docs.
I think dsconf man pages should warn it too, and the error message issued by dsconf should warn that it may be related to ldif file not being in the server's ldif dir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: duplicate Migration flag - Issue
Projects
None yet
Development

No branches or pull requests

5 participants