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 757555 - [regression] After unmounting / "ejecting" a remote network share bookmark, cannot remount it/access its contents ("empty folder" error)
[regression] After unmounting / "ejecting" a remote network share bookmark, c...
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Sidebar
3.18.x
Other Linux
: Normal major
: 3.18
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 756755 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-11-04 01:15 UTC by Jean-François Fortin Tam
Modified: 2015-12-11 22:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window-slot: invalidate file attributes on reload (3.76 KB, patch)
2015-12-11 21:43 UTC, Carlos Soriano
committed Details | Review

Description Jean-François Fortin Tam 2015-11-04 01:15:24 UTC
1. Have a bookmark to one of your favorite sftp servers in the Nautilus sidebar
2. Click it; the remote share gets mounted and the contents get shown (except in the case of bug #757553)
3. Click the eject/unmount button/icon *on the mounted remote in the sidebar* (not from within the "Other places" area)

Result: the share gets unmounted... but you can never re-mount it again, because clicking the bookmark again leads you to a "The folder is empty." message instead of trying to mount it.
Comment 1 Robin A. Meade 2015-11-24 21:43:11 UTC
I confirm this for Nautilus 3.18.2 on Fedora 23.

It happens for me with sftp:// servers. smb:// servers work fine.

My workaround:

1. After getting "The folder is empty" message, click each button in the "breadcrumbs bar" starting at the leftmost button, which represents the root of the remote server.

2. If you get the error "Oops! Something went wrong. Location is already mounted," click F5 to refresh.
Comment 2 Carlos Soriano 2015-11-25 21:31:55 UTC
Can you try one thing for me?

Bookmark a root location of your server.
Click the bookmark.
Wait til open.
Unmount on the sideber.
Click the bookmark again.

Does it crash?

Thanks
Comment 3 Robin A. Meade 2015-11-25 22:40:37 UTC
That scenario worked fine. It did not crash.
Comment 4 Robin A. Meade 2015-11-25 22:53:22 UTC
Oh, and I take back what I said about smb servers. It turns out smb servers exhibit the similar behavior to sftp servers.

smb://WORKGROUP;user@example.com/sharename/ 

works fine. I can unmount and remount the bookmark. 

But if I add additional path, like:

smb://WORKGROUP;user@example.com/sharename/subdir1/

this gives the "The folder is empty" message if I try to mount the bookmark a 2nd time.
Comment 5 Carlos Soriano 2015-11-26 00:02:06 UTC
hm I see, that scenario should crash if my understanding is correct about the issue. Basicallly I'm pretty sure is a ref counting issue.

Explanation (mostly as a personal note):

Currently, file attributes are invalidate when changing location
if the location is either a regular file, so it needs to go
to the parents to search for a directory, or when the file is
a mount and it's not mounted.
However, once the file info is retrieved is cached and it needs to be 
invalidated if it wants to check if it's mounted or not.

When changing locations, NautilusWindowSlot is the responsible of taking
care of knowing if the location needs mounting.
How does it?
It simply tries to get the general info from the file, and if the file
is not mounted an error will be reported, then window slot will mount it
and afterwards will try to get again the general info of the file, and
this time if everything went well will succeed and the location will
finally change.

However, nautilus cache the info of the files, therefore if nothing
invalidates that info, when requested it returns the cached info.

The problem with this is that, as an example, if try to open an
unmounted location for first time the info is not cached and everything goes
well, however if there is a ref count issue and the file is unmounted, since
nautilus splits directories and file management, the directory gets
correctly eliminated following the unmounting (since it's the parent),
however the associated file is not finalized due to a leak, making
the info of the file be "valid", so next time nautilus tries to request
its info to see if it is mounted it will say it is, because the info
is cached.

To workaround it the info can be invalidated before changing locations, and
actually window slot already does that for some of its operations (which I
don't agree since it's a "workaround all" thing), however I prefer to fix
the real issue, the ref counting.
Comment 6 Carlos Soriano 2015-12-11 10:15:47 UTC
-> 3.18, track it to close it when done. I'm on it.
Comment 7 Carlos Soriano 2015-12-11 21:43:48 UTC
Created attachment 317233 [details] [review]
window-slot: invalidate file attributes on reload

Files attributes in nautilus are cached, and sometimes having a cached
value its problematic for special cases like mounting due to how window
slot mounts locations, which relies in the file not having the mount
information ready, which is not true when the file doesn't get
finalized and doesn't get acknowledge by the volume monitor when its
root gets unmounted.

To avoid that, invalidate all file attributes when changing locations.

A better solution for this specific case would be to make the root
volume monitor to acknowledge all its children when unmounted, and keep
it alive as long as there are children.

But this fix is anyway needed since previous 3.18 is how it was done and
seems it's a needed for now "workaround all" issues with cached values.
Comment 8 Carlos Soriano 2015-12-11 21:44:22 UTC
*** Bug 756755 has been marked as a duplicate of this bug. ***
Comment 9 Carlos Soriano 2015-12-11 22:06:58 UTC
Attachment 317233 [details] pushed as 3bca716 - window-slot: invalidate file attributes on reload