Bug 918700
| Summary: | [RFE] Allow db2ldif to be quiet | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Nathan Kinder <nkinder> |
| Component: | 389-ds-base | Assignee: | Rich Megginson <rmeggins> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Sankar Ramalingam <sramling> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.0 | CC: | amsharma, jgalipea, nhosoi |
| Target Milestone: | rc | Keywords: | FutureFeature |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | 389-ds-base-1.3.1.2-1.el7 | Doc Type: | Enhancement |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-06-13 11:23:59 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Nathan Kinder
2013-03-06 18:14:44 UTC
moving all ON_QA bugs to MODIFIED in order to add them to the errata (can't add bugs in the ON_QA state to an errata). When the errata is created, the bugs should be automatically moved back to ON_QA. Test Case 1 (db2ldif):: ======================= without -q ----------- [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/test.ldif Exported ldif file: /export/test.ldif ldiffile: /export/test.ldif [08/Jan/2014:17:54:15 +051800] - export userRoot: Processed 9 entries (100%). [08/Jan/2014:17:54:15 +051800] - All database threads now stopped with -q expected pass ------------------------ [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/test.ldif -q Exported ldif file: /export/test.ldif [root@dhcp201-149 ~]# vim /export/test.ldif with -q expected to fail ------------------------- [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/test1.ldif -q Exported ldif file: /export/test1.ldif Error LOGS>>>>>>>> [root@dhcp201-149 ~]# vim /export/test1.ldif [root@dhcp201-149 ~]# tail -f /var/log/dirsrv/slapd-dhcp201-149/errors [08/Jan/2014:17:53:35 +051800] - db2ldif: can't open /export/a.ldif: 13 (Permission denied) [08/Jan/2014:17:53:35 +051800] - All database threads now stopped [08/Jan/2014:17:54:05 +051800] - db2ldif: can't open /export/a.ldif: 13 (Permission denied) [08/Jan/2014:17:54:05 +051800] - All database threads now stopped [08/Jan/2014:17:54:15 +051800] - export userRoot: Processed 9 entries (100%). [08/Jan/2014:17:54:15 +051800] - All database threads now stopped [08/Jan/2014:17:54:25 +051800] - export userRoot: Processed 9 entries (100%). [08/Jan/2014:17:54:25 +051800] - All database threads now stopped [08/Jan/2014:17:54:44 +051800] - db2ldif: can't open /export/test1.ldif: 13 (Permission denied) [08/Jan/2014:17:54:44 +051800] - All database threads now stopped Test Case 2 (ldif2db):: ========================= Without q ----------- [root@dhcp201-149 ~]# ldif2db -Z slapd-dhcp201-149 -n userRoot -i /export/test.ldif importing data ... [08/Jan/2014:18:03:03 +051800] - WARNING: Import is running with nsslapd-db-private-import-mem on; No other process is allowed to access the database [08/Jan/2014:18:03:03 +051800] - check_and_set_import_cache: pagesize: 4096, pages: 479602, procpages: 53205 [08/Jan/2014:18:03:03 +051800] - Import allocates 767360KB import cache. [08/Jan/2014:18:03:03 +051800] - import userRoot: Beginning import job... [08/Jan/2014:18:03:03 +051800] - import userRoot: Index buffering enabled with bucket size 100 [08/Jan/2014:18:03:04 +051800] - import userRoot: Processing file "/export/test.ldif" [08/Jan/2014:18:03:04 +051800] - import userRoot: Finished scanning file "/export/test.ldif" (9 entries) [08/Jan/2014:18:03:04 +051800] - import userRoot: Workers finished; cleaning up... [08/Jan/2014:18:03:04 +051800] - import userRoot: Workers cleaned up. [08/Jan/2014:18:03:04 +051800] - import userRoot: Cleaning up producer thread... [08/Jan/2014:18:03:04 +051800] - import userRoot: Indexing complete. Post-processing... [08/Jan/2014:18:03:04 +051800] - import userRoot: Generating numSubordinates complete. [08/Jan/2014:18:03:04 +051800] - import userRoot: Flushing caches... [08/Jan/2014:18:03:04 +051800] - import userRoot: Closing files... [08/Jan/2014:18:03:04 +051800] - All database threads now stopped [08/Jan/2014:18:03:04 +051800] - import userRoot: Import complete. Processed 9 entries in 1 seconds. (9.00 entries/sec) With q expected pass ---------------------- [root@dhcp201-149 ~]# ldif2db -Z slapd-dhcp201-149 -n userRoot -i /export/test.ldif -q [root@dhcp201-149 ~]# vim /export/test.ldif with q expected to give warning ---------------------------------- [root@dhcp201-149 ~]# ldif2db -Z slapd-dhcp201-149 -n userRoot -i /export/test.ldif -q [08/Jan/2014:18:10:35 +051800] - Unable to import the database because it is being used by another slapd process. [08/Jan/2014:18:10:35 +051800] - Shutting down due to possible conflicts with other slapd processes with q expected to fail and give error message ----------------------------------------------- [root@dhcp201-149 ~]# ldif2db -Z slapd-dhcp201-149 -n userRoot -i /export/test12323.ldif -q /var/lib/dirsrv/slapd-dhcp201-149/db/userRoot: No such file or directory Test Case 3 (bak2db) :: ======================== Expected to fail with q and without -q ------------------------------------------ [root@dhcp201-149 ~]# bak2db archivedir /var/lib/dirsrv/slapd-dhcp201-149/bak/ -n userRoot -Z dhcp201-149 [08/Jan/2014:18:19:00 +051800] - Warning: Unable to read dbversion file in /root/archivedir [08/Jan/2014:18:19:00 +051800] - Restore: backup directory /root/archivedir does not exist. [08/Jan/2014:18:19:00 +051800] - archive2db: Failed to read backup file set. Either the directory specified doesn't exist, or it exists but doesn't contain a valid backup set, or file permissions prevent the server reading the backup set. error=53 (Invalid request descriptor) [root@dhcp201-149 ~]# bak2db archivedir /var/lib/dirsrv/slapd-dhcp201-149/bak/ -n userRoot -Z dhcp201-149 -q [08/Jan/2014:18:19:30 +051800] - Warning: Unable to read dbversion file in /root/archivedir [08/Jan/2014:18:19:30 +051800] - Restore: backup directory /root/archivedir does not exist. [08/Jan/2014:18:19:30 +051800] - archive2db: Failed to read backup file set. Either the directory specified doesn't exist, or it exists but doesn't contain a valid backup set, or file permissions prevent the server reading the backup set. error=53 (Invalid request descriptor) Expected to Pass with q and without q --------------------------------------- [root@dhcp201-149 ~]# bak2db /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32 -n userRoot -Z dhcp201-149 -q [root@dhcp201-149 ~]# bak2db /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32 -n userRoot -Z dhcp201-149 [08/Jan/2014:18:20:55 +051800] - All database threads now stopped [08/Jan/2014:18:20:55 +051800] - Moving file /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/userRoot [08/Jan/2014:18:20:55 +051800] - Moving file /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/userRoot/DBVERSION [08/Jan/2014:18:20:55 +051800] - Copying /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/userRoot/DBVERSION to /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/userRoot/DBVERSION [08/Jan/2014:18:20:55 +051800] - Moving file /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/userRoot/id2entry.db [08/Jan/2014:18:20:55 +051800] - Copying /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/userRoot/id2entry.db to /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/userRoot/id2entry.db [08/Jan/2014:18:20:55 +051800] - Moving file /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/userRoot/entryrdn.db [08/Jan/2014:18:20:55 +051800] - Copying /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/userRoot/entryrdn.db to /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/userRoot/entryrdn.db [08/Jan/2014:18:20:55 +051800] - Moving file /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/log.0000000001 [08/Jan/2014:18:20:55 +051800] - Copying /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/log.0000000001 to /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/log.0000000001 [08/Jan/2014:18:20:55 +051800] - Moving file /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/DBVERSION [08/Jan/2014:18:20:55 +051800] - Copying /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/DBVERSION to /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/DBVERSION [08/Jan/2014:18:20:55 +051800] - Moving file /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/dse_instance.ldif [08/Jan/2014:18:20:55 +051800] - Copying /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/dse_instance.ldif to /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/dse_instance.ldif [08/Jan/2014:18:20:55 +051800] - Moving file /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/dse_index.ldif [08/Jan/2014:18:20:55 +051800] - Copying /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/dse_index.ldif to /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/dse_index.ldif [08/Jan/2014:18:20:55 +051800] - Removing file /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/log.0000000001 from staging area [08/Jan/2014:18:20:55 +051800] - Removing file /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/DBVERSION from staging area [08/Jan/2014:18:20:55 +051800] - Restoring file 1 (/var/lib/dirsrv/slapd-dhcp201-149/db/userRoot/DBVERSION) [08/Jan/2014:18:20:55 +051800] - Copying /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak/userRoot/DBVERSION to /var/lib/dirsrv/slapd-dhcp201-149/db/userRoot/DBVERSION [08/Jan/2014:18:20:55 +051800] - Restoring file 2 (/var/lib/dirsrv/slapd-dhcp201-149/db/userRoot/id2entry.db) [08/Jan/2014:18:20:55 +051800] - Restoring file 3 (/var/lib/dirsrv/slapd-dhcp201-149/db/userRoot/entryrdn.db) [08/Jan/2014:18:20:55 +051800] - All database threads now stopped [08/Jan/2014:18:20:55 +051800] - Restore: Removing staging area /var/lib/dirsrv/slapd-dhcp201-149/db/../fribak. Test Case 4 (db2bak) ====================== [root@dhcp201-149 ~]# db2bak -q Back up directory: /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_21 [root@dhcp201-149 ~]# db2bak Back up directory: /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32 [08/Jan/2014:18:17:32 +051800] - Backing up file 1 (/var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/userRoot/DBVERSION) [08/Jan/2014:18:17:32 +051800] - Copying /var/lib/dirsrv/slapd-dhcp201-149/db/userRoot/DBVERSION to /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/userRoot/DBVERSION [08/Jan/2014:18:17:32 +051800] - Backing up file 2 (/var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/userRoot/id2entry.db) [08/Jan/2014:18:17:32 +051800] - Copying /var/lib/dirsrv/slapd-dhcp201-149/db/userRoot/id2entry.db to /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/userRoot/id2entry.db [08/Jan/2014:18:17:32 +051800] - Backing up file 3 (/var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/userRoot/entryrdn.db) [08/Jan/2014:18:17:32 +051800] - Copying /var/lib/dirsrv/slapd-dhcp201-149/db/userRoot/entryrdn.db to /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/userRoot/entryrdn.db [08/Jan/2014:18:17:32 +051800] - Backing up file 4 (/var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/log.0000000001) [08/Jan/2014:18:17:32 +051800] - Copying /var/lib/dirsrv/slapd-dhcp201-149/db/log.0000000001 to /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/log.0000000001 [08/Jan/2014:18:17:32 +051800] - Backing up file 5 (/var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/DBVERSION) [08/Jan/2014:18:17:32 +051800] - Copying /var/lib/dirsrv/slapd-dhcp201-149/db/DBVERSION to /var/lib/dirsrv/slapd-dhcp201-149/bak/dhcp201-149-2014_01_08_18_17_32/DBVERSION [08/Jan/2014:18:17:32 +051800] - All database threads now stopped QUESTION ------------- Only Test Case which is not working as expected is :: db2ldif with -q expected to fail, it gives an illusion like its passing, though logs the error in error logs :: [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/test1.ldif -q Exported ldif file: /export/test1.ldif So, is it OK or should I file another bug for it? > Only Test Case which is not working as expected is :: db2ldif with -q expected > to fail, it gives an illusion like its passing, though logs the error in error > logs :: > [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a > /export/test1.ldif -q > Exported ldif file: /export/test1.ldif > > So, is it OK or should I file another bug for it? Amita, could you give me some more explanation why the first one (exporting to /export/test.ldif) is supposed to pass and the next one (exporting to /export/tests1.ldif) is not? > with -q expected pass > ------------------------ > [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/test.ldif -q > Exported ldif file: /export/test.ldif > [root@dhcp201-149 ~]# vim /export/test.ldif > > with -q expected to fail > ------------------------- > [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/test1.ldif -q > Exported ldif file: /export/test1.ldif I assume you prepared a file /export/test1.ldif with no write permission or something? If so, as you pointed out, the error is logged in the error log, and 2) you could check the exit status just after the command line execution, which should show non zero. > [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/test1.ldif -q > Exported ldif file: /tmp/test1.ldif # echo $? 255 I'd think this is good enough for the DS administrators. (In reply to Noriko Hosoi from comment #4) > > Only Test Case which is not working as expected is :: db2ldif with -q expected > > to fail, it gives an illusion like its passing, though logs the error in error > > logs :: > > [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a > > /export/test1.ldif -q > > Exported ldif file: /export/test1.ldif > > > > So, is it OK or should I file another bug for it? > > Amita, could you give me some more explanation why the first one (exporting > to /export/test.ldif) is supposed to pass and the next one (exporting to > /export/tests1.ldif) is not? The file itself does not exists - /export/tests1.ldif, that's why it should give an error. > > > with -q expected pass > > ------------------------ > > [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/test.ldif -q > > Exported ldif file: /export/test.ldif > > [root@dhcp201-149 ~]# vim /export/test.ldif > > > > with -q expected to fail > > ------------------------- > > [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/test1.ldif -q > > Exported ldif file: /export/test1.ldif > > I assume you prepared a file /export/test1.ldif with no write permission or > something? If so, as you pointed out, the error is logged in the error log, > and 2) you could check the exit status just after the command line > execution, which should show non zero. > > > [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/test1.ldif -q > > Exported ldif file: /tmp/test1.ldif > # echo $? > 255 > > I'd think this is good enough for the DS administrators. Ok, but as in all other test cases execution gives error/warning on screen with -q, it should also behave in similar way? But if that's good enough to log in error logs, I will mark the bug as VERIFIED. Thanks Noriko :) > Amita, could you give me some more explanation why the first one (exporting > to /export/test.ldif) is supposed to pass and the next one (exporting to > /export/tests1.ldif) is not? The file itself does not exists - /export/tests1.ldif, that's why it should give an error. <== I'm still confused... This is db2ldif (export). The path specified with -a is a file to be generated and written by the utility. That's said, the file /export/tests1.ldif is not expected to exist? Am I missing something? > I'd think this is good enough for the DS administrators. Ok, but as in all other test cases execution gives error/warning on screen with -q, it should also behave in similar way? But if that's good enough to log in error logs, I will mark the bug as VERIFIED. <== Thank you, Amita! Yeah, I'd agree with you that it'd be nicer to show the error in the utility's output. But what'd happen would be the admin opens the output file /export/tests1.ldif and finds it empty, then s/he'll go to see the error log and/or try to run it without -q and find the cause of the problem. (In reply to Noriko Hosoi from comment #6) > > Amita, could you give me some more explanation why the first one (exporting > > to /export/test.ldif) is supposed to pass and the next one (exporting to > > /export/tests1.ldif) is not? > The file itself does not exists - /export/tests1.ldif, that's why it should > give an error. > > <== I'm still confused... This is db2ldif (export). The path specified > with -a is a file to be generated and written by the utility. That's said, > the file /export/tests1.ldif is not expected to exist? Am I missing > something? *************************************************** File can be generated with utility only if user nobody has permissions to write the output file under specified path? Like "-a /tmp/test1.ldif" should pass AND "-a /export/tests1.ldif" should fail due to permission issue. NOTE :: Both /export/ami1.ldif and /tmp/ami1.ldif files does not exists. [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/ami1.ldif Exported ldif file: /export/ami1.ldif ldiffile: /export/ami1.ldif [10/Jan/2014:12:03:43 +051800] - db2ldif: can't open /export/ami1.ldif: 13 (Permission denied) [10/Jan/2014:12:03:43 +051800] - All database threads now stopped [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /tmp/ami1.ldif Exported ldif file: /tmp/ami1.ldif ldiffile: /tmp/ami1.ldif [10/Jan/2014:12:06:01 +051800] - export userRoot: Processed 9 entries (100%). [10/Jan/2014:12:06:01 +051800] - All database threads now stopped Please correct me if my understanding is wrong or expected results are different *************************************************** > > I'd think this is good enough for the DS administrators. > Ok, but as in all other test cases execution gives error/warning on screen > with -q, it should also behave in similar way? > > But if that's good enough to log in error logs, I will mark the bug as > VERIFIED. > > <== Thank you, Amita! Yeah, I'd agree with you that it'd be nicer to show > the error in the utility's output. But what'd happen would be the admin > opens the output file /export/tests1.ldif and finds it empty, then s/he'll > go to see the error log and/or try to run it without -q and find the cause > of the problem. yeah, bit lengthy procedure for admin to find the actual cause :) Aha, in the comment 3, you wanted to put /tmp/test.ldif instead of /export/test.ldif? And the location of test1.ldif is correctly noted as /export/test1.ldif? If so, I got it. Test Case 1 (db2ldif):: ======================= without -q ----------- [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/test.ldif Exported ldif file: /export/test.ldif ldiffile: /export/test.ldif [08/Jan/2014:17:54:15 +051800] - export userRoot: Processed 9 entries (100%). [08/Jan/2014:17:54:15 +051800] - All database threads now stopped with -q expected pass ------------------------ [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/test.ldif -q Exported ldif file: /export/test.ldif [root@dhcp201-149 ~]# vim /export/test.ldif with -q expected to fail ------------------------- [root@dhcp201-149 ~]# db2ldif -Z slapd-dhcp201-149 -n userRoot -a /export/test1.ldif -q Exported ldif file: /export/test1.ldif This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request. |