Ilya Kulakov
2024-Mar-18 09:21 UTC
[Samba] smbd rejects all and any authentication attempts due to a corrupted "gencache.tdb"
I run smbd 4.18.8 inside a docker container via "smbd --foreground" (see the attached config). Recently my server was abruptly restarted due to a power outage. Upon the restart it was able to successfully start the container, but the shares became inaccessible due to smbd rejecting all authentication attempts. In the logs I found: [2024/03/18 08:22:50.790021, 5] ../../source3/lib/gencache.c:89(gencache_init) Opening cache file at /var/cache/samba/gencache.tdb [2024/03/18 08:22:50.790204, 1] ../../lib/tdb_wrap/tdb_wrap.c:65(tdb_wrap_log) tdb(/var/cache/samba/gencache.tdb): tdb_mutex_open_ok[/var/cache/samba/gencache.tdb]: Mutex size changed from 458752 to 401408 .Opening /var/cache/samba/gencache.tdb failed: Invalid argument [2024/03/18 08:22:50.790473, 4] ../../source3/smbd/sec_ctx.c:443(pop_sec_ctx) pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0 [2024/03/18 08:22:50.790538, 3] ../../source3/smbd/smb2_server.c:3962(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_UNSUCCESSFUL] || at ../../source3/smbd/smb2_negprot.c:320 After I manually deleted "gencache.tdb" and restarted the container all access was restored. Why did not smbd discard the file? [global] server role = standalone server log file = /dev/stdout dns proxy = no passdb backend = smbpasswd obey pam restrictions = yes security = user printcap name = /dev/null load printers = no dns proxy = no wide links = yes follow symlinks = yes unix extensions = no acl allow execute always = yes vfs objects = catia fruit streams_xattr fruit:model = TimeCapsule fruit:aapl = yes log level = 1 workgroup = WORKGROUP server string = Samba Server map to guest = Bad User min protocol=SMB2 server string=Home Library fruit:model=RackMac fruit:metadata=stream fruit:wipe_intentionally_left_blank_rfork=yes fruit:delete_empty_adfiles=yes disable netbios=yes [Movies] path=/shares/Movies create mask=0644 directory mask=0755 writable=yes browseable=yes public=yes force user=guest