Bug 2165091
| Summary: | Failing to create a new attribute with the CLI when specifying a matching rule. | ||
|---|---|---|---|
| Product: | Red Hat Directory Server | Reporter: | Têko Mihinto <tmihinto> |
| Component: | Command Line Utilities | Assignee: | mreynolds |
| Status: | CLOSED ERRATA | QA Contact: | LDAP QA Team <idm-ds-qe-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | high | ||
| Version: | 11.6 | CC: | aadhikar, idm-ds-dev-bugs, mreynolds, vashirov |
| Target Milestone: | DS12.2 | Keywords: | TestCaseProvided, Triaged |
| Target Release: | dirsrv-12.2 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | sync-to-jira | ||
| Fixed In Version: | redhat-ds-12-9020020230314150545.1674d574 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-05-30 09:40:35 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: | |||
Upstream ticket: https://github.com/389ds/389-ds-base/issues/5658 Automated test passed ============================================================= test session starts ============================================================= platform linux -- Python 3.9.16, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3 cachedir: .pytest_cache 389-ds-base: 2.2.7-2.module+el9dsrv+18726+78959e84 nss: 3.79.0-18.el9_1 nspr: 4.34.0-18.el9_1 openldap: 2.6.2-3.el9 cyrus-sasl: not installed FIPS: disabled rootdir: /root/ds/dirsrvtests, configfile: pytest.ini collected 1 item dirsrvtests/tests/suites/clu/schema_test.py::test_mrs PASSED [100%] ============================================================= 1 passed in 17.89s ============================================================== 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 (redhat-ds:12 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/RHBA-2023:3344 |
Description of problem: A customer needed to extend the LDAP schema. When trying to add a matching rule, the command fails. This works fine when the matching rule option is not used. Version-Release number of selected component (if applicable): $ cat /etc/redhat-release Red Hat Enterprise Linux release 8.7 (Ootpa) $ $ rpm -qa | grep 389-ds 389-ds-base-1.4.3.31-11.module+el8dsrv+17815+4f95348d.x86_64 cockpit-389-ds-1.4.3.31-11.module+el8dsrv+17815+4f95348d.noarch 389-ds-base-legacy-tools-1.4.3.31-11.module+el8dsrv+17815+4f95348d.x86_64 389-ds-base-libs-1.4.3.31-11.module+el8dsrv+17815+4f95348d.x86_64 $ How reproducible: Always. Steps to Reproduce: For instance: $ dsconf -j ldapi://%2fvar%2frun%2fslapd-<INSTANCE>.socket schema attributetypes add newAttr --syntax 1.3.6.1.4.1.1466.115.121.1.15 --equality caseexactmatch --single-value --user-mod --usage userApplications --desc Case_XXX { "desc": "value has to be of str, was 'caseexactmatch'" } $ Customer was initially trying to add the "numericstringsubstringsmatch" to an existing attribute using the RHDS Console. I could reproduce the issue with any type of matching rule. # dsconf --verbose ldapi://%2fvar%2frun%2fslapd-<INSTANCE>.socket schema attributetypes add newAttr --syntax 1.3.6.1.4.1.1466.115.121.1.36 --substr numericstringsubstringsmatch --single-value --user-mod --usage userApplications --desc Test ... vendorVersion: 389-Directory/1.4.3.31 B2023.012.1725 ] DEBUG: cn=schema get_attr_vals('attributeTypes') DEBUG: value has to be of str, was 'numericstringsubstringsmatch' Traceback (most recent call last): File "/usr/sbin/dsconf", line 138, in <module> result = args.func(inst, None, log, args) File "/usr/lib/python3.6/site-packages/lib389/cli_conf/schema.py", line 137, in add_attributetype schema.add_attributetype(parameters) File "/usr/lib/python3.6/site-packages/lib389/schema.py", line 344, in add_attributetype return self._add_schema_object(parameters, AttributeType) File "/usr/lib/python3.6/site-packages/lib389/schema.py", line 225, in _add_schema_object return self.add(attr_name, str(schema_object)) File "/usr/lib64/python3.6/site-packages/ldap/schema/models.py", line 305, in __str__ result.append(self.key_attr('SUBSTR',self.substr)) File "/usr/lib64/python3.6/site-packages/ldap/schema/models.py", line 69, in key_attr assert value is None or type(value)==str,TypeError("value has to be of str, was %r" % value) AssertionError: value has to be of str, was 'numericstringsubstringsmatch' ERROR: Error: value has to be of str, was 'numericstringsubstringsmatch' $ Actual results: Failing to modify the custom schema. Expected results: Allow to add matching rules. Additional info: