Univention Bugzilla – Bug 56137
Ad-Connector fails: TypeError: a bytes-like object is required, not 'str'
Last modified: 2023-06-21 09:24:42 CEST
univention-lib (9.0.15-1) f5fb202c3973 | Bug #56137: fix Python 3 compatiblity regression
Internal server error during "adconnector/check_domain". Request: adconnector/check_domain Traceback (most recent call last): File "%PY3%/univention/lib/admember.py", line 864, in lookup_adds_dc ipaddress.ip_address(u'%s' % (ad_server,)) File "/usr/lib/python3.7/ipaddress.py", line 54, in ip_address address) ValueError: '***' does not appear to be an IPv4 or IPv6 address During handling of the above exception, another exception occurred: Traceback (most recent call last): File "%PY3%/univention/management/console/base.py", line 351, in __error_handling six.reraise(etype, exc, etraceback) File "%PY3%/six.py", line 693, in reraise raise value File "%PY3%/univention/management/console/base.py", line 254, in execute function.__func__(self, request, *args, **kwargs) File "%PY3%/univention/management/console/modules/decorators.py", line 186, in _response return function(self, request) File "%PY3%/univention/management/console/modules/decorators.py", line 327, in _response result = _multi_response(self, request) File "%PY3%/univention/management/console/modules/decorators.py", line 186, in _response return function(self, request) File "%PY3%/univention/management/console/modules/decorators.py", line 447, in _response return list(function(self, iterator, *nones)) File "%PY3%/univention/management/console/modules/decorators.py", line 295, in _fake_func yield function(self, *args) File "%PY3%/univention/management/console/modules/adconnector/__init__.py", line 398, in check_domain ad_domain_info = admember.lookup_adds_dc(ad_server_address) File "%PY3%/univention/lib/admember.py", line 881, in lookup_adds_dc for i in stdout.split(u'\n'): TypeError: a bytes-like object is required, not 'str'
Another exception which is masked by some wrong error message. 12.06.23 10:58:18.732 MODULE ( ERROR ) : well-known-sid-object-rename failed with 1 (Traceback (most recent call last): File "/usr/share/univention-ad-connector/scripts/well-known-sid-object-rename", line 52, in <module> import univention.connector.ad File "/usr/lib/python3/dist-packages/univention/connector/ad/__init__.py", line 64, in <module> import univention.connector.ad.mapping File "/usr/lib/python3/dist-packages/univention/connector/ad/mapping.py", line 42, in <module> import univention.connector.ad.password File "/usr/lib/python3/dist-packages/univention/connector/ad/password.py", line 44, in <module> import Crypto ModuleNotFoundError: No module named 'Crypto' ) __ERR__:Could not connect to AD Server WIN-DUA7EARHMN9.admember.test. Please verify that username and password are correct. W: The config registry variable 'kerberos/kdc' does not exist The cause is git:85fa3834fe27d38575ac2d1e86bfcf0d2c20ca78, which removed python3-crypto as dependency from univention-squid. It's unused there. But univention-ad-connector doesn't have the dependency. The regular tests didn't recognize this because ucs-test also install python3-crypto.
univention-ad-connector (14.0.15-1) 750bedc07658 | fix(ad-connector): fix AD-Connector configuration UCS 5.0-3 (package not build): 8b7fd6ef5a0d | fix(ad-connector): fix AD-Connector configuration
3d67e61dc4f | fix Python 3 compatiblity regression -> This broke AD-Membermode setup.
OK: Admembermode setup OK: Code review OK: Tests No changelog needed Verified
Version: 5.0-3 errata709 Remark: Fresh install of UCS 5.0.3 on VMware ESXi 6.7. After initial install and reboot, installed AD Connector and attempted to connect to the same domain as was used in UCS install (***.**). I performed this yesterday in my test domain and it worked without issue. This was the second attempt to get this up on production domain.
UCS 5.0-4 has been released: https://docs.software-univention.de/release-notes/5.0-4/en/ If this error occurs again, please use the 'Clone This Bug' option.