Fedora-28 box: Joined to ad using 'net ads join -U <>' # net ads testjoin Join is OK # samba-tool domain level show ERROR(ldb): uncaught exception - ldb_search: invalid basedn '(null)' File "/usr/lib64/python2.7/site-packages/samba/netcmd/__init__.py", line 176, in _run return self.run(*args, **kwargs) File "/usr/lib64/python2.7/site-packages/samba/netcmd/domain.py", line 1055, in run scope=ldb.SCOPE_BASE, attrs=["msDS-Behavior-Version"]) # samba-tool domain level raise --domain-level=2012_R2 --forest-level=2012_R2 ERROR(ldb): uncaught exception - ldb_search: invalid basedn '(null)' File "/usr/lib64/python2.7/site-packages/samba/netcmd/__init__.py", line 176, in _run return self.run(*args, **kwargs) File "/usr/lib64/python2.7/site-packages/samba/netcmd/domain.py", line 1055, in run scope=ldb.SCOPE_BASE, attrs=["msDS-Behavior-Version"]) On Window's 2008 AD: PS C:\Users\root.ATEST> $dse = ([ADSI] "LDAP://RootDSE") PS C:\Users\root.ATEST> PS C:\Users\root.ATEST> # Domain Controller Functional Level PS C:\Users\root.ATEST> $dse.domainControllerFunctionality 4 PS C:\Users\root.ATEST> PS C:\Users\root.ATEST> # Domain Functional Level PS C:\Users\root.ATEST> $dse.domainFunctionality 4 PS C:\Users\root.ATEST> PS C:\Users\root.ATEST> # Forest Functional Level PS C:\Users\root.ATEST> $dse.forestFunctionalit Even # man samba-tool does not guides how to use 'domain level show|raise' correctly. What are prerequisites of using it.
This isn't really a samba-tool problem, it is a samba-tool command misconfiguration, not helped by the fact that the samba-tool manpage doesn't mention '-H URL, --URL=URL'. The lack of the URL is why Amit's attempt to use 'samba-tool domain level show' failed. The fix would have been to run 'samba-tool domain level show --help' which would have shown (amongst others) this: -H URL, --URL=URL LDB URL for database or target server However, the samba-tool manpage does need fixing.
It should now show an error failing to open the (default to local) DB file, rather than creating an empty file and then spewing silly errors from that.
(In reply to Andrew Bartlett from comment #2) > It should now show an error failing to open the (default to local) DB file, rather than creating an empty file and then spewing silly errors from that. I think Andrew refers to https://gitlab.com/samba-team/samba/-/commit/7009479b7a91715543e228412435ab2fdb6221ae which is 4.9-ish, and from his description, it does not constitute much of a fix. but Rowland, you're suggesting in https://lists.samba.org/archive/samba-technical/2022-August/137560.html that the old behaviour persists? Clearly you're not running 4.8. > Running: sudo samba-tool domain level show -d0 > > Gets you: > > ERROR(ldb): uncaught exception - ldb_search: invalid basedn '(null)' > File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line > 186, in _run > return self.run(*args, **kwargs) > File "/usr/lib/python3/dist-packages/samba/netcmd/domain.py", line > 1051, in run > scope=ldb.SCOPE_BASE, attrs=["msDS-Behavior-Version"]) Could you add print(lp.samdb_url()) to /usr/lib/python3/dist-packages/samba/netcmd/domain.py, a few lines up from that, before samdb = SamDB(...)? I haven't managed to replicate this in a testenv. All kinds of other uncaught exceptions.
(In reply to Douglas Bagnall from comment #3) Er, no, I am running a much later version, but I was aware of this bug and you asked for samba-tool bugs to fix. If it was fixed (even if it wasn't much of a fix), Andrew should have closed this bug.
never was an issue for me either. Also no more feedback from the initial reporter. Closing now.