evsar3 / sshfs-win-manager

A GUI for SSHFS-Win (https://github.com/billziss-gh/sshfs-win)
MIT License
1.11k stars 84 forks source link

I have this issue where its perpetually loading but the drives are already mounted? #148

Open arty01238 opened 2 years ago

arty01238 commented 2 years ago

image

Turtle-Boi commented 2 years ago

Same here

evsar3 commented 2 years ago

Hello,

Try this: https://github.com/evsar3/sshfs-win-manager/issues/9#issuecomment-614713162

ghost commented 2 years ago

I have the same issue. I tried editing %AppData%\sshfs-win-manager\vuex.json as suggested, but that did not change antyhing for me.

When I look in the vuex.json file it stands out that the the one drive that is marked as "mounted" has a non-null pid key (and the status: connected), while all the loading items have pid: null and status: connecting. All connections are actually mounted and in the task manager I can see multiple sshfs.exe processes with distinct PID's and the correct command line.

BOZG commented 2 years ago

I also started having this issue recently on an updated Windows 11 install. Some observations in case they help with troubleshooting the problem:

When the issue emerged, the one connection that worked correctly was the one connection that always worked correctly. Restarting SSHFS or rebooting the machine did not at any point lead to any other connection working correctly. In case it's relevant, it's the first connection on my list.

Disabling auto-connection on the "working" connection and restarting SSHFS led to one of the non-working connections taking over as the working connection. This then became the one connection that worked every single time. In case it's relevant, it is the third connection on my list.

Re-enabling auto-connection on the first connection (the one that worked initially) led to it once again becoming the only working connection.

Turning off auto-connection on all connections and connecting manually leads to things working correctly.

Turning off auto-connection on all but one of the connections and connecting the others manually also works without issues.

BOZG commented 2 years ago

Not sure if it's definitely related but I've noticed just now that trying to manually start multiple connections quickly leads to the same issue. The first connection works fine but subsequent connections keep spinning. When auto-connect is enabled, does SSHFS try to mount all connection simultaneously? Could the issue be resolved by forcing a short delay before each connection is mounted? Waiting 1-2 seconds seems to be enough for me.

evsar3 commented 2 years ago

I'm thinking in disable the 'connect' button for all other connection profiles while there is a connection pending. This should allow to connect one connection at a time.

ShayBox commented 2 years ago

If it's a race causing the issue there should be a lock when a connection starts until it's finished, such as a simple boolean

TTSKarlsson commented 1 year ago

I want to provide one possible solution to getting the pids that this app needs, this is not a solution for users but only for the repo owner:

PS C:\> get-process | Where-Object { $_.ProcessName -eq "sshfs" } | ForEach-Object { Write-Output "`n$($_.Id) $($_.CommandLine)" }

2092 "C:\Program Files\SSHFS-Win\bin\sshfs.exe" username@firsthost:/home/username/dev/app/sites W: -p22 ...

6436 "C:\Program Files\SSHFS-Win\bin\sshfs.exe" username@secondhost:/home/username/knowledge Y: -p22 ...

8072 "C:\Program Files\SSHFS-Win\bin\sshfs.exe" username@secondhost:/home/username X: -p22 ...

17100 "C:\Program Files\SSHFS-Win\bin\sshfs.exe" username@firsthost:/home/username/work V: -p22 ...

That powershell command will get all the sshfs processes and write out their process id and launch cmd, which can easily be parsed to see which process id belongs to which connection. If one connection is not shown on this it is disconnected, if it is shown it is connected. The command line is quite long and contains a lot of info that I cut out that could be useful too.

TheKingEagle commented 1 year ago

I've been looking at this for a bit, I took out a line, which seems to fix the issue. However, I am not sure if that negatively affects things elsewhere. As others noted, the problem occurs if multiple drives are mounted with the option "mount on startup" selected.

/src/MainWindow/index.vue connect(conn): line ~103 ish

// ...
const connect = c => {
        ProcessManager.create(c).then(pid => {
          conn.pid = pid
          conn.status = 'connected'
          // this.updateConnectionList() // Removing this line appears to fix the issue?
        }).catch(error => {
          conn.status = 'disconnected'

          this.updateConnectionList()

          this.notify(`Can't connect to '${conn.name}': ${error}`, 'error-icon')
        })
// ...

Edit: This introduces a trouble condition. If one drive fails to mount, the others will perpetually load.