Samba stop working - Alt-F 0.1RC4 on DNS323

413 views
Skip to first unread message

Buscat

unread,
Nov 16, 2014, 7:08:33 PM11/16/14
to al...@googlegroups.com
Hello everybody,
on my DNS 323 Samba has always worked perfectly... until today.
I cannot access to Samba shares from Windows 7, Ubuntu, Android and I can't access to SWAT interface, from admin page: wrong username/password (?!?!)
I've tried to reboot, with no success.
This is my samba.log


[2014/11/17 00:39:06,  1] lib/util_unistr.c:113(load_case_tables)
  creating lame upcase table
[2014/11/17 00:39:06,  1] lib/util_unistr.c:128(load_case_tables)
  creating lame lowcase table
[2014/11/17 00:39:06,  0] smbd/server.c:1143(main)
  smbd version 3.5.22 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2010
[2014/11/17 00:39:07.998854,  1] passdb/pdb_tdb.c:503(tdbsam_open)
  tdbsam_open: Converting version 0.0 database to version 4.0.
[2014/11/17 00:39:08.002054,  1] passdb/pdb_tdb.c:282(tdbsam_convert_backup)
  tdbsam_convert_backup: updated /etc/samba/passdb.tdb file.
[2014/11/17 00:39:08.078602,  1] lib/account_pol.c:325(account_policy_get)
  account_policy_get: tdb_fetch_uint32 failed for type 1 (min password length), returning 0
[2014/11/17 00:39:08.079765,  1] lib/account_pol.c:325(account_policy_get)
  account_policy_get: tdb_fetch_uint32 failed for type 2 (password history), returning 0
[2014/11/17 00:39:08.080854,  1] lib/account_pol.c:325(account_policy_get)
  account_policy_get: tdb_fetch_uint32 failed for type 3 (user must logon to change password), returning 0
[2014/11/17 00:39:08.081937,  1] lib/account_pol.c:325(account_policy_get)
  account_policy_get: tdb_fetch_uint32 failed for type 4 (maximum password age), returning 0
[2014/11/17 00:39:08.102003,  1] lib/account_pol.c:325(account_policy_get)
  account_policy_get: tdb_fetch_uint32 failed for type 5 (minimum password age), returning 0
[2014/11/17 00:39:08.103191,  1] lib/account_pol.c:325(account_policy_get)
  account_policy_get: tdb_fetch_uint32 failed for type 6 (lockout duration), returning 0
[2014/11/17 00:39:08.104276,  1] lib/account_pol.c:325(account_policy_get)
  account_policy_get: tdb_fetch_uint32 failed for type 7 (reset count minutes), returning 0
[2014/11/17 00:39:08.105359,  1] lib/account_pol.c:325(account_policy_get)
  account_policy_get: tdb_fetch_uint32 failed for type 8 (bad lockout attempt), returning 0
[2014/11/17 00:39:08.106471,  1] lib/account_pol.c:325(account_policy_get)
  account_policy_get: tdb_fetch_uint32 failed for type 9 (disconnect time), returning 0
[2014/11/17 00:39:08.107550,  1] lib/account_pol.c:325(account_policy_get)
  account_policy_get: tdb_fetch_uint32 failed for type 10 (refuse machine password change), returning 0

Any ideas?
Thanks in advance

Buscat

unread,
Nov 17, 2014, 7:18:09 PM11/17/14
to al...@googlegroups.com
Update:
In my Samba configuration I have one user only.
I have noticed that if I delete and re-create this user, once the Samba sever has been restarted, shares start to work perfectly.
If I restart all services from System --> Utilities, Samba shares are still present. 
BUT if I reboot DNS323 the problem reoccurs; I get a looping username/password request and no access.

João Cardoso

unread,
Nov 18, 2014, 10:01:10 AM11/18/14
to al...@googlegroups.com


On Tuesday, November 18, 2014 12:18:09 AM UTC, Buscat wrote:
Update:
In my Samba configuration I have one user only.
I have noticed that if I delete and re-create this user, once the Samba sever has been restarted, shares start to work perfectly.
If I restart all services from System --> Utilities, Samba shares are still present. 
BUT if I reboot DNS323 the problem reoccurs; I get a looping username/password request and no access.

