Bug 2170557 - dsctl ldifgen error: DirSrv has no attribute 'userid'
Summary: dsctl ldifgen error: DirSrv has no attribute 'userid'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Directory Server
Classification: Red Hat
Component: 389-ds-base
Version: 11.7
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: DS11.8
: dirsrv-11.8
Assignee: mreynolds
QA Contact: LDAP QA Team
Evgenia Martynyuk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-16 17:30 UTC by Viktor Ashirov
Modified: 2023-11-28 10:09 UTC (History)
7 users (show)

Fixed In Version: redhat-ds-11-8090020230901161717.4a0d6ab8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-28 10:09:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 5142 0 None closed dsctl dbgen is broken 2023-09-01 14:21:28 UTC
Red Hat Issue Tracker IDMDS-3514 0 None None None 2023-08-07 18:40:38 UTC
Red Hat Issue Tracker IDMDS-3516 0 None None None 2023-08-07 18:41:05 UTC
Red Hat Product Errata RHBA-2023:7519 0 None None None 2023-11-28 10:09:38 UTC

Description Viktor Ashirov 2023-02-16 17:30:30 UTC
Description of problem:
I get an error while running 
dsctl -v standalone1 ldifgen users
...
DEBUG: DirSrv has no attribute 'userid'
Traceback (most recent call last):
  File "/usr/sbin/dsctl", line 160, in <module>
    result = args.func(inst, log, args)
  File "/usr/lib/python3.6/site-packages/lib389/cli_ctl/dbgen.py", line 195, in dbgen_create_users
    dbgen_users(inst, args.number, args.ldif_file, args.suffix, generic=args.generic, parent=args.parent, startIdx=args.start_idx, rdnCN=False, pseudol10n=args.localize)
  File "/usr/lib/python3.6/site-packages/lib389/dbgen.py", line 296, in dbgen_users
    finalize_ldif_file(instance, ldif_file)
  File "/usr/lib/python3.6/site-packages/lib389/dbgen.py", line 135, in finalize_ldif_file
    userid = ensure_str(instance.userid)
  File "/usr/lib64/python3.6/site-packages/ldap/ldapobject.py", line 363, in __getattr__
    self.__class__.__name__,repr(name)
AttributeError: DirSrv has no attribute 'userid'
ERROR: Error: DirSrv has no attribute 'userid'
Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1. dsctl -v standalone1 ldifgen users


Actual results:
dsctl exits with traceback

Expected results:
dsctl should generate an ldif with users.

Additional info:
https://github.com/389ds/389-ds-base/issues/5142

Comment 3 Viktor Ashirov 2023-08-21 07:37:03 UTC
Build tested:
389-ds-base-1.4.3.37-1.module+el8dsrv+19621+efe8bde6.x86_64

# dsctl -v localhost ldifgen users
DEBUG: The 389 Directory Server Administration Tool
DEBUG: Inspired by works of: ITS, The University of Adelaide
DEBUG: Called with: Namespace(func=<function dbgen_create_users at 0x7fcb9ac69f28>, generic=False, instance='localhost', json=False, ldif_file='ldifgen.ldif', list=False, localize=False, number=None, parent=None, rdn_cn=False, remove_all=False, start_idx=0, suffix=None, verbose=True)
DEBUG: Allocate local instance <class 'lib389.DirSrv'> with None
DEBUG: Instance allocated
INFO: Missing required parameters, switching to Interactive mode ...

Enter the suffix [dc=example,dc=com]:

Enter the parent entry for the users [ou=people,dc=example,dc=com]:

Enter the number of users to create [100000]:

Do you want to use "cn" instead of "uid" for the entry RDN attribute (yes/no) [no]:

Create generic entries that can be used with "ldclt" (yes/no) [no]:

Do you want to localize the LDIF data (yes/no) [no]:

Enter the new LDIF file name [/var/lib/dirsrv/slapd-localhost/ldif/ldifgen.ldif]:
INFO:
Generating LDIF with the following options:
INFO:  - number=100000
INFO:  - suffix=dc=example,dc=com
INFO:  - parent=ou=people,dc=example,dc=com
INFO:  - generic=False
INFO:  - start-idx=0
INFO:  - rdn-cn=False
INFO:  - localize=False
INFO:  - ldif-file=/var/lib/dirsrv/slapd-localhost/ldif/ldifgen.ldif
INFO:
Writing LDIF ...
DEBUG: DirSrv has no attribute 'userid'
Traceback (most recent call last):
  File "/usr/sbin/dsctl", line 160, in <module>
    result = args.func(inst, log, args)
  File "/usr/lib/python3.6/site-packages/lib389/cli_ctl/dbgen.py", line 193, in dbgen_create_users
    dbgen_users(inst, args.number, args.ldif_file, args.suffix, generic=args.generic, parent=args.parent, startIdx=args.start_idx, rdnCN=False, pseudol10n=args.localize)
  File "/usr/lib/python3.6/site-packages/lib389/dbgen.py", line 300, in dbgen_users
    finalize_ldif_file(instance, ldif_file)
  File "/usr/lib/python3.6/site-packages/lib389/dbgen.py", line 139, in finalize_ldif_file
    userid = ensure_str(instance.userid)
  File "/usr/lib64/python3.6/site-packages/ldap/ldapobject.py", line 363, in __getattr__
    self.__class__.__name__,repr(name)
AttributeError: DirSrv has no attribute 'userid'
ERROR: Error: DirSrv has no attribute 'userid'

Moving to ASSIGNED.

Comment 4 Viktor Ashirov 2023-09-15 15:24:05 UTC
Build tested: 389-ds-base-1.4.3.37-2.module+el8dsrv+19833+d41da347.x86_64

# dsctl localhost ldifgen users
Missing required parameters, switching to Interactive mode ...

Enter the suffix [dc=example,dc=com]:

Enter the parent entry for the users [ou=people,dc=example,dc=com]:

Enter the number of users to create [100000]:

Do you want to use "cn" instead of "uid" for the entry RDN attribute (yes/no) [no]:

Create generic entries that can be used with "ldclt" (yes/no) [no]:

Do you want to localize the LDIF data (yes/no) [no]:

Enter the new LDIF file name [/var/lib/dirsrv/slapd-localhost/ldif/ldifgen.ldif]:

Generating LDIF with the following options:
 - number=100000
 - suffix=dc=example,dc=com
 - parent=ou=people,dc=example,dc=com
 - generic=False
 - start-idx=0
 - rdn-cn=False
 - localize=False
 - ldif-file=/var/lib/dirsrv/slapd-localhost/ldif/ldifgen.ldif

Writing LDIF ...

Successfully created LDIF file: /var/lib/dirsrv/slapd-localhost/ldif/ldifgen.ldif


Marking as VERIFIED.

Comment 6 errata-xmlrpc 2023-11-28 10:09:21 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 (redhat-ds:11 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:7519


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