LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Samba suddenly stopped working (https://www.linuxquestions.org/questions/linux-networking-3/samba-suddenly-stopped-working-4175658828/)

thomas.hedden 08-08-2019 04:22 PM

Samba suddenly stopped working
 
I am running Ubuntu 16.04 LTS. I have not upgraded to the latest release, but I have made all suggested updates to 16.04 LTS.
I have been running this system for many months without any problems, except for a power problem a week or so ago, and I have always been able to see Windows 7/10 clients on the local area network.
Last night there was a thunderstorm, so I powered off my Ubuntu machine and disconnected it from power. When I powered back up, I was no longer able to get Samba to work:
Click on "Windows Network"
Alert box is displayed:
"Unable to access location" "Failed to retrieve share list from server: Invalid argument"
I have not made any changes to /etc/samba/smb.conf, although interestingly it shows a change date of of today. (Do updates ever make changes to smb.conf on their own initiative, without user input?)
I can ping back and forth between the Windows machine and the Linux machine.
I have web servers installed on both Ubuntu and Windows, and if I enter the IP address of the Windows machine in a browser on my Ubuntu machine, it displays the "Zend Server Test Page", and if I enter the IP address of the Ubuntu machine on my Windows 7 machine it displays the "Apache2 Ubuntu Default Page".
wabac[tom]: /home/tom$ samba --version
Version 4.3.11-Ubuntu
root@wabac:/home/tom# /etc/init.d/samba restart
[ ok ] Restarting nmbd (via systemctl): nmbd.service.
[ ok ] Restarting smbd (via systemctl): smbd.service.
[ ok ] Restarting samba-ad-dc (via systemctl): samba-ad-dc.service.
root@wabac:/home/tom# exit
exit
wabac[tom]: /home/tom$ cat /var/log/syslog
[snip]
Aug 8 16:52:49 wabac dbus[945]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service'
Aug 8 16:52:49 wabac systemd[1]: Starting Hostname Service...
Aug 8 16:52:49 wabac dbus[945]: [system] Successfully activated service 'org.freedesktop.hostname1'
Aug 8 16:52:49 wabac systemd[1]: Started Hostname Service.
Aug 8 16:52:55 wabac org.gtk.vfs.Daemon[2113]: ** (gvfsd:2168): WARNING **: dbus_mount_reply: Error from org.gtk.vfs.Mountable.mount(): Failed to retrieve share list from server: Invalid argument
Can anyone shed any light on this?
Thanks in advance for any help that anyone can provide.

thomas.hedden 08-08-2019 06:35 PM

P.S. Another piece of information: the Windows 7 client can see the Windows 10 client on the LAN, but the Windows 7 client cannot see the Ubuntu client. This is another clue suggesting that the Samba problem is on the Ubuntu machine rather than on the Windows machine(s).

thomas.hedden 08-09-2019 08:57 AM

I left my Ubuntu computer on overnight, and now I can see all the Samba shares, so this matter is resolved. However, I am still curious whether anyone can suggest how to speed things up. Does Samba really take ten hours to see shares?

wpeckham 08-09-2019 09:32 AM

When a samba connection error appears, first check your clocks. While it is not often the cause, it is fast and easy to check and causes problems often enough to be worth the time to check. Windows services are very sensitive to time mismatches. If your clocks do not match (it may only take a few seconds difference) then the domain membership calls may fail in the security checks.

If you have NTP set up to sync clocks, and they are far off, it can take hours for the drift to bring them into perfect match.

I am not saying that this is what happened here, we have inadequate evidence to confirm a cause, but this fits your reported symptoms.

michaelk 08-09-2019 09:32 AM

Below is a very old article but it explains how SMB version 1 network browsing works and could be what you experienced. Basically each computer will broadcast their existence at boot up and about every 12 minutes. With two other computers it might take 30 minutes or so. Configuring the Ubuntu computer to be a WINS server or always win the master browser election would help speed things up.

https://www.samba.org/samba/docs/old...kBrowsing.html

thomas.hedden 08-09-2019 10:01 PM

Thank you for your suggestion. I checked the time settings on my Windows 7 computer, and the choices are:
time.windows.com
time.nist.gov
time-nw.nist.gov
time-a.nist.gov
time-b.nist.gov
My Windows 7 computer is currently set to "time.windows.com", which must be the default because I don't remember changing it. The dialog box also says "This computer is set up to automatically synchronize on a scheduled basis", although it does not say what that scheduled basis is. I suppose that it might only check once a day, which would easily explain everything: The computer is a few years old and the first night it was powered off overnight, so the battery on the motherboard might not have been able to keep the time accurate overnight, and so the time got off. The second night the computer was left on overnight and the time could have been updated overnight, so the next morning the time was correct again.
I checked the time settings on my Ubuntu computer, and the only options are manual and "Set the time: Automatically from the Internet". It does not way where on the Internet.
If you have a suggestion about which of the time choices to use on my Windows 7 machine, please let me know.
Thank you again for your help.
Tom
--
Quote:

Originally Posted by wpeckham (Post 6023347)
When a samba connection error appears, first check your clocks. While it is not often the cause, it is fast and easy to check and causes problems often enough to be worth the time to check. Windows services are very sensitive to time mismatches. If your clocks do not match (it may only take a few seconds difference) then the domain membership calls may fail in the security checks.

If you have NTP set up to sync clocks, and they are far off, it can take hours for the drift to bring them into perfect match.

I am not saying that this is what happened here, we have inadequate evidence to confirm a cause, but this fits your reported symptoms.


wpeckham 08-10-2019 05:43 AM

Checking WHAT they sync time from is good information to know, but not what I intended. You should know BOTH sources: what Windows syncs form and what the Linux machine syncs time from.

What you want to do to diagnose if the clock is involved is to check the actual system time to the second on the Linux machine AND the Windows machine DURING THE PROBLEM. Checking now, when there is no problem, I think you will find that they are in very close agreement. Checking during the problem will tell you if there is a clock mismatch helping to CAUSE the problem.

thomas.hedden 08-11-2019 06:37 PM

I decided to repeat the "experiment". Once again I powered down both machines overnight. Once again, the Linux machine cannot see the Windows network at all. The Windows machine can see the other Windows computer(s) on the LAN, but not the Linux machine. It's hard to check the time on both the Linux machine and the Windows 7 machine simultaneously because I'm running both of them through a KVM switch, and there is a several second latency when I switch between the machines, so I have to count in my head. However, I believe that there is a difference of about two seconds between the two machines. I'll have to connect a second monitor in order to be sure about this. If I repeat the "experiment" again, I'll have the two computers connected to separate monitors side-by-side. I will also recheck the time on both as soon as the Samba connection works again.


All times are GMT -5. The time now is 07:21 AM.