winfsp / sshfs-win

SSHFS For Windows
https://winfsp.dev
Other
5.11k stars 257 forks source link

Resource temporarily unavailable after inactivity #49

Open sganis opened 6 years ago

sganis commented 6 years ago

My setup:

WinFsp-FUSE version 2.8
SSHFS version 2.7
OpenSSH_7.5p1, OpenSSL 1.0.2k  26 Jan 2017
Local Windows 10
Remote Centos 7

My sshfs command line:

sshfs.exe user@10.0.0.10:/ Z: -f -orellinks -oreconnect -ouid=-1,gid=-1,create_umask=0007 
    -oVolumePrefix=/sshfs/user@10.0.0.10 -ovolname=LINUX-10.0.0.10 
    -oFileSystemName=SSHFS -oStrictHostKeyChecking=no -oServerAliveInterval=10

After some inactivity, the Z: drive becomes unavailable, and the console shows this error:

failed to fork: Resource temporarily unavailable
read: Software caused connection abort
      2 [main] sshfs 8440 fork: child -1 - forked process 11836 died unexpectedly, 
      retry 0, exit code 0xC0000142, errno 11

Checking the processes in the task manager, sshfs.exe is still running, but ssh.exe is gone.

4O4 commented 6 years ago

Have you been doing anything unusual with your sshfs-win installation? How long is the inactivity period, are we speaking of minutes or hours here?

This is a rather common cygwin error. I'm not really sure what could have triggered it in your case, because in my experience it can just randomly happen out of the blue. The only way to fix it is to use rebaseall utility shipped with with cygwin and to be honest it's not always as easy as just running this command.

Useful background info about the problem: https://chromium.googlesource.com/chromium/src/+/master/docs/cygwin_dll_remapping_failure.md

sganis commented 6 years ago

Nothing unusual to the sshfs-win installation. Inactivity of hours, usually the next day, but it has happened in the same say.

pavelxkrejci commented 6 years ago

I had similar issues with some less common SSH servers which was related to SSH rekeying. The problem was caused by some bug or incompatibility on the server part and the fact, that sshfs (or sshfs-win?) does not detect stalled connection and just hangs. Other ssh client at least throw up error hinting rekey issue. You can try to trigger the rekey by uploading big files (2GB+) or try workarounds by temporarily disabling rekeying. I did not create bugreport due to specific requirements for reproduction, time constraints and that I'm not sure if the problem is in sshfs or in sshfs-win.

sganis commented 6 years ago

@4O4 I tried the rebaseall and it worked.

I followed this: https://stackoverflow.com/questions/9300722/cygwin-error-bash-fork-retry-resource-temporarily-unavailable

And then I had to build sshfs-win again using make to create a new msi installer, it looked simpler than replacing the dlls or running rebaseall in the mini cygwin coming with sshfs-win.

I have to read more about this cygwin rebase issue, but I wonder if this new installer will work in other machines.

This trick fixed issue #51 too, by the way.

billziss-gh commented 6 years ago

Just to clarify that the sshfs.exe program that ships with SSHFS-Win can only be used safely within the mini-Cygwin environment that ships with it. This is because of the "rebase" problem, but also other problems that can happen in a mixed environment.

If you build SSHFS yourself under your Cygwin you should be safe.

sganis commented 6 years ago

@billziss-gh Is there another way to fix it? Please explain more.

billziss-gh commented 6 years ago

I just meant to say that if you use the sshfs.exe program from an existing Cygwin prompt, you are likely to have problems, because SSHFS-Win ships with its own mini-Cygwin environment which may conflict in interesting ways with your existing Cygwin environment.

One way around this is to build SSHFS (not SSHFS-Win) under your existing Cygwin installation. Instructions for doing this have been posted elsewhere, but here is a brief summary:

er1z commented 6 years ago

I noticed something weird — I have some PHP-Symfony project on Linux VM. I want to mount this proj via SSHFS and start PHPStorm. Indexing works but suddenly — mounted resource disappears and becomes completely unavailable. During this sshfs-win process is being killed and started many times. What should I do in order not to get the mount point disappeared?

billziss-gh commented 6 years ago

@er1z

It sounds like sshfs is crashing.

Please open a new issue and give the following information.

er1z commented 6 years ago

Kudos for quick reply, supplying ticket.