After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 578139 - smb mounts stop working after idle time
smb mounts stop working after idle time
Status: RESOLVED NOTGNOME
Product: gvfs
Classification: Core
Component: smb backend
1.2.x
Other Linux
: Normal major
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2009-04-06 14:53 UTC by Sebastien Bacher
Modified: 2015-03-27 20:20 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26



Description Sebastien Bacher 2009-04-06 14:53:58 UTC
the bug has been described on https://bugs.launchpad.net/bugs/310932

"I have a two Samba Servers, one on Suse 11 and one on FreeBSD and Ubuntu Desktop shows the same problems.

I have some Network Resources bookmarked. When I need to access a certain place, I simply use the bookmark, which works fine and a Shotcut is created on the desktop, which also works great. After idleing around, I like to access the network share again but the shortcut on the Desktop errors out, so does the bookmark - the errors are attached.

I have to unmount the resource and access it then via the bookmark (abviously as the desktop shortcut gets removed) and can happily access the network resource.

Desired effect: - I like to access my Samba Server independently of how much time passed meanwhile

http://launchpadlibrarian.net/20688781/Screenshot--%20on%20trinity.dominion.ch%20%28smb%3A--trinity.dominion.ch-data%29%20-%20gedit.png"

http://launchpadlibrarian.net/20688782/Screenshot-Untitled%20Window.png
Comment 1 Kelder, P. 2009-07-14 14:03:12 UTC
I experience the same bug.

I noticed the frequency off disconnects varies per windows share. Perhaps the problem arises when the server is reaching it's max connections.
Comment 2 Ross Lagerwall 2014-05-31 12:37:53 UTC
AFAIK, libsmbclient (what gvfs uses for smb) should reconnect if the connection times out. However, in my testing, this doesn't work properly. I have opened an upstream bug for this: https://bugzilla.samba.org/show_bug.cgi?id=10615
Comment 3 yvan 2015-01-19 14:44:53 UTC
On this bug report https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/1401917, Samuel Seay says that gvfs (or libsmbclient, I don't know which one should do that) should periodicaly sends a SMB Echo Request packet to keep the connection up.

This would make sense, because a periodic "ls" on the share is sufficient to keep the mount alive.
Comment 4 Ross Lagerwall 2015-01-19 22:26:54 UTC
It's possible to set the idle timeout to be really low (like 10 seconds) which would break hacks like this.  E.g. how often is periodic?

In my testing, libsmbclient reconnects automatically after an idle drop which is how it should work, but it only does it properly after it has failed once...

If you want this to progress, hassle the Samba people :-)
(see the bug I filed in comment 2)
Comment 5 lightningth 2015-01-21 18:37:37 UTC
I reported this bug on Launchpad (bug #1401917). The issue is that gvfs is not sending the periodic smb echo request command while other smb utilities like cifs does send the echo request to avoid the timeout.

If gvfs was modified to send the smb echo request it would fix the timeout issue. This was tested by running wireshark and watching all smb traffic. The server eventually disconnects gvfs due to a server side idle timeout but gvfs ignores that the socket is closed and attempts to continue using it.
Comment 6 Ross Lagerwall 2015-01-21 20:05:01 UTC
gvfs uses libsmbclient which should handle this but doesn't correctly nor does it expose the ability to send echo requests. Hence the bug report in comment 2.
Comment 7 garrett.mitchener 2015-03-13 15:51:13 UTC
To connect some dots: I think I'm having problems with this same issue. What I see is bad behavior in Deja Dup, which is a backup program that can store backups to Windows shares. It runs automatically at night, and if I happen to have mounted the shared drive where it stores stuff before I leave work, I arrive the next morning and see a "software caused connection abort" error message and the backup has failed. I think what's happening is that the server times out, and the connection doesn't recover gracefully.

I found this bug report

https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1321354

which suggests running a script to look at the gvfs mounts every 5 minutes.  This works -- I think it keeps the server from timing out, and my backups are working without an error as long as the script is running.  It greatly improves the responsiveness of Nautilus as well.
Comment 8 Ross Lagerwall 2015-03-27 20:20:03 UTC
This has been fixed upstream and backported to 4.2 and 4.1:
https://bugzilla.samba.org/show_bug.cgi?id=11079

If you want this fixed, please ask your distros to backport the relevant patches (or wait for new releases of 4.1 or 4.2).