PutFiles Reconnect Loop when Quota Exceeded

Advertisement

c0dman
Joined:
Posts:
2

PutFiles Reconnect Loop when Quota Exceeded

Hello,

I am uploading a file to an SFTP server using PowerShell WinSCP .NET Assembly.
WinSCP Version 6.1.2

If the file size quota is exceeded on the server then the connection will be closed and retried in an infinite loop.
Status code: 15, Message: 57094, Server: Maximum upload file size quota exceeded for user, Language: en-US
Here is a log excerpt. A full log is attached.
..
< 2024-02-02 00:27:53.226 Status code: 15, Message: 57094, Server: Maximum upload file size quota exceeded for user, Language: en-US 
. 2024-02-02 00:27:53.460 Received SSH2_MSG_CHANNEL_DATA for nonexistent channel 0
. 2024-02-02 00:27:53.476 Attempt to close connection due to fatal exception:
* 2024-02-02 00:27:53.476 Received SSH2_MSG_CHANNEL_DATA for nonexistent channel 0
. 2024-02-02 00:27:53.476 Closing connection.
. 2024-02-02 00:27:53.476 Fatal error while disposing the SFTP queue.
. 2024-02-02 00:27:53.476 Connection was lost, asking what to do.
. 2024-02-02 00:27:53.476 Asking user:
. 2024-02-02 00:27:53.476 Received SSH2_MSG_CHANNEL_DATA for nonexistent channel 0 ()
< 2024-02-02 00:27:53.476 Script: Received SSH2_MSG_CHANNEL_DATA for nonexistent channel 0
. 2024-02-02 00:27:58.492 Answer: Retry
< 2024-02-02 00:27:58.492 Script: Searching for host...
..
I tried turning off TransferOptions.ResumeSupport and setting Session.ReconnectTime to 1, but the result is the same.

Are there any other options to limit the number of retries that will be attempted, or exit when the quota exceeded status is returned by the server?

Thank you.
  • log.txt (222.54 KB, Private file)

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,605
Location:
Prague, Czechia

Re: PutFiles Reconnect Loop when Quota Exceeded

I guess you already know that it is not possible, yet:
Issue 1937 – Limit overall number of reconnects

Had your server just failed the upload, WinSCP would behave sensibly.
But as your server for some strange reason closes the connection (and there's no way WinSCP might know that the connection was closed because of the quota limit, and not because the connection was broken for network/external reasons), it reconnects and retries the transfer.

Reply with quote

c0dman
Joined:
Posts:
2

Thank you Martin.

I found an old thread (Prevent session reconnect) where you recommended to use the below to prevent reconnects altogether:
Session.AddRawConfiguration("Interface\SessionReopenAuto", "0")

I tested this in my scenario and the session is aborted and an exception is thrown:
Exception calling "Check" with "0" argument(s): "Received SSH2_MSG_CHANNEL_DATA for nonexistent channel 0"
I should have read the Raw Configuration documentation... https://winscp.net/eng/docs/rawconfig#sessionreopenauto

Reply with quote

Advertisement

You can post new topics in this forum