You are not logged in.

#1 2023-09-29 04:55:26

LorenAmelang
Member
Registered: 2020-10-13
Posts: 11

"target already exists" trying to open files on SSHFS drive

I have several Libre Calc files stored on a local server that is mounted via SSHFS on the Arch Linux machine that runs Calc (7.5.5). Calc is usually already loaded and minimized. Doesn't seem to matter if I expand it and click a "recent document" icon or use a menu. Often the files just open normally like any other file.

But randomly I get a small dialog saying "target already exists" with the only option being "OK". The colorful wait cursor continues to spin for maybe a minute, but nothing else happens. Sometimes an immediate retry will work properly, sometimes another selection method seems to be required. Once the file is open, all other actions including save and close work normally.

This keeps happening, particularly if the computer has been to "hybrid sleep" since the particular file was last opened. Sometimes a second try from that Recent files page will open right up, sometimes I have to go find the file in Nemo file manager. Sometimes double clicking it there works, sometimes right click and open in Libre is required.

Text files sometimes fail to open in Sublime Text, but they don't show any error or popup message, it just opens an empty file with the chosen name and no content. Trying again with a different navigation method almost always works.

Support sites for those apps think this is a Linux problem...


Maybe a different problem - but related? Sometimes no app can open any file on SSHFS, and I find /run/user/1000/gvfs is empty.
If I close that Nemo and open a new one, and click a Bookmark to an SSHFS file, the
/run/user/1000/gvfs/sftp:host=10.1.1.4,user=ubuntu
folder (or whichever server I retried) magically appears, with lots of old content. I have to visit each server to get them all working again.


Should "hybrid sleep" always preserve the SSHFS config? Or is this randomness expected?

Offline

#2 2023-09-29 06:51:59

seth
Member
Registered: 2012-09-03
Posts: 60,787

Re: "target already exists" trying to open files on SSHFS drive

The issue seems to rather gvfs than sshfs?
https://wiki.archlinux.org/title/SSHFS#On_demand

Edit: you can expect the connection to be cut when you suspend and certainly when you hibernate the system. The problem is to re-establish it.

Last edited by seth (2023-09-29 06:52:50)

Offline

#3 2023-09-29 07:05:34

-thc
Member
Registered: 2017-03-15
Posts: 775

Re: "target already exists" trying to open files on SSHFS drive

Having experienced similar issues after resuming from standby I think you've stumbled over a problem that's inherent to file server network connections and standby in general.

Try to think from the SSHFS server's side - after entering standby your PC simply stops sending and/or responding to any packets for this connection. After passing the inevitable timeouts the server simply closes that connection assuming it's dead.

You resume your session and your PC thinks it's SSHFS connection is still up and running while the server closed it and cannot "resume" it. Your actions finally lead to your PC abandoning the old connections and creating new ones.

What can you do?
- try the "reconnect" option of SSHFS
- Unmount all open SSHFS connections before entering standby
- Stop using standby wink

Offline

#4 2023-09-29 07:25:18

seth
Member
Registered: 2012-09-03
Posts: 60,787

Re: "target already exists" trying to open files on SSHFS drive

@-thc, did you encounter those only w/ gvfs are also w/ automounts?

Offline

#5 2023-09-29 11:06:54

-thc
Member
Registered: 2017-03-15
Posts: 775

Re: "target already exists" trying to open files on SSHFS drive

@seth: NFS / automount /w timed dismount / suspend while NFS mounts were still active.

Offline

#6 2023-09-29 19:42:36

LorenAmelang
Member
Registered: 2020-10-13
Posts: 11

Re: "target already exists" trying to open files on SSHFS drive

@seth: Yes, it is probably a gvfs issue. I just think of it generically as SSHFS. What I don't understand is why the connection only disappears sometimes, and other times it is ready to go after an overnight of WOWLAN Suspend. And why does opening a new Nemo view recreate it?

Hmmm...  maybe if I close all Nemo windows before Suspend... 

@-thc: I'd love to just have Arch live 24/7, but my power is exclusively solar and the dark season is approaching. WOWLAN is a decent compromise. Could "reconnect" cope with overnight interruptions?

Secure ShellFish SSHFS on my iPad notices my Arch is sleeping and puts up an icon, but it remembers the setup and connects normally once it is awake. Of course the iPad remains awake during the overnight, while Arch doesn't have that luxury.

This is a minor inconvenience in the scheme of things...

Offline

#7 2023-09-29 20:15:15

seth
Member
Registered: 2012-09-03
Posts: 60,787

Re: "target already exists" trying to open files on SSHFS drive

If you move from gvfs to fstab automount entries the remote FS will also be avialable to non-gvfs clients and you could use a sleep hook to automatically umount them.
One pitfall might be if the remote FS is in active use when you suspend (eg. by some file indexer?)

The new (nemo) process will trigger a re-mount while any running gvfs clients probably just rely on cached data, falsely assuming the FS is still there.

Offline

Board footer

Powered by FluxBB