Created attachment 1773735 [details] example.ldif Description of problem: The "dsconf backend import" command returns "The import task has finished successfully" even if some entries could not be added (for example, because of a missing parent entry). Version-Release number of selected component (if applicable): 389-ds-base-1.4.3.13-1.module+el8dsrv+8334+69a46a2e.x86_64 How reproducible: Always Steps to Reproduce: 1. Try to import the attached LDIF file: # dsconf -D "cn=Directory Manager" ldap://server.example.com backend import userroot /var/lib/dirsrv/slapd-instance_name/ldif/example.ldif Actual results: The command shows: "The import task has finished successfully" Expected results: The command should show an error that the import was incomplete. The error log correctly shows that an entry was skipped. However, admin will not check the log for errors if the command returns that the import was successful. Additional info: * BZ#1627645 does not solve this problem. I also tried the import on Fedora 34 with the nightly build from corp repo (389-ds-base-2.0.3-20210407gitf1f7ff126.fc34.x86_64) and the import also incorrectly reports that it was successful.
Created attachment 1773736 [details] errors log
I tried to import the same file over and over and every time I get a different message: [root@server-f33 ds]# dsconf standalone1 backend import userRoot /var/lib/dirsrv/slapd-standalone1/ldif/syntax_err2.ldif The import task has finished successfully [root@server-f33 ds]# dsconf standalone1 backend import userRoot /var/lib/dirsrv/slapd-standalone1/ldif/syntax_err2.ldif The import task has finished successfully [root@server-f33 ds]# dsconf standalone1 backend import userRoot /var/lib/dirsrv/slapd-standalone1/ldif/syntax_err2.ldif The import task has finished successfully, with warning code 8, check the logs for more detail [root@server-f33 ds]# dsconf standalone1 backend import userRoot /var/lib/dirsrv/slapd-standalone1/ldif/syntax_err2.ldif The import task has finished successfully, with warning code 8, check the logs for more detail [root@server-f33 ds]# dsconf standalone1 backend import userRoot /var/lib/dirsrv/slapd-standalone1/ldif/syntax_err2.ldif The import task has finished successfully After adding this snippet from import_producer https://github.com/389ds/389-ds-base/pull/4476/files#diff-5e506a7236cddc035908095afb6a8a7b9a40a5062c0b4c3860352915ff915bc0 to import_foreman it seems to be always produce a warning.
This is a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1627645 Viktor, that diff shows the old change. Did you "remove" it from the producer into the foreman, or just copy it to the foreman?
(In reply to mreynolds from comment #3) > This is a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1627645 I don't think it's a duplicate, but rather a missed corner case. > > Viktor, that diff shows the old change. Did you "remove" it from the > producer into the foreman, or just copy it to the foreman? This is the diff, but I'm not sure if this is the right fix. But at least I'm getting a consistent warning when there are skipped entries. diff --git a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import_threads.c b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import_threads.c index b02b17f49..d0dd4a69f 100644 --- a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import_threads.c +++ b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import_threads.c @@ -2767,6 +2767,11 @@ import_foreman(void *param) if (job->flags & FLAG_ABORT) { goto error; } + /* capture skipped entry warnings for this task */ + if((job) && (job->skipped)) { + slapi_task_set_warning(job->task, WARN_SKIPPED_IMPORT_ENTRY); + } + } slapi_pblock_destroy(pb);
Hi Viktor, Your fix is 100% correct. The initial commit that addressed an ldif import with skipped entries and no warning message focused on attribute syntax and schema violation, not a missing parent entry. The import_producer thread parses the import files, checking for schema and syntax violations, while the import_foreman thread catches a missing parent entry. I will commit your change and cherry pick it to the required branches. Thanks
Build tested: 389-ds-base-1.4.3.26-1.module+el8dsrv+12420+cb9f0071.x86_64 # dsconf -D "cn=Directory Manager" ldap://localhost:389 backend import userroot /var/lib/dirsrv/slapd-localhost/ldif/example.ldif Enter password for cn=Directory Manager on ldap://localhost:389: The import task has finished successfully, with warning code 8, check the logs for more detail A warning is displayed, marking as VERIFIED.
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 (Low: redhat-ds:11 security, bug fix, and enhancement update), 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://access.redhat.com/errata/RHSA-2021:3955