Hi samba-tool dbcheck ERROR(<class 'KeyError'>): uncaught exception - 'No such element' ? File "/opt/samba/lib/python3.6/site-packages/samba/netcmd/__init__.py", line 185, in _run ??? return self.run(*args, **kwargs) ? File "/opt/samba/lib/python3.6/site-packages/samba/netcmd/dbcheck.py", line 141, in run ??? check_expired_tombstones=selftest_check_expired_tombstones) ? File "/opt/samba/lib/python3.6/site-packages/samba/dbchecker.py", line 221, in __init__ ??? self.tombstoneLifetime = int(res[0]["tombstoneLifetime"][0]) == samba-tool dbcheck --cross-ncs --fix --yes ERROR(<class 'KeyError'>): uncaught exception - 'No such element' ? File "/opt/samba/lib/python3.6/site-packages/samba/netcmd/__init__.py", line 185, in _run ??? return self.run(*args, **kwargs) ? File "/opt/samba/lib/python3.6/site-packages/samba/netcmd/dbcheck.py", line 141, in run ??? check_expired_tombstones=selftest_check_expired_tombstones) ? File "/opt/samba/lib/python3.6/site-packages/samba/dbchecker.py", line 221, in __init__ ??? self.tombstoneLifetime = int(res[0]["tombstoneLifetime"][0]) --- But strange that with samba 4.6.10 or 4.8.3 this problem does not occur NT_STATUS_INTERNAL_DB_CORRUPTION, I have not tried with versions of samba 4.9.X, is it something in version 4.10.6? Regards; On 24/07/2019 11:36, Rowland penny via samba wrote:> On 24/07/2019 15:02, Carlos via samba wrote: >> Hi, ok, now join(with samba 4.10.6) was ok, but same original error :-/ >> >> smbclient //localhost/netlogon -UAdministrator -c 'ls' >> Enter XXXXXXX\Administrator's password: >> session setup failed: NT_STATUS_INTERNAL_DB_CORRUPTION > > All I can suggest is to try and run 'samba-tool dbcheck' > > Rowland > > >
Rowland penny
2019-Jul-24 16:05 UTC
[Samba] Error after upgrade NT_STATUS_INTERNAL_DB_CORRUPTION
On 24/07/2019 16:01, Carlos via samba wrote:> Hi > > samba-tool dbcheck > ERROR(<class 'KeyError'>): uncaught exception - 'No such element' > ? File > "/opt/samba/lib/python3.6/site-packages/samba/netcmd/__init__.py", > line 185, in _run > ??? return self.run(*args, **kwargs) > ? File > "/opt/samba/lib/python3.6/site-packages/samba/netcmd/dbcheck.py", line > 141, in run > ??? check_expired_tombstones=selftest_check_expired_tombstones) > ? File "/opt/samba/lib/python3.6/site-packages/samba/dbchecker.py", > line 221, in __init__ > ??? self.tombstoneLifetime = int(res[0]["tombstoneLifetime"][0])I think this is a python 3 problem, the code around line 221 in dbchecker is this: ??????? res = samdb.search(base=ntds_service_dn, ?????????????????????????? scope=ldb.SCOPE_BASE, ?????????????????????????? expression="(objectClass=nTDSService)", ?????????????????????????? attrs=["tombstoneLifetime"]) ??????? if "tombstoneLifetime" in res[0]: ??????????? self.tombstoneLifetime = int(res[0]["tombstoneLifetime"][0]) ??????? else: ??????????? self.tombstoneLifetime = 180 It searches in AD to find the tombstone lifetime and it looks like the search works, because the line that fails: self.tombstoneLifetime = int(res[0]["tombstoneLifetime"][0]) is only run if 'tombstoneLifetime' is in the search result, so it seems to be found, but then not found ???? Let me think about this to see if I can come up with a fix. Rowland
Rowland penny
2019-Jul-24 16:31 UTC
[Samba] Error after upgrade NT_STATUS_INTERNAL_DB_CORRUPTION
On 24/07/2019 17:05, Rowland penny via samba wrote:> On 24/07/2019 16:01, Carlos via samba wrote: >> Hi >> >> samba-tool dbcheck >> ERROR(<class 'KeyError'>): uncaught exception - 'No such element' >> ? File >> "/opt/samba/lib/python3.6/site-packages/samba/netcmd/__init__.py", >> line 185, in _run >> ??? return self.run(*args, **kwargs) >> ? File >> "/opt/samba/lib/python3.6/site-packages/samba/netcmd/dbcheck.py", >> line 141, in run >> ??? check_expired_tombstones=selftest_check_expired_tombstones) >> ? File "/opt/samba/lib/python3.6/site-packages/samba/dbchecker.py", >> line 221, in __init__ >> ??? self.tombstoneLifetime = int(res[0]["tombstoneLifetime"][0]) > > I think this is a python 3 problem, the code around line 221 in > dbchecker is this: > > ??????? res = samdb.search(base=ntds_service_dn, > ?????????????????????????? scope=ldb.SCOPE_BASE, > ?????????????????????????? expression="(objectClass=nTDSService)", > ?????????????????????????? attrs=["tombstoneLifetime"]) > ??????? if "tombstoneLifetime" in res[0]: > ??????????? self.tombstoneLifetime = int(res[0]["tombstoneLifetime"][0]) > ??????? else: > ??????????? self.tombstoneLifetime = 180 > > It searches in AD to find the tombstone lifetime and it looks like the > search works, because the line that fails: > > self.tombstoneLifetime = int(res[0]["tombstoneLifetime"][0]) > > is only run if 'tombstoneLifetime' is in the search result, so it > seems to be found, but then not found ???? > > Let me think about this to see if I can come up with a fix. > > Rowland > > >OK, when I actually checked a DC running 4.10.6, the code actually looks like this: ??????? res = samdb.search(base=ntds_service_dn, ?????????????????????????? scope=ldb.SCOPE_BASE, ?????????????????????????? expression="(objectClass=nTDSService)", ?????????????????????????? attrs=["tombstoneLifetime"]) ??????? self.tombstoneLifetime = int(res[0]["tombstoneLifetime"][0]) but in 'master', it now looks like this: ??????? res = samdb.search(base=ntds_service_dn, ?????????????????????????? scope=ldb.SCOPE_BASE, ?????????????????????????? expression="(objectClass=nTDSService)", ?????????????????????????? attrs=["tombstoneLifetime"]) ??????? if "tombstoneLifetime" in res[0]: ??????????? self.tombstoneLifetime = int(res[0]["tombstoneLifetime"][0]) ??????? else: ??????????? self.tombstoneLifetime = 180 So, try opening 'dbchecker.py' in your favourite editor and make it look like the latter and try again. /usr/lib/python3/dist-packages/samba/dbchecker.py Starts at line 217 Rowland