If you try to join a domain that can't be found (e.g. misspelt), then you get a TypeError and a nice stack trace. bin/samba-tool domain join blah.dont.exist dc -UAdministrator%locDCpass1 --targetdir=/tmp/join INFO 2019-01-16 15:12:40,926 pid:49872 bin/python/samba/join.py #102: Finding a writeable DC for domain 'blah.dont.exist' ERROR(<class 'TypeError'>): uncaught exception - 'NTSTATUSError' object does not support indexing File "bin/python/samba/netcmd/__init__.py", line 184, in _run return self.run(*args, **kwargs) File "bin/python/samba/netcmd/domain.py", line 699, in run backend_store=backend_store) File "bin/python/samba/join.py", line 1515, in join_DC backend_store=backend_store) File "bin/python/samba/join.py", line 103, in __init__ ctx.server = ctx.find_dc(domain) File "bin/python/samba/join.py", line 349, in find_dc (domain, error[1])) Instead, what it should be trying to output is a more helpful message like this: Failed to find a writeable DC for domain 'blah.dont.exist': The object name is not found.
Created attachment 14780 [details] Fix backport for 4.8
Created attachment 14781 [details] Backport of fix for v4.9
Created attachment 14782 [details] Fix backport for v4.10
Comment on attachment 14780 [details] Fix backport for 4.8 The 4.8 patch is fixing one slight little thing more, importing NTSTATUSError, but that is OK.
Hi Karolin, patches are attached for v4.8, 4.9, and 4.10. It's just fixing up untidy error handling in a samba-tool command. Could you backport to the appropriate branches please?
(In reply to Tim Beale from comment #5) Hi Tim, sure. :-) Pushed to autobuild-v4-{10,9,8}-test.
(In reply to Karolin Seeger from comment #6) Pushed to all branches. Closing out bug report. Thanks!