Bug 1937036 - Error "values has to be a tuple" when creating schema using dsconf [RHDS 11.2]
Summary: Error "values has to be a tuple" when creating schema using dsconf [RHDS 11.2]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Directory Server
Classification: Red Hat
Component: 389-ds-base
Version: 11.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: DS11.2
: dirsrv-11.2
Assignee: mreynolds
QA Contact: RHDS QE
Marc Muehlfeld
URL:
Whiteboard:
Depends On: 1937029 1944759
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-09 17:32 UTC by mreynolds
Modified: 2021-04-19 09:55 UTC (History)
6 users (show)

Fixed In Version: redhat-ds-11-8030020210311231232.0b92cc7b
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1937029
Environment:
Last Closed: 2021-04-19 09:54:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:1243 0 None None None 2021-04-19 09:55:08 UTC

Description mreynolds 2021-03-09 17:32:33 UTC
+++ This bug was initially created as a clone of Bug #1937029 +++

Issue Description

dsconf fails with ERROR: Error: values has to be a tuple, was None when adding a new objectClass

Package Version and Platform:

1.4.3+

Steps to Reproduce

[root@server-f33 ds]# dsconf -v server-f33 schema objectclasses add testOC 
DEBUG: The 389 Directory Server Configuration Tool
DEBUG: Inspired by works of: ITS, The University of Adelaide
DEBUG: dsrc path: /root/.dsrc
DEBUG: dsrc container path: /data/config/container.inf
DEBUG: dsrc instances: []
DEBUG: dsrc no such section: slapd-server-f33
DEBUG: Called with: Namespace(instance='server-f33', verbose=True, binddn=None, bindpw=None, prompt=False, pwdfile=None, basedn=None, starttls=False, json=False, name='testOC', oid=None, desc=None, x_origin=None, must=None, may=None, kind=None, sup=None, func=<function add_objectclass at 0x7f5917562dc0>)
DEBUG: Instance details: {'uri': 'server-f33', 'basedn': None, 'binddn': None, 'bindpw': None, 'saslmech': None, 'tls_cacertdir': None, 'tls_cert': None, 'tls_key': None, 'tls_reqcert': None, 'starttls': False, 'prompt': False, 'pwdfile': None, 'args': {'ldapurl': 'server-f33', 'root-dn': None}}
DEBUG: Allocate <class 'lib389.DirSrv'> with ldapi://%2fvar%2frun%2fslapd-server-f33.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with %2fvar%2frun%2fslapd-server-f33.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with server-f33.example.com:389
DEBUG: Allocate <class 'lib389.DirSrv'> with server-f33.example.com:389
DEBUG: Allocate <class 'lib389.DirSrv'> with ldapi://%2fvar%2frun%2fslapd-server-f33.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with %2fvar%2frun%2fslapd-server-f33.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with server-f33.example.com:389
DEBUG: Allocate <class 'lib389.DirSrv'> with server-f33.example.com:389
DEBUG: open(): Connecting to uri ldapi://%2fvar%2frun%2fslapd-server-f33.socket
DEBUG: Using dirsrv ca certificate /etc/dirsrv/slapd-server-f33
DEBUG: Using external ca certificate /etc/dirsrv/slapd-server-f33
DEBUG: Using external ca certificate /etc/dirsrv/slapd-server-f33
DEBUG: Using /etc/openldap/ldap.conf certificate policy
DEBUG: ldap.OPT_X_TLS_REQUIRE_CERT = 2
DEBUG: open(): Using root autobind ...
DEBUG: open(): bound as None
DEBUG: Retrieving entry with [('',)]
DEBUG: Retrieved entry [dn: 
vendorVersion: 389-Directory/2.0.3.20210309gitaefc1acbf B2021.068.1215

]
DEBUG: cn=schema get_attr_vals('objectClasses')
DEBUG: values has to be a tuple, was None
Traceback (most recent call last):
  File "/usr/sbin/dsconf", line 134, in <module>
    result = args.func(inst, None, log, args)
  File "/usr/lib/python3.9/site-packages/lib389/cli_conf/schema.py", line 144, in add_objectclass
    schema.add_objectclass(parameters)
  File "/usr/lib/python3.9/site-packages/lib389/schema.py", line 330, in add_objectclass
    return self._add_schema_object(parameters, ObjectClass)
  File "/usr/lib/python3.9/site-packages/lib389/schema.py", line 215, in _add_schema_object
    return self.add(attr_name, str(schema_object))
  File "/usr/lib64/python3.9/site-packages/ldap/schema/models.py", line 179, in __str__
    result.append(self.key_list('X-ORIGIN',self.x_origin,quoted=1))
  File "/usr/lib64/python3.9/site-packages/ldap/schema/models.py", line 79, in key_list
    assert type(values)==tuple,TypeError("values has to be a tuple, was %r" % values)
