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 774303 - Cannot save to symlinked gvfs mount
Cannot save to symlinked gvfs mount
Status: RESOLVED DUPLICATE of bug 768281
Product: gtksourceview
Classification: Platform
Component: File loading and saving
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-11 23:17 UTC by Brian
Modified: 2016-12-07 12:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Brian 2016-11-11 23:17:15 UTC
Related meld issue: https://bugzilla.gnome.org/show_bug.cgi?id=774235
I was told to file here instead.

I'm using Ubuntu (Lubuntu to be exact) 16.10 with libgtksourceview-3.0-1 (Version: 3.20.4-1). I noticed that since meld switched to using gtksourceview's file saving mechanism in meld 3.15.2, I could no longer save files to my gvfs mount. Specifically, I have a symlink in my home directory that points to the actual gvfs mount path (e.g. '/run/user/1000/gvfs/').

The particular error looks like:

g-io-error-quark: Error opening file '/home/mscdex/sftp_mounts/sftp:host=somehost/path/to/file/being/saved': Operation not supported (15)

Saving the same file with Geany or meld 3.15.1 or earlier (which uses Python's own file API) for example works just fine.
Comment 1 Sébastien Wilmet 2016-11-12 15:55:18 UTC
Try gvfs on the command line, for example the gvfs-cat command.

I don't think GtkSourceView does something special, it uses the GFile API provided by GIO, which uses GVfs backends for different protocols.
Comment 2 Brian 2016-11-12 18:17:41 UTC
FWIW I can load files from my gvfs sftp mount via meld just fine and so `gvfs-cat` also works.

I also tried `gvfs-save` and that works just fine too. I wonder if it is specifically something related to gvfs mounts though, since the `gvfs-cat`/`gvfs-save` commands use a separate connection (sftp in my case).
Comment 3 Brian 2016-11-12 18:19:04 UTC
Oops, submitted too soon -- I should have said that I'm *assuming* it makes a separate connection and does not use existing gvfs mounts for the `gvfs-*` commands (if it finds a match).
Comment 4 Sébastien Wilmet 2016-11-13 11:22:24 UTC
Try to open meld from the command line with the URI that triggers the error. For example:
$ meld <file1> <file2>

Then, in the same directory, do:
$ gvfs-cat <file1>

Does the gvfs-cat command return the same error as in Meld?
Comment 5 Sébastien Wilmet 2016-11-13 11:26:47 UTC
Note to Meld developers: you need to call gtk_source_file_set_mount_operation_factory() to create a GtkMountOperation, not a GMountOperation. IIRC, a GMountOperation doesn't work for a GUI.
Comment 6 Brian 2016-11-13 14:49:44 UTC
I just tried that and that works fine. Loading isn't the problem though, it's saving, and `gvfs-save` works but not meld.
Comment 7 Sébastien Wilmet 2016-11-13 15:20:05 UTC
Ok, can you try with gedit?

If the same problem occurs with gedit, it would be useful to have a backtrace to know where the error occurs.
Do something like this:
$ export G_DEBUG=all
$ gdb <program>
When the error occurs (if it's the first one), do:
> backtrace

This will work only if you see a warning/critical message in the console. If the error is displayed only in the GUI, it won't work.
Comment 8 Sébastien Wilmet 2016-11-13 15:30:11 UTC
Actually what would be more useful is the debug info, you need to re-compile GtkSourceView after enabling the DEBUG macro in gtksourceview/gtksourcefilesaver.c.
Comment 9 Brian 2016-11-13 16:00:43 UTC
meld displays the error in a popup dialog box, so there is no error in the console.

I compiled the same version of gtksourceview with the DEBUG enabled as you suggested and what I get in the console when saving the file in meld is:

Start saving
Check externally modified
check_externally_modified_cb
Start replacing file contents
Make backup: no
replace_file_cb
Opening file failed: Error opening file '/home/mscdex/sftp_mounts/sftp:host=somehost/path/to/file': Operation not supported

In meld though, there is a ' (15)' appended to the end of the 'Operation not supported' FWIW.
Comment 10 Brian 2016-11-13 16:42:07 UTC
Ok, I can confirm it has to do with the symlink because directly using /run/user/1000/gvfs/... instead of the symlink which points to that directory, works.
Comment 11 Sébastien Wilmet 2016-11-13 19:21:18 UTC
It's more probably a bug in GVfs.
Comment 12 Brian 2016-11-13 19:40:35 UTC
Ok.... I've filed a gvfs issue here: https://bugzilla.gnome.org/show_bug.cgi?id=774371
Comment 13 Sébastien Wilmet 2016-12-07 12:07:27 UTC

*** This bug has been marked as a duplicate of bug 768281 ***