Bug 2189717 - dsconf ERROR: Error: name 'log' is not defined
Summary: dsconf ERROR: Error: name 'log' is not defined
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: 389-ds-base
Version: 9.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 9.2
Assignee: LDAP Maintainers
QA Contact: LDAP QA Team
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks: 2224503
TreeView+ depends on / blocked
 
Reported: 2023-04-26 00:15 UTC by Rob Crittenden
Modified: 2023-08-04 07:45 UTC (History)
6 users (show)

Fixed In Version: 389-ds-base-2.3.4-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2224503 (view as bug list)
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 5539 0 None closed regression in `lib389.cli_conf.security` 2023-04-26 09:23:57 UTC
Red Hat Issue Tracker IDMDS-2988 0 None None None 2023-05-03 15:31:50 UTC
Red Hat Issue Tracker IDMDS-3480 0 None None None 2023-07-26 13:02:11 UTC
Red Hat Issue Tracker RHELPLAN-155783 0 None None None 2023-04-26 00:18:49 UTC

Description Rob Crittenden 2023-04-26 00:15:19 UTC
Description of problem:

Trying to change a security parameter ends with the error: name 'log' is not defined

# dsconf -v slapd-EXAMPLE-TEST security set --tls-protocol-min=TLS1.0
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-EXAMPLE-TEST
DEBUG: Called with: Namespace(instance='slapd-EXAMPLE-TEST', verbose=True, binddn=None, bindpw=None, prompt=False, pwdfile=None, basedn=None, starttls=False, json=False, security=None, listen_host=None, secure_port=None, tls_client_auth=None, tls_client_renegotiation=None, require_secure_authentication=None, check_hostname=None, verify_cert_chain_on_startup=None, session_timeout=None, tls_protocol_min='TLS1.0', tls_protocol_max=None, allow_insecure_ciphers=None, allow_weak_dh_param=None, cipher_pref=None, func=<function _security_generic_set_parser.<locals>.<lambda> at 0x7fec1abd85e0>)
DEBUG: Instance details: {'uri': 'slapd-EXAMPLE-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': 'slapd-EXAMPLE-TEST', 'root-dn': None}}
DEBUG: Allocate <class 'lib389.DirSrv'> with ldapi://%2frun%2fslapd-EXAMPLE-TEST.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-EXAMPLE-TEST.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-EXAMPLE-TEST.socket:None
DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-EXAMPLE-TEST.socket:None
DEBUG: Allocate <class 'lib389.DirSrv'> with ldapi://%2frun%2fslapd-EXAMPLE-TEST.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-EXAMPLE-TEST.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-EXAMPLE-TEST.socket:None
DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-EXAMPLE-TEST.socket:None
DEBUG: open(): Connecting to uri ldapi://%2frun%2fslapd-EXAMPLE-TEST.socket
DEBUG: Using dirsrv ca certificate /etc/dirsrv/slapd-EXAMPLE-TEST
DEBUG: Using external ca certificate /etc/dirsrv/slapd-EXAMPLE-TEST
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.2.4 B2022.347.0000

]
DEBUG: cn=encryption,cn=config set REPLACE: ('sslVersionMin', 'TLS1.0')
DEBUG: name 'log' is not defined
Traceback (most recent call last):
  File "/usr/sbin/dsconf", line 138, in <module>
    result = args.func(inst, None, log, args)
  File "/usr/lib/python3.9/site-packages/lib389/cli_conf/security.py", line 113, in <lambda>
    p.set_defaults(func=lambda *args: _security_generic_set(*args, attrs_map))
  File "/usr/lib/python3.9/site-packages/lib389/cli_conf/security.py", line 102, in _security_generic_set
    log.info(f"Successfully updated security configuration ({props.attr})")
NameError: name 'log' is not defined
ERROR: Error: name 'log' is not defined

Version-Release number of selected component (if applicable):

389-ds-base-2.2.4-3.el9.x86_64

How reproducible:

Every time. It does successfully update dse.ldif.

Steps to Reproduce:
1. I found it after installing IPA
2. dsconf -v slapd-EXAMPLE-TEST security set --tls-protocol-min=TLS1.0

Comment 4 Graham Leggett 2023-06-06 08:42:41 UTC
Just hit this issue, breaks our automation. Is there an update?

Comment 7 Viktor Ashirov 2023-07-21 07:58:21 UTC
Moving to MODIFIED, as the fix was picked up by the rebase in 9.3. 
It will be fixed in 9.2.z in https://bugzilla.redhat.com/show_bug.cgi?id=2224503

Comment 10 Viktor Ashirov 2023-08-04 07:45:35 UTC
Moving to VERIFIED according to comment #7


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