AssertionError: values has to be a tuple, was None
ERROR: Error: values has to be a tuple, was None

--- Additional comment from  on 2021-03-09 17:30:57 UTC ---

Upstream ticket:

https://github.com/389ds/389-ds-base/issues/4663


This also impacts 389-ds-base-1.4.3

Comment 4 Akshay Adhikari 2021-04-14 07:33:03 UTC
Build Tested: 389-ds-base-1.4.3.21-2.module+el8dsrv+10309+dd9f990e.x86_64
cockpit-389-ds-1.4.3.21-2.module+el8dsrv+10309+dd9f990e.noarch

# dsconf -v DS-TEST schema objectclasses add testOC
DEBUG: The 389 Directory Server Configuration Tool
DEBUG: Inspired by works of: ITS, The University of Adelaide
DEBUG: dsrc path: /root/.dsrc
DEBUG: dsrc container path: /data/config/container.inf
DEBUG: dsrc instances: []
DEBUG: dsrc no such section: slapd-DS-TEST
DEBUG: Called with: Namespace(basedn=None, binddn=None, bindpw=None, desc=None, func=<function add_objectclass at 0x7ff94dd352f0>, instance='DS-TEST', json=False, kind=None, may=None, must=None, name='testOC', oid=None, prompt=False, pwdfile=None, starttls=False, sup=None, verbose=True, x_origin=None)
DEBUG: Instance details: {'uri': 'DS-TEST', 'basedn': None, 'binddn': None, 'bindpw': None, 'saslmech': None, 'tls_cacertdir': None, 'tls_cert': None, 'tls_key': None, 'tls_reqcert': None, 'starttls': False, 'prompt': False, 'pwdfile': None, 'args': {'ldapurl': 'DS-TEST', 'root-dn': None}}
.....

DEBUG: cn=schema get_attr_vals('objectClasses')
DEBUG: cn=schema set ADD: ('objectClasses', "( None NAME 'testOC' STRUCTURAL )")
Successfully added the objectClass
INFO: Command successful.

Marking as VERIFIED

Comment 5 Akshay Adhikari 2021-04-14 11:40:10 UTC
============================================================================ test session starts ================================================================
platform linux -- Python 3.6.8, pytest-6.2.3, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3.6
cachedir: .pytest_cache
metadata: {'Python': '3.6.8', 'Platform': 'Linux-4.18.0-240.6.1.el8_3.x86_64-x86_64-with-redhat-8.3-Ootpa', 'Packages': {'pytest': '6.2.3', 'py': '1.10.0', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '1.11.0', 'html': '3.1.1'}}
389-ds-base: 1.4.3.21-2.module+el8dsrv+10309+dd9f990e
nss: 3.53.1-17.el8_3
nspr: 4.25.0-2.el8_2
openldap: 2.4.46-16.el8
cyrus-sasl: not installed
FIPS: disabled
rootdir: /workspace/ds/dirsrvtests, configfile: pytest.ini
plugins: metadata-1.11.0, html-3.1.1
collected 4 items                                                                                                                                                           

dirsrvtests/tests/suites/clu/schema_test.py::test_origins[attr1-99999.1-None] PASSED                                                                                  [ 25%]
dirsrvtests/tests/suites/clu/schema_test.py::test_origins[attr2-99999.2-test-str] PASSED                                                                              [ 50%]
dirsrvtests/tests/suites/clu/schema_test.py::test_origins[attr3-99999.3-xorg2] PASSED                                                                                 [ 75%]
dirsrvtests/tests/suites/clu/schema_test.py::test_origins[attr4-99999.4-test-tuple] PASSED                                                                            [100%]

============================================================================ 4 passed in 11.49s =================================================================

Comment 7 errata-xmlrpc 2021-04-19 09:54:31 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 (Moderate: redhat-ds:11 security and bug fix 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:1243


Note You need to log in before you can comment on or make changes to this bug.