Univention Bugzilla – Bug 38645
AttributeError: 'NoneType' object has no attribute 'endswith'
Last modified: 2015-06-17 18:16:27 CEST
The following traceback happens on a customer system: Ticket #2015060221000151 03.06.2015 10:38:57,439 LDAP (WARNING): sync failed, saved as rejected /var/lib/univention-connector/s4/1433318363.139797 03.06.2015 10:38:57,439 LDAP (WARNING): Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/univention/s4connector/__init__.py", line 801, in __sync_file_from_ucs or (not old_dn and not self.sync_from_ucs(key, object, premapped_ucs_dn, old_dn, old, new))): File "/usr/lib/pymodules/python2.7/univention/s4connector/s4/__init__.py", line 2344, in sync_from_ucs f(self, property_type, object, addlist, ctrls) File "/usr/lib/pymodules/python2.7/univention/s4connector/s4/__init__.py", line 102, in add_primary_group_to_addlist s4_group_object = s4connector._object_mapping(member_key, {'dn':ucs_group_ldap[0][0], 'attributes': ucs_group_ldap[0][1]}, 'ucs') File "/usr/lib/pymodules/python2.7/univention/s4connector/__init__.py", line 1703, in _object_mapping object[dntype] = self.dn_mapped_to_base(object[dntype], self.lo_s4.base) File "/usr/lib/pymodules/python2.7/univention/s4connector/__init__.py", line 448, in dn_mapped_to_base if dn.endswith(base): AttributeError: 'NoneType' object has no attribute 'endswith'
Created attachment 6938 [details] connector.patch The attached patch solve the issue on the customer system.
*** Bug 38704 has been marked as a duplicate of this bug. ***
See Bug #38704. this issue seems to be introduced by Bug #38614. The test case 174sync_nested_umlaut_groups shows the error.
(In reply to Stefan Gohmann from comment #1) > Created attachment 6938 [details] > connector.patch > > The attached patch solve the issue on the customer system. But the patch is wrong. since Bug #38614 most values are saved as binary values, thus the comparison with an empty string is false. I've also converted two more values t unicode to remove the sqlite warning listed in Bug #38704: r61240.
(In reply to Stefan Gohmann from comment #4) > But the patch is wrong. since Bug #38614 most values are saved as binary > values, thus the comparison with an empty string is false. > I've also converted two more values t unicode to remove the sqlite warning > listed in Bug #38704: r61240. I've adjusted the conversion: - r61242 - r61245
Created attachment 6965 [details] fix_brackets.patch The original issue here seems to be fixed but I found another collateral damage of Bug #38614 in the connector-s4.log: ================================================================= 15.06.2015 12:43:01,741 LDAP (WARNING): S4Cache: sqlite: Error binding parameter 0 - probably unsupported type.. SQL command was: [('DELETE FROM data WHERE data.id IN (\t\t\t\tSELECT data.id FROM DATA INNER JOIN ATTRIBUTES ON data.attribute_id=attributes.id \t\t\t\t\twhere attributes.attribute=? and guid_id =? \t\t\t\t);', [('member',), ('123',)]), ('DELETE FROM data WHERE data.id IN (\t\t\t\t\t\t\tSELECT data.id FROM DATA INNER JOIN ATTRIBUTES ON data.attribute_id=attributes.id \t\t\t\t\t\t\twhere attributes.id=? and guid_id = ? and value = ? \t\t\t\t\t\t);', ['31', '123', 'Mzk1OQ==\n']), ('INSERT INTO DATA(guid_id,attribute_id,value) VALUES(?,?,?);', ['123', '31', 'NDAwMQ==\n']), ('DELETE FROM data WHERE data.id IN (\t\t\t\t\t\t\tSELECT data.id FROM DATA INNER JOIN ATTRIBUTES ON data.attribute_id=attributes.id \t\t\t\t\t\t\twhere attributes.id=? and guid_id = ? and value = ? \t\t\t\t\t\t);', ['22', '123', 'w7EewqsEwqbDlsOXRsKtRcObwqLCssKDw7TDhA==\n']), ('INSERT INTO DATA(guid_id,attribute_id,value) VALUES(?,?,?);', ['123', '22', 'w7EewqsEwqbDlsOXRsKtRcObwqLCssKDw7TDhA==\n']), ('DELETE FROM data WHERE data.id IN (\t\t\t\t\t\t\tSELECT data.id FROM DATA INNER JOIN ATTRIBUTES ON data.attribute_id=attributes.id \t\t\t\t\t\t\twhere attributes.id=? and guid_id = ? and value = ? \t\t\t\t\t\t);', ['23', '123', 'MjAxNTA2MTUxNjQxNTEuMFo=\n']), ('INSERT INTO DATA(guid_id,attribute_id,value) VALUES(?,?,?);', ['123', '23', 'MjAxNTA2MTUxNjQzMDAuMFo=\n'])] ================================================================= Here a list is passed as sqlite parameter: where attributes.attribute=? and guid_id =? \t\t\t\t);', [('member',), ('123',)]) The attached patch fixes this and unifies the use of lists and tuples in this case.
(In reply to Arvid Requate from comment #6) > Created attachment 6965 [details] > fix_brackets.patch Thanks, applied (r61261). Test case 257read_ad_user_primarygroup shows the error.
Ok, verified.
<http://errata.univention.de/ucs/4.0/211.html>