Bug 1835619

Summary: Healthcheck with --json option reports "Object of type 'bytes' is not JSON serializable" when mapping tree is deleted
Product: Red Hat Enterprise Linux 8 Reporter: bsmejkal
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED ERRATA QA Contact: RHDS QE <ds-qe-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.2CC: pasik, spichugi, tbordaz, vashirov
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 389-ds-1.4-8030020200605214214.618f7055 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 03:07:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description bsmejkal 2020-05-14 07:57:08 UTC
Description of problem:
When mapping tree is deleted, healthcheck without --json argument reports DSBLE0001 and DSBLE0003 codes correctly, but using healthcheck with --json option ends in Error: Object of type 'bytes' is not JSON serializable.

Version-Release number of selected component (if applicable):
389-ds-base-1.4.2.4-8.module+el8.2.0+5959+cfcaedbd.x86_64
389-ds-base-1.4.2.12-1.fc31.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create DS instance
2. Delete mapping tree:
# ldapdelete -p 389 -D "cn=directory manager" -w password -h server.example.com 'cn=dc\3Dexample\2Cdc\3Dcom,cn=mapping tree,cn=config'

3. Run healthcheck with --json option:
# dsctl --json inst healthcheck

Actual results:
# dsctl --json inst healthcheck
Error: Object of type 'bytes' is not JSON serializable

Expected results:
Healthcheck should return DSBLE0001 and DSBLE0003 issues in json format.

Additional info:

Comment 1 mreynolds 2020-05-14 13:37:41 UTC
Upstream ticket:
https://pagure.io/389-ds-base/issue/51091

Comment 4 bsmejkal 2020-07-15 10:54:28 UTC
=============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.6.8, pytest-5.4.3, py-1.9.0, pluggy-0.13.1 -- /usr/bin/python3.6
cachedir: .pytest_cache
metadata: {'Python': '3.6.8', 'Platform': 'Linux-4.18.0-221.el8.x86_64-x86_64-with-redhat-8.3-Ootpa', 'Packages': {'pytest': '5.4.3', 'py': '1.9.0', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '1.10.0', 'html': '2.1.1', 'libfaketime': '0.1.2'}}
389-ds-base: 1.4.3.8-4.module+el8.3.0+7193+dfd1e8ad
nss: 3.44.0-15.el8
nspr: 4.21.0-2.el8_0
openldap: 2.4.46-15.el8
cyrus-sasl: 2.1.27-5.el8
FIPS: disabled
rootdir: /mnt/tests/rhds/tests/upstream/ds/dirsrvtests, inifile: pytest.ini
plugins: metadata-1.10.0, html-2.1.1, libfaketime-0.1.2
collected 7 items / 6 deselected / 1 selected                                                                                                                                                                     

dirsrvtests/tests/suites/healthcheck/healthcheck_test.py::test_healthcheck_backend_missing_mapping_tree PASSED                                                                                              [100%]

================================================================================== 1 passed in 12.64s =============================================================================================================

Comment 7 errata-xmlrpc 2020-11-04 03:07:52 UTC
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 (389-ds:1.4 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/RHEA-2020:4695