# Samba 3.6.13 tdb corruptions



## grant (May 2, 2013)

I recently updated a production server to Samba 3.6.13 compiled from ports on a AMD64 9.1-RELEASE host. There have been regular (as much as daily) access issues with shares exported from the server. The problem appears to be corruption of the tdb databases. In the first case, the connections.tdb database was corrupt (unfortunately I didn't capture logs). Today the issue reoccurred with the locking and other databases.

Some sample log entries:

```
log.smbd.old:[2013/05/02 09:37:55.560334,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=6656
log.smbd.old:[2013/05/02 09:37:55.560382,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=6656
log.smbd.old:[2013/05/02 09:37:55.560467,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=6656
log.smbd.old:[2013/05/02 09:37:55.560520,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=6656
log.smbd.old:[2013/05/02 09:37:55.560628,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=5556
log.smbd.old:[2013/05/02 09:37:55.560704,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=5556
log.smbd.old:[2013/05/02 09:37:55.560750,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=5556
log.smbd.old:[2013/05/02 09:37:55.560798,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=5556
log.smbd.old:[2013/05/02 09:37:55.560878,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=5556
log.smbd.old:[2013/05/02 09:37:55.560930,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=5556
```


```
log.nmbd:[2013/05/01 09:32:42.530640,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.nmbd:  tdb(/var/db/samba/serverid.tdb): tdb_rec_read bad magic 0x42424242 at offset=8132
log.nmbd:[2013/05/01 09:32:42.530753,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.nmbd:  tdb(/var/db/samba/serverid.tdb): tdb_rec_read bad magic 0x42424242 at offset=8132
```


```
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=6656
log.smbd.old:[2013/05/02 09:37:55.560520,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=6656
log.smbd.old:[2013/05/02 09:37:55.560628,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=5556
log.smbd.old:[2013/05/02 09:37:55.560704,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=5556
log.smbd.old:[2013/05/02 09:37:55.560750,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=5556
log.smbd.old:[2013/05/02 09:37:55.560798,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=5556
log.smbd.old:[2013/05/02 09:37:55.560878,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=5556
log.smbd.old:[2013/05/02 09:37:55.560930,  0] ../lib/util/tdb_wrap.c:65(tdb_wrap_log)
log.smbd.old:  tdb(/var/db/samba/messages.tdb): tdb_rec_read bad magic 0x42424242 at offset=5556
```
The server has plenty of free space. The root filesystem is ZFS. Version 3.6.9 had been working fine, so the plan is to revert to that version, but I wonder if anyone else is experiencing the same issue or has any suggestions as to a resolution?


----------

