TehnoBlog.org

WinSCP – How To Fix Drag & Drop Hanging and Freezing Issue

WinSCP is an excellent file manager & SFTP/FTP application for Windows operating systems. However, on occasion you may find few things very odd that you’d like to change or that they don’t work as expected, but the app packed with options has its drawbacks – where to find the damn setting and turn it on or off!?

WinSCP – How To Fix Drag & Drop Hanging and Freezing Issue

Recently, I’ve noticed that WinSCP randomly hangs and freezes when drag & drop file transfer operation is initiated from remote server side (left panel) to the local folder (right panel). The fact that it happened randomly without apparent and obvious cause was the most annoying and troubling thing. Remote file size wasn’t relevant, it regularly affected both small (100 MB) files.

WinSCP Preferences – Transfer Options – Drag & Drop

By the way, I use “fake file” transfer mode for Drag & Drop because it is more convenient and has some clear advantages. However, it was also the cause of the hanging issue, as it turned out. So, what can we do to fix this mysterious bug?

WinSCP Instructions: How To Debug WinSCP?

Enable Logging & Identify Problem

In order to try to find out what is going on, I’ve enabled debug logging level 2 and there were interesting lines that matched freezing moments – sometimes they were lasting as long as 40-45 seconds!

WinSCP Preferences – Debug Logging

Be careful where your .log files are saved, by default they are located in:

C:\Users\PC-Username\AppData\Local\Temp

folder and named with your connection prefix. This way, each connection will be logged in a separate file, for easier management and orientation. Of course, you can remove wildcard patterns or use different ones in the Log path box.

Here’s the log excerpt:

. 2021-03-19 11:54:22.863 Looking for network events
. 2021-03-19 11:54:22.863 Timeout waiting for network events
. 2021-03-19 11:54:23.129 Session upkeep
. 2021-03-19 11:54:23.131 Looking for network events



. 2021-03-19 11:54:27.140 Looking for network events
. 2021-03-19 11:54:27.140 Timeout waiting for network events

If you ask developer to obtain a special debugging version of WinSCP (which is not really required unless your issue cannot be resolved with regular logging), WinSCP logs will look different and less descriptive for ordinary users. The same hanging issue will look something like this in that case:

[00.00.00.263] [1060] [Queue.cpp:1076:TTerminalQueue::WaitForEvent] Entry: [00000000] [3]
[00.00.00.263] [1060] [Queue.cpp:1077:TTerminalQueue::WaitForEvent] 1 [44C] [468]
[00.00.00.263] [1060] [Queue.cpp:451:TSignalThread::WaitForEvent] Entry: [00000000] [4]
[00.00.00.263] [1060] [Queue.cpp:452:TSignalThread::WaitForEvent] 1 [44C] [468] [1000]
[00.01.00.263] [1060] [Queue.cpp:454:TSignalThread::WaitForEvent] 2 [258] [0]
[00.01.00.263] [1060] [Queue.cpp:464:TSignalThread::WaitForEvent] / [258]
[00.01.00.263] [1060] [Queue.cpp:451:TSignalThread::WaitForEvent] Exit: [00000000] [4]
[00.01.00.263] [1060] [Queue.cpp:1080:TTerminalQueue::WaitForEvent] 2 [1]
[00.01.00.263] [1060] [Queue.cpp:1076:TTerminalQueue::WaitForEvent] Exit: [00000000] [3]



[00.01.42.585] [1060] [Queue.cpp:1076:TTerminalQueue::WaitForEvent] Entry: [00000000] [3]
[00.01.42.585] [1060] [Queue.cpp:1077:TTerminalQueue::WaitForEvent] 1 [44C] [468]
[00.01.42.585] [1060] [Queue.cpp:451:TSignalThread::WaitForEvent] Entry: [00000000] [4]
[00.01.42.585] [1060] [Queue.cpp:452:TSignalThread::WaitForEvent] 1 [44C] [468] [1000]
[01:04:43.585] [1060] [Queue.cpp:454:TSignalThread::WaitForEvent] 2 [258] [0]
[01:04:43.585] [1060] [Queue.cpp:464:TSignalThread::WaitForEvent] / [258]
[01:04:43.585] [1060] [Queue.cpp:451:TSignalThread::WaitForEvent] Exit: [00000000] [4]
[01:04:43.585] [1060] [Queue.cpp:1080:TTerminalQueue::WaitForEvent] 2 [1]
[01:04:43.585] [1060] [Queue.cpp:1076:TTerminalQueue::WaitForEvent] Exit: [00000000] [3]

We have successfully identified the cause of our problem!

It seems that when main network drive server is offline, WinSCP is waiting for mapped network drives in Microsoft Windows Explorer to become online again (which usually never happens!), until internal timeout occurs and resumes transfer operation.

Windows 10 – Explorer – Mapped Network Drives

This is very annoying behavior, because most users actually rarely transfer remote FTP server files directly to the mapped network drives and almost exclusively use local drives and partitions instead.

WinSCP Instructions: How To Fix WinSCP Hanging / Freezing Issue

1. While connected – Go to Options > Preferences menu

WinSCP – Options – Preferences

2. Select Transfer > Drag & Drop section

WinSCP Preferences – Transfer Options – Drag & Drop – Exclude Network Drives Monitoring

In the “Allow dropping files to these network drives” text area enter all your mapped network drives (one line per drive seems to work). First enter a “minus” sign, followed by the mapped network drive letter e.g. -D, -E, -F, -X, -Y, -Z or whatever you have — see above screenshot for example.

Hanging / Freezing issue was finally resolved!