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

CLI - export failures are not properly logged and reported #5632

Closed
mreynolds389 opened this issue Feb 6, 2023 · 1 comment
Closed

CLI - export failures are not properly logged and reported #5632

mreynolds389 opened this issue Feb 6, 2023 · 1 comment
Assignees
Labels
CLI CLI tools

Comments

@mreynolds389
Copy link
Contributor

mreynolds389 commented Feb 6, 2023

When a "Can't open file" type of error occurs, db2ldif command line does not display the error.
Seeing the ldiffile path displayed is misleading and makes think that the file as actually been created.
Nothing shows that the operation couldn't be performed, unless looking at the errors log

Version-Release number of selected component (if applicable):
389-ds-base-1.4.3.8-4.module+el8.3.0+7193+dfd1e8ad.x86_64

How reproducible:
always

Steps to Reproduce:
automated test export/export_test.py::test_db2ldif_with_non_accessible_ldif_file_path will be sent soon as PR for review
or

  1. import data in "dc=example,dc=com"
  2. stop the ds instance
  3. run # db2ldif -Z standalone1 -s "dc=example,dc=com" -a ldif/db.ldif

Actual results:

db2ldif -Z standalone1 -s "dc=example,dc=com" -a ldif/db.ldif
Exported ldif file: /mnt/tests/rhds/tests/upstream/ldif/db.ldif
[24/Jul/2020:04:55:06.947184501 -0400] - INFO - slapd_exemode_db2ldif - db2ldif - Backend Instance(s):
[24/Jul/2020:04:55:06.952243624 -0400] - INFO - slapd_exemode_db2ldif - db2ldif - userRoot
ldiffile: /mnt/tests/rhds/tests/upstream/ldif/db.ldif

Expected results:

The error should be displayed as command output, in addition of info already displayed :
[24/Jul/2020:04:55:06.976484643 -0400] - ERR - bdb_db2ldif - db2ldif: userRoot: can't open /mnt/tests/rhds/tests/upstream/ldif/db.ldif: 2 (No such file or directory) while running as user "dirsrv"

It should be clear that ldiffile: /mnt/tests/rhds/tests/upstream/ldif/db.ldif couldn't be created and that the operation failed


This original bug was for the old perl scripts, but dsctl/dsconf still have the same type of problems.

https://bugzilla.redhat.com/show_bug.cgi?id=1860291

@mreynolds389 mreynolds389 added the CLI CLI tools label Feb 6, 2023
@mreynolds389 mreynolds389 self-assigned this Feb 6, 2023
mreynolds389 added a commit to mreynolds389/389-ds-base that referenced this issue Feb 8, 2023
Description: Have the CLI check if the ldif location exists.  This also prevents
             the database from getting trashed by skipping the export attempt.

relates: 389ds#5632

Reviewed by: progier & spichugi(Thanks!)
mreynolds389 added a commit that referenced this issue Feb 8, 2023
Description: Have the CLI check if the ldif location exists.  This also prevents
             the database from getting trashed by skipping the export attempt.

relates: #5632

Reviewed by: progier & spichugi(Thanks!)
mreynolds389 added a commit that referenced this issue Feb 8, 2023
Description: Have the CLI check if the ldif location exists.  This also prevents
             the database from getting trashed by skipping the export attempt.

relates: #5632

Reviewed by: progier & spichugi(Thanks!)
mreynolds389 added a commit that referenced this issue Feb 8, 2023
Description: Have the CLI check if the ldif location exists.  This also prevents
             the database from getting trashed by skipping the export attempt.

relates: #5632

Reviewed by: progier & spichugi(Thanks!)
mreynolds389 added a commit that referenced this issue Feb 8, 2023
Description: Have the CLI check if the ldif location exists.  This also prevents
             the database from getting trashed by skipping the export attempt.

relates: #5632

Reviewed by: progier & spichugi(Thanks!)
mreynolds389 added a commit that referenced this issue Feb 8, 2023
Description: Have the CLI check if the ldif location exists.  This also prevents
             the database from getting trashed by skipping the export attempt.

relates: #5632

Reviewed by: progier & spichugi(Thanks!)
@mreynolds389
Copy link
Contributor Author

944202f..9caf8a1 389-ds-base-2.2 -> 389-ds-base-2.2
f78614b..0c894c6 389-ds-base-2.1 -> 389-ds-base-2.1
0a77fae..c19148b 389-ds-base-2.0 -> 389-ds-base-2.0
00f42cf..f8dc05e 389-ds-base-1.4.3 -> 389-ds-base-1.4.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI CLI tools
Projects
None yet
Development

No branches or pull requests

1 participant