RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2189717 - dsconf ERROR: Error: name 'log' is not defined
Summary: dsconf ERROR: Error: name 'log' is not defined
Keywords:
Status: CLOSED ERRATA
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
Evgenia Martynyuk
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-11-08 08:14 UTC (History)
7 users (show)

Fixed In Version: 389-ds-base-2.3.4-1.el9
Doc Type: Bug Fix
Doc Text:
.Changing a security parameter now works correctly Previously, when you changed a security parameter by using the `dsconf __instance_name__ security set` command, the operation failed with the error: ---- Name 'log' is not defined ---- With this update, the security parameter change works as expected.
Clone Of:
: 2224503 (view as bug list)
Environment:
Last Closed: 2023-11-07 08:25:18 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


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
Red Hat Product Errata RHBA-2023:6350 0 None None None 2023-11-07 08:25:43 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

Comment 13 errata-xmlrpc 2023-11-07 08:25:18 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-base 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:6350


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