Posh-SSH icon indicating copy to clipboard operation
Posh-SSH copied to clipboard

Set-SFTPItem Hanging when Quota Exceeded on server

Open comccall opened this issue 1 year ago • 3 comments
trafficstars

When attempting to send a file to an SFTP server using Set-SFTPItem, the command will hang indefinitely if the user has exceeded the storage quota on the server.

In my example, the file will be partially uploaded to the destination and then stop, but instead of returning an error the command hangs until manually stopped. I'm not sure how to capture log output using Posh-SSH for an issue like this.

A similar problem occurs when using the WinSCP .NET assembly, which returns the following in the log:

2024-02-02 00:27:03.298 Status code: 15, Message: 17414, Server: Maximum upload file size quota exceeded for user, Language: en-US 2024-02-02 00:27:03.548 Received SSH2_MSG_CHANNEL_DATA for nonexistent channel 0 2024-02-02 00:27:03.548 Attempt to close connection due to fatal exception: 2024-02-02 00:27:03.548 Received SSH2_MSG_CHANNEL_DATA for nonexistent channel 0 2024-02-02 00:27:03.548 Closing connection. 2024-02-02 00:27:03.548 Fatal error while disposing the SFTP queue. 2024-02-02 00:27:03.548 Connection was lost, asking what to do. 2024-02-02 00:27:03.548 Asking user: 2024-02-02 00:27:03.548 Received SSH2_MSG_CHANNEL_DATA for nonexistent channel 0 () 2024-02-02 00:27:03.548 Script: Received SSH2_MSG_CHANNEL_DATA for nonexistent channel 0 2024-02-02 00:27:08.564 Answer: Retry 2024-02-02 00:27:08.564 Script: Searching for host...

comccall avatar Feb 02 '24 18:02 comccall

Sadly the library does not return that error for me to handle in the module. Seems WinSCP is able to receive the error code and raise it.

darkoperator avatar Feb 02 '24 21:02 darkoperator

Bummer, but thank you for the reply 👍

comccall avatar Feb 02 '24 22:02 comccall

@comccall Given this can't be fixed within Posh-SSH perhaps this can be closed?

robinmalik avatar Jun 25 '24 11:06 robinmalik