Created attachment 15722 [details] Adding text=True to popen call Setting up user password synchronization hook and running it results in following error stacktrace. Adding argument "text=true" to Popen call resolves it: Jan 07 11:42:42 samba4-dc1 systemd[1]: Started Samba user password synchronization hook. Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: ERROR(<class 'TypeError'>): uncaught exception - memoryview: a bytes-like object is required, not 'str' Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 186, in _run Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: return self.run(*args, **kwargs) Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: File "/usr/lib/python3/dist-packages/samba/netcmd/user.py", line 2368, in run Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: sync_loop(wait) Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: File "/usr/lib/python3/dist-packages/samba/netcmd/user.py", line 2257, in sync_loop Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: dirsync_loop() Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: File "/usr/lib/python3/dist-packages/samba/netcmd/user.py", line 2234, in dirsync_loop Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: handle_object(ri, r) Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: File "/usr/lib/python3/dist-packages/samba/netcmd/user.py", line 2043, in handle_object Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: run_sync_command(obj.dn, ldif) Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: File "/usr/lib/python3/dist-packages/samba/netcmd/user.py", line 2001, in run_sync_command Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: reply = sync_command_p.communicate(input)[0] Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: File "/usr/lib/python3.7/subprocess.py", line 964, in communicate Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: stdout, stderr = self._communicate(input, endtime, timeout) Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: File "/usr/lib/python3.7/subprocess.py", line 1695, in _communicate Jan 07 11:42:43 samba4-dc1 samba-tool[7474]: input_view = memoryview(self._input)
*** This bug has been marked as a duplicate of bug 14154 ***