Do you have customized samba in any way? Or using SWAT? It all depends on your setup.

For a *standard* (simple) samba setup, stop samba, then remove all files from /etc/samba *except*

credentials.*
smb.conf
smbpasswd
smbusers

Be sure that no files exists under /var/spool/samba and that /Alt-F/etc/samba doesn't exist, then "save settings", start samba, see if it works and reboot.

If /Alt-F/etc/samba exists, the files found there will override the default ones, and that might be the cause of the issue.

Buscat

unread,
Nov 18, 2014, 6:47:35 PM11/18/14
to al...@googlegroups.com
Hello João,
I haven't customized samba, not at all.
Following your suggestions I confirm that no files exists under /var/spool/samba and that /Alt-F/etc/samba doesn't exist.
In /etc/samba/ I've deleted all files (secrets.tdb and passdb.tdb) except files you told me.
After restarting Samba i get a user/pass request (obviously, doesn't work) and no access to shares; the only difference it's in samba log file

[2014/11/18 23:49:48,  0] smbd/server.c:1143(main)
  smbd version 3.5.22 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2010
[2014/11/18 23:49:49.439830,  1] passdb/pdb_tdb.c:503(tdbsam_open)
  tdbsam_open: Converting version 0.0 database to version 4.0.
[2014/11/18 23:49:49.449285,  1] passdb/pdb_tdb.c:282(tdbsam_convert_backup)
  tdbsam_convert_backup: updated /etc/samba/passdb.tdb file.
[2014/11/18 23:50:33.634023,  0] lib/util_sock.c:474(read_fd_with_timeout)
[2014/11/18 23:50:33.634957,  0] lib/util_sock.c:1441(get_peer_addr_internal)
  getpeername failed. Error was Transport endpoint is not connected
  read_fd_with_timeout: client 0.0.0.0 read error = Connection reset by peer.

Rebooting DNS323, same result: doesn't work and samba log file it's the same as below. (my post of november 17).

In this case I've tried not to delete user but I've changed the password (putting the same); after doing this, all works.



Il giorno lunedì 17 novembre 2014 01:08:33 UTC+1, Buscat ha scritto:

João Cardoso

unread,
Nov 19, 2014, 10:20:24 AM11/19/14
to al...@googlegroups.com


On Tuesday, November 18, 2014 11:47:35 PM UTC, Buscat wrote:
Hello João,
I haven't customized samba, not at all.
Following your suggestions I confirm that no files exists under /var/spool/samba and that /Alt-F/etc/samba doesn't exist.
In /etc/samba/ I've deleted all files (secrets.tdb and passdb.tdb) except files you told me.
After restarting Samba i get a user/pass request (obviously, doesn't work) and no access to shares; the only difference it's in samba log file

[2014/11/18 23:49:48,  0] smbd/server.c:1143(main)
  smbd version 3.5.22 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2010
[2014/11/18 23:49:49.439830,  1] passdb/pdb_tdb.c:503(tdbsam_open)
  tdbsam_open: Converting version 0.0 database to version 4.0.
[2014/11/18 23:49:49.449285,  1] passdb/pdb_tdb.c:282(tdbsam_convert_backup)
  tdbsam_convert_backup: updated /etc/samba/passdb.tdb file.
[2014/11/18 23:50:33.634023,  0] lib/util_sock.c:474(read_fd_with_timeout)
[2014/11/18 23:50:33.634957,  0] lib/util_sock.c:1441(get_peer_addr_internal)
  getpeername failed. Error was Transport endpoint is not connected
  read_fd_with_timeout: client 0.0.0.0 read error = Connection reset by peer.

Rebooting DNS323, same result: doesn't work and samba log file it's the same as below. (my post of november 17).

In this case I've tried not to delete user but I've changed the password (putting the same); after doing this, all works.

Then the issue was a corrupted  /etc/samba/smbpasswd

As the samba database (tdb) files are "huge" to be saved in flash memory (only 64KB available for settings), Alt-F only saves /etc/samba/smbpasswd, and samba will rebuild /etc/samba/secrets.tdb from it at startup. That is what you see in the logs:

tdbsam_open: Converting version 0.0 database to version 4.0.
tdbsam_convert_backup: updated /etc/samba/passdb.tdb file.

followed by:

 account_policy_get: tdb_fetch_uint32 failed for type 1 (min password length), returning 0
  account_policy_get: tdb_fetch_uint32 failed for type 2 (password history), returning 0
  account_policy_get: tdb_fetch_uint32 failed for type 3 (user must logon to change password), returning 0
  account_policy_get: tdb_fetch_uint32 failed for type 4 (maximum password age), returning 0
  account_policy_get: tdb_fetch_uint32 failed for type 5 (minimum password age), returning 0
  account_policy_get: tdb_fetch_uint32 failed for type 6 (lockout duration), returning 0
  account_policy_get: tdb_fetch_uint32 failed for type 7 (reset count minutes), returning 0
  account_policy_get: tdb_fetch_uint32 failed for type 8 (bad lockout attempt), returning 0
  account_policy_get: tdb_fetch_uint32 failed for type 9 (disconnect time), returning 0
  account_policy_get: tdb_fetch_uint32 failed for type 10 (refuse machine password change), returning 0

That would explains why it works when you delete/re-create users after power-up, as samba would use the created secrets.tdb file. But after reboot the situation would repeat.
Your last "change password" action was probably done without a secrets.tdb file, and smbpasswd was updated/recreated instead, solving the issue.

Of course I didn't knew this before, and I'm speculating "a posteriori", and writing this for future reference, as my memory is... well :-(

Shelly

unread,
Oct 18, 2015, 5:10:01 PM10/18/15
to Alt-F
I just recently installed Alt-F 0.1RC4.1 with kernel 3.10.32 on my DNS-323 rev C. I've been having the same problem with SAMBA not starting up properly on reboot, but in my case I could simply restart the service and it would start working. I tried to follow the instructions above by deleting the extra files, but that didn't help. At the moment, I have a startup script that I'm using to wait, then restart the service... but is there something else I should be doing? I uninstalled samba-small and installed samba + samba-modules (so I could use VFS for the recycle bin) - maybe that has something to do with it?

This is the log from /var/log/samba/log.smbd on my recent startup:
[2015/10/18 13:59:13,  1] lib/util_unistr.c:113(load_case_tables)
  creating lame upcase table
[2015/10/18 13:59:13,  1] lib/util_unistr.c:128(load_case_tables)
  creating lame lowcase table
[2015/10/18 13:59:14,  0] smbd/server.c:1143(main)

  smbd version 3.5.22 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2010
[2015/10/18 13:59:14.675982,  1] param/loadparm.c:6912(service_ok)
  NOTE: Service Users is flagged unavailable.
[2015/10/18 13:59:15.962147,  1] lib/account_pol.c:325(account_policy_get)

  account_policy_get: tdb_fetch_uint32 failed for type 1 (min password length), returning 0
[2015/10/18 13:59:15.963343,  1] lib/account_pol.c:325(account_policy_get)

  account_policy_get: tdb_fetch_uint32 failed for type 2 (password history), returning 0
[2015/10/18 13:59:15.964416,  1] lib/account_pol.c:325(account_policy_get)

  account_policy_get: tdb_fetch_uint32 failed for type 3 (user must logon to change password), returning 0
[2015/10/18 13:59:15.966720,  1] lib/account_pol.c:325(account_policy_get)

  account_policy_get: tdb_fetch_uint32 failed for type 4 (maximum password age), returning 0
[2015/10/18 13:59:15.967791,  1] lib/account_pol.c:325(account_policy_get)

  account_policy_get: tdb_fetch_uint32 failed for type 5 (minimum password age), returning 0
[2015/10/18 13:59:15.968846,  1] lib/account_pol.c:325(account_policy_get)

  account_policy_get: tdb_fetch_uint32 failed for type 6 (lockout duration), returning 0
[2015/10/18 13:59:15.969907,  1] lib/account_pol.c:325(account_policy_get)

  account_policy_get: tdb_fetch_uint32 failed for type 7 (reset count minutes), returning 0
[2015/10/18 13:59:15.981185,  1] lib/account_pol.c:325(account_policy_get)

  account_policy_get: tdb_fetch_uint32 failed for type 8 (bad lockout attempt), returning 0
[2015/10/18 13:59:15.982248,  1] lib/account_pol.c:325(account_policy_get)

  account_policy_get: tdb_fetch_uint32 failed for type 9 (disconnect time), returning 0
[2015/10/18 13:59:15.983300,  1] lib/account_pol.c:325(account_policy_get)

  account_policy_get: tdb_fetch_uint32 failed for type 10 (refuse machine password change), returning 0
[2015/10/18 13:59:27,  1] lib/util_unistr.c:113(load_case_tables)
  creating lame upcase table
[2015/10/18 13:59:27,  1] lib/util_unistr.c:128(load_case_tables)
  creating lame lowcase table
[2015/10/18 13:59:27,  0] smbd/server.c:1143(main)

  smbd version 3.5.22 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2010
[2015/10/18 13:59:28.133285,  1] param/loadparm.c:6912(service_ok)
  NOTE: Service Users is flagged unavailable.
[2015/10/18 13:59:30.981301,  1] smbd/service.c:1084(make_connection_snum)
  office (192.168.0.104) connect to service root initially as user nobody (uid=99, gid=98) (pid 1655)

My startup script is simple:
#!/bin/sh

# redirect the current shell environment to fixes.log
exec >> /var/log/fixes.log 2>&1

export PATH=$PATH:/mnt/md0/scripts

# Waiting for Alt-F packages to be available (e.g. sshd)
echo
-n "Waiting for Alt-F packages to be available:"
while ! aufs.sh -s >& /dev/null; do
    echo
-n '.'
    sleep
1
done
echo OK

./mnt/md0/scripts/svnserve.sh restart
rcsmb restart


Joao Cardoso

unread,
Oct 19, 2015, 8:32:26 PM10/19/15
to Alt-F


On Sunday, October 18, 2015 at 10:10:01 PM UTC+1, Shelly wrote:
I just recently installed Alt-F 0.1RC4.1 with kernel 3.10.32 on my DNS-323 rev C. I've been having the same problem with SAMBA not starting up properly on reboot, but in my case I could simply restart the service and it would start working.

I'm afraid I dont understand:
in my case I could simply restart the service and it would start working.
Does it works OK (i.e., you can login) after you restart the service? So, what is the issue?

I tried to follow the instructions above by deleting the extra files, but that didn't help. At the moment, I have a startup script that I'm using to wait, then restart the service... but is there something else I should be doing? I uninstalled samba-small and installed samba + samba-modules (so I could use VFS for the recycle bin) - maybe that has something to do with it?

I couldn't completely reproduce that (what I understood). I installed samba-modules, which automatically installed 'samba', which shadows 'samba-small', then I edited smb.conf to activate the recycle bin, and I could login successfully.

But you have a point! After "save settings" and reboot and I couldn't login! I had to restart the service, otherwise I would have the error
   smbd: can't resolve symbol 'smb_register_vfs'

That means that the samba server that's running is still the one from 'samba-small', which has no knowledge of modules. That happens because samba starts running early in the boot cycle, and at that point it's still 'samba-small' that exists (it can't be removed, it's in the firmware).
Only latter on, when filesystems are mounted and the Alt-F folder (with packages files) is made available, with 'samba' be available.
So your script approach is correct, you must restart the samba service as soon as Alt-F packages are available; that will stop running the binary from 'samba-small' and start running the one from 'samba'. Not doing that automatically is an Alt-F bug.

But that has nothing to do with login/users/credentials. That's a separate issue.
Remember that smb.conf *must* have
        passdb backend = smbpasswd
        smb passwd file = /etc/samba/smbpasswd
Remember also that, besides the /etc/samba/ files, samba also keeps a set of cache files at /var/cache/samba. That location is temporary by nature and should not persists across reboots or poweroff (unless /Alt-F/var/cache exists, which *shouldn't* happen!).
Reply all
Reply to author
Forward
0 new messages