#50921 Backend creation fails with --create-suffix
Closed: wontfix 4 years ago by mreynolds. Opened 4 years ago by vashirov.

Issue Description

# dsconf -v localhost backend  create --suffix dc=example,dc=org --be-name userRoot2 --create-suffix
...
DEBUG: Creating dc=example,dc=org                                                                                                                              
DEBUG: updating dn: dc=example,dc=org                                                                                                                          
DEBUG: updated dn: dc=example,dc=org with {'objectclass': [b'top', b'domain']}                                                                                 
DEBUG: updating dn: dc=example,dc=org                                                                                                                          
DEBUG: updated dn: dc=example,dc=org with {'dc': [b'example'], 'description': [b'dc=example,dc=org']}                                                          
DEBUG: Created entry dc=example,dc=org : {'objectclass': [b'top', b'domain'], 'dc': [b'example'], 'description': [b'dc=example,dc=org']}                       
DEBUG: dc=example,dc=org set ADD: ('aci', ('(targetattr="dc || description || objectClass")(targetfilter="(objectClass=domain)")(version 3.0; acl "Enable anyon
e domain read"; allow (read, search, compare)(userdn="ldap:///anyone");)',))                                                                                   
DEBUG: 'tuple' object has no attribute 'encode'                                                                                                                
Traceback (most recent call last):                                                                                                                             
  File "/usr/sbin/dsconf", line 134, in <module>                                                                                                               
    result = args.func(inst, None, log, args)                                                                                                                  
  File "/usr/lib/python3.6/site-packages/lib389/cli_conf/backend.py", line 191, in backend_create                                                              
    domain.add('aci', dc_aci)                                                                                                                                  
  File "/usr/lib/python3.6/site-packages/lib389/_mapped_object.py", line 259, in add                                                                           
    self.set(key, value, action=ldap.MOD_ADD)                                                                                                                  
  File "/usr/lib/python3.6/site-packages/lib389/_mapped_object.py", line 434, in set                                                                           
    value = [ensure_bytes(value)]                                                                                                                              
  File "/usr/lib/python3.6/site-packages/lib389/utils.py", line 1143, in ensure_bytes                                                                          
    return val.encode()                                                                                                                                        
AttributeError: 'tuple' object has no attribute 'encode'                                                                                                       
ERROR: Error: 'tuple' object has no attribute 'encode'    

Package Version and Platform

389-ds-base-1.4.2.4+


Work for me on 1.4.2 and master branch:

dsconf localhost backend create --suffix o=test --be-name markRoot --create-suffix

The database was sucessfully created

Metadata Update from @mreynolds:
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None

4 years ago

It works with o=test but fails with dc=example,dc=org, because we add an aci for domain component:

DEBUG: dc=examplesdfsdf,dc=com set ADD: ('aci', ('(targetattr="dc || description || objectClass")(targetfilter="(objectClass=domain)")(version 3.0; acl "Enable anyone domain read"; allow (read, search, compare)(userdn="ldap:///anyone");)',))                     

Metadata Update from @mreynolds:
- Issue assigned to mreynolds

4 years ago

The problem was there was a stray comma following the aci value in the code, which turned a string into a tuple :-)

I'm fixing this in https://pagure.io/389-ds-base/issue/50928

Metadata Update from @mreynolds:
- Issue close_status updated to: duplicate
- Issue status updated to: Closed (was: Open)

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/3974

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: duplicate)

3 years ago

Login to comment on this ticket.

Metadata