Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

@c0dman: Indeed, you are right. I've forgot about this option :)
c0dman

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
martin

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.
c0dman

